diff --git a/.pylintrc b/.pylintrc index 1cbae5d..961a526 100644 --- a/.pylintrc +++ b/.pylintrc @@ -6,7 +6,7 @@ disable = missing-docstring, too-few-public-methods, invalid-name [SIMILARITIES] -min-similarity-lines=6 +min-similarity-lines=7 ignore-comments=yes ignore-docstrings=yes ignore-imports=yes diff --git a/controller/opt/server.py b/controller/opt/server.py index 9e211c5..c34f0a2 100644 --- a/controller/opt/server.py +++ b/controller/opt/server.py @@ -4,7 +4,7 @@ import json from tornado.ioloop import IOLoop from tornado.web import RequestHandler, Application -from tfw.event_handlers import FSMAwareEventHandler +from tfw.builtins import FSMAwareEventHandler class ControllerPostHandler(RequestHandler): diff --git a/solvable/src/event_handler_main.py b/solvable/src/event_handler_main.py index 724e940..1d05af4 100644 --- a/solvable/src/event_handler_main.py +++ b/solvable/src/event_handler_main.py @@ -6,9 +6,8 @@ from signal import signal, SIGTERM, SIGINT from tornado.ioloop import IOLoop from tfw.fsm import YamlFSM -from tfw.event_handlers import EventHandlerBase, FSMAwareEventHandler, TFWServerUplinkConnector -from tfw.builtins import FrontendEventHandler -from tfw.builtins import IdeEventHandler, TerminalEventHandler +from tfw.builtins import EventHandler, FSMAwareEventHandler, TFWServerUplinkConnector +from tfw.builtins import IdeEventHandler, TerminalEventHandler, FrontendEventHandler from tfw.builtins import LogMonitoringEventHandler, ProcessManagingEventHandler from tfw.builtins import DirectorySnapshottingEventHandler, FSMManagingEventHandler, MessageSender from tfw.components import TerminalCommands @@ -19,7 +18,7 @@ from tao.config import TAOENV LOG = logging.getLogger(__name__) -class TerminalCallbackEventHandler(EventHandlerBase): +class TerminalCallbackEventHandler(EventHandler): """ Logs commands executed in terminal to messages and invokes an additional callback function to handle special commands. @@ -162,8 +161,8 @@ def main(): key='test' ) - event_handlers = EventHandlerBase.get_local_instances() - def stop(sig, frame): + event_handlers = EventHandler.get_local_instances() + def stop(sig, frame): # pylint: disable=unused-argument for eh in event_handlers: eh.stop() exit(0) diff --git a/solvable/src/pipe_io_auxlib.py b/solvable/src/pipe_io_auxlib.py index d866fe0..933a594 100644 --- a/solvable/src/pipe_io_auxlib.py +++ b/solvable/src/pipe_io_auxlib.py @@ -14,7 +14,6 @@ class SignMessagePipeIOEventHandler(PipeIOEventHandlerBase): When forwarding is true, it will send the signed message to the TFW server before writing it into the output pipe. """ - def __init__( self, in_pipe_path, out_pipe_path, permissions=DEFAULT_PERMISSIONS, diff --git a/solvable/src/pipe_io_main.py b/solvable/src/pipe_io_main.py index 42bbe8d..d737668 100644 --- a/solvable/src/pipe_io_main.py +++ b/solvable/src/pipe_io_main.py @@ -18,6 +18,8 @@ LOG = logging.getLogger(__name__) if __name__ == '__main__': + # pylint: disable=pointless-string-statement + TFWLog().start() """ Creates general purpose pipes. The first parameter associates the receiving pipe with a key, which is @@ -71,7 +73,7 @@ if __name__ == '__main__': ) event_handlers = EventHandlerBase.get_local_instances() - def stop(sig, frame): + def stop(sig, frame): # pylint: disable=unused-argument for eh in event_handlers: eh.stop() exit(0) diff --git a/solvable/src/test_fsm.py b/solvable/src/test_fsm.py index 2db9b97..9170e90 100644 --- a/solvable/src/test_fsm.py +++ b/solvable/src/test_fsm.py @@ -3,7 +3,7 @@ from os.path import exists from tfw.fsm import LinearFSM -from tfw.networking import MessageSender +from tfw.builtins import MessageSender class TestFSM(LinearFSM): diff --git a/solvable/src/webservice/user_ops.py b/solvable/src/webservice/user_ops.py index 3517acb..66855e8 100644 --- a/solvable/src/webservice/user_ops.py +++ b/solvable/src/webservice/user_ops.py @@ -1,5 +1,3 @@ -from json import dumps - from pipe_io import PipeWriter from crypto import PasswordHasher from model import User