mirror of
https://gitlab.com/hibou-io/hibou-odoo/suite.git
synced 2025-01-20 12:37:31 +02:00
.pylintrc and updates to odoo-reload.py to signal more
This commit is contained in:
120
.pylintrc
Normal file
120
.pylintrc
Normal file
@@ -0,0 +1,120 @@
|
|||||||
|
[MASTER]
|
||||||
|
load-plugins=pylint_odoo
|
||||||
|
score=n
|
||||||
|
|
||||||
|
[ODOOLINT]
|
||||||
|
manifest_required_authors=Hibou Corp.
|
||||||
|
manifest_required_keys=license
|
||||||
|
manifest_deprecated_keys=description,active
|
||||||
|
license_allowed=OPL-1,AGPL-3,GPL-2,GPL-2 or any later version,GPL-3,GPL-3 or any later version,LGPL-3
|
||||||
|
valid_odoo_versions=15.0
|
||||||
|
|
||||||
|
[MESSAGES CONTROL]
|
||||||
|
disable=all
|
||||||
|
|
||||||
|
# This .pylintrc contains optional AND mandatory checks and is meant to be
|
||||||
|
# loaded in an IDE to have it check everything, in the hope this will make
|
||||||
|
# optional checks more visible to contributors who otherwise never look at a
|
||||||
|
# green travis to see optional checks that failed.
|
||||||
|
# .pylintrc-mandatory containing only mandatory checks is used the pre-commit
|
||||||
|
# config as a blocking check.
|
||||||
|
|
||||||
|
enable=anomalous-backslash-in-string,
|
||||||
|
api-one-deprecated,
|
||||||
|
api-one-multi-together,
|
||||||
|
assignment-from-none,
|
||||||
|
attribute-deprecated,
|
||||||
|
class-camelcase,
|
||||||
|
dangerous-default-value,
|
||||||
|
dangerous-view-replace-wo-priority,
|
||||||
|
development-status-allowed,
|
||||||
|
duplicate-id-csv,
|
||||||
|
duplicate-key,
|
||||||
|
duplicate-xml-fields,
|
||||||
|
duplicate-xml-record-id,
|
||||||
|
eval-referenced,
|
||||||
|
eval-used,
|
||||||
|
incoherent-interpreter-exec-perm,
|
||||||
|
license-allowed,
|
||||||
|
manifest-author-string,
|
||||||
|
manifest-deprecated-key,
|
||||||
|
manifest-required-author,
|
||||||
|
manifest-required-key,
|
||||||
|
manifest-version-format,
|
||||||
|
method-compute,
|
||||||
|
method-inverse,
|
||||||
|
method-required-super,
|
||||||
|
method-search,
|
||||||
|
openerp-exception-warning,
|
||||||
|
pointless-statement,
|
||||||
|
pointless-string-statement,
|
||||||
|
print-used,
|
||||||
|
redundant-keyword-arg,
|
||||||
|
redundant-modulename-xml,
|
||||||
|
reimported,
|
||||||
|
relative-import,
|
||||||
|
return-in-init,
|
||||||
|
rst-syntax-error,
|
||||||
|
sql-injection,
|
||||||
|
too-few-format-args,
|
||||||
|
translation-field,
|
||||||
|
translation-required,
|
||||||
|
unreachable,
|
||||||
|
use-vim-comment,
|
||||||
|
wrong-tabs-instead-of-spaces,
|
||||||
|
xml-syntax-error,
|
||||||
|
attribute-string-redundant,
|
||||||
|
character-not-valid-in-resource-link,
|
||||||
|
consider-merging-classes-inherited,
|
||||||
|
context-overridden,
|
||||||
|
create-user-wo-reset-password,
|
||||||
|
dangerous-filter-wo-user,
|
||||||
|
dangerous-qweb-replace-wo-priority,
|
||||||
|
deprecated-data-xml-node,
|
||||||
|
deprecated-openerp-xml-node,
|
||||||
|
duplicate-po-message-definition,
|
||||||
|
except-pass,
|
||||||
|
file-not-used,
|
||||||
|
invalid-commit,
|
||||||
|
manifest-maintainers-list,
|
||||||
|
missing-newline-extrafiles,
|
||||||
|
missing-readme,
|
||||||
|
missing-return,
|
||||||
|
odoo-addons-relative-import,
|
||||||
|
old-api7-method-defined,
|
||||||
|
po-msgstr-variables,
|
||||||
|
po-syntax-error,
|
||||||
|
renamed-field-parameter,
|
||||||
|
resource-not-exist,
|
||||||
|
str-format-used,
|
||||||
|
test-folder-imported,
|
||||||
|
translation-contains-variable,
|
||||||
|
translation-positional-used,
|
||||||
|
unnecessary-utf8-coding-comment,
|
||||||
|
website-manifest-key-not-valid-uri,
|
||||||
|
xml-attribute-translatable,
|
||||||
|
xml-deprecated-qweb-directive,
|
||||||
|
xml-deprecated-tree-attribute,
|
||||||
|
# messages that do not cause the lint step to fail
|
||||||
|
consider-merging-classes-inherited,
|
||||||
|
create-user-wo-reset-password,
|
||||||
|
dangerous-filter-wo-user,
|
||||||
|
deprecated-module,
|
||||||
|
file-not-used,
|
||||||
|
invalid-commit,
|
||||||
|
missing-manifest-dependency,
|
||||||
|
missing-newline-extrafiles,
|
||||||
|
missing-readme,
|
||||||
|
no-utf8-coding-comment,
|
||||||
|
odoo-addons-relative-import,
|
||||||
|
old-api7-method-defined,
|
||||||
|
redefined-builtin,
|
||||||
|
too-complex,
|
||||||
|
unnecessary-utf8-coding-comment
|
||||||
|
|
||||||
|
|
||||||
|
[REPORTS]
|
||||||
|
msg-template={path}:{line}: [{msg_id}({symbol}), {obj}] {msg}
|
||||||
|
output-format=colorized
|
||||||
|
reports=no
|
||||||
|
|
||||||
@@ -5,25 +5,29 @@ import os
|
|||||||
import signal
|
import signal
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
PID = 1
|
# once upon a time
|
||||||
PNAME = 'odoo'
|
# we tried to find 'odoo' and 'python'
|
||||||
PNAME_PYTHON = ['python']
|
# but sometimes, it would be something like "/usr/local/bin/...."
|
||||||
PNAME_KILL_OTHER = [PNAME] + PNAME_PYTHON
|
# so we now just try not to signal/kill 'node'
|
||||||
|
PID = 1
|
||||||
|
PNAME = 'node'
|
||||||
KILL_OTHER = sys.argv[1] == 'KILL_OTHER' if len(sys.argv) >= 2 else False
|
KILL_OTHER = sys.argv[1] == 'KILL_OTHER' if len(sys.argv) >= 2 else False
|
||||||
if KILL_OTHER:
|
if KILL_OTHER:
|
||||||
print('Will find other Odoo Processes and Kill them.')
|
print('Will find other Odoo Processes and Kill them.')
|
||||||
|
|
||||||
is_foreground = False
|
is_foreground = False
|
||||||
|
foreground_name = ''
|
||||||
for proc in psutil.process_iter():
|
for proc in psutil.process_iter():
|
||||||
try:
|
try:
|
||||||
process_name = proc.name()
|
process_name = proc.name()
|
||||||
process_id = proc.pid
|
process_id = proc.pid
|
||||||
print('Inspecting %s:%s' % (process_id, process_name))
|
print('Inspecting %s:%s' % (process_id, process_name))
|
||||||
if process_id == PID:
|
if process_id == PID:
|
||||||
is_foreground = process_name == PNAME
|
is_foreground = process_name != PNAME
|
||||||
|
foreground_name = process_name
|
||||||
if not KILL_OTHER:
|
if not KILL_OTHER:
|
||||||
break
|
break
|
||||||
if process_id != PID and KILL_OTHER and process_name in PNAME_KILL_OTHER:
|
if process_id != PID and KILL_OTHER and process_name != PNAME:
|
||||||
print('Killing %s:%s' % (process_id, process_name))
|
print('Killing %s:%s' % (process_id, process_name))
|
||||||
os.kill(process_id, signal.SIGKILL)
|
os.kill(process_id, signal.SIGKILL)
|
||||||
except (psutil.NoSuchProcess, psutil.AccessDenied, psutil.ZombieProcess):
|
except (psutil.NoSuchProcess, psutil.AccessDenied, psutil.ZombieProcess):
|
||||||
@@ -33,6 +37,6 @@ if not is_foreground:
|
|||||||
print('Odoo is not the foreground process.')
|
print('Odoo is not the foreground process.')
|
||||||
exit(-1)
|
exit(-1)
|
||||||
|
|
||||||
print('Signalling reload to Odoo')
|
print('Signalling reload to foreground process "%s"' % (foreground_name, ))
|
||||||
os.kill(PID, signal.SIGHUP)
|
os.kill(PID, signal.SIGHUP)
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user