1
0
mirror of https://github.com/avatao-content/test-tutorial-framework synced 2024-12-05 01:41:32 +00:00

Comply EventHandler changes

This commit is contained in:
Kristóf Tóth 2019-06-28 15:12:27 +02:00
parent 8335338a96
commit b392749643
7 changed files with 11 additions and 13 deletions

View File

@ -6,7 +6,7 @@ disable = missing-docstring, too-few-public-methods, invalid-name
[SIMILARITIES] [SIMILARITIES]
min-similarity-lines=6 min-similarity-lines=7
ignore-comments=yes ignore-comments=yes
ignore-docstrings=yes ignore-docstrings=yes
ignore-imports=yes ignore-imports=yes

View File

@ -4,7 +4,7 @@ import json
from tornado.ioloop import IOLoop from tornado.ioloop import IOLoop
from tornado.web import RequestHandler, Application from tornado.web import RequestHandler, Application
from tfw.event_handlers import FSMAwareEventHandler from tfw.builtins import FSMAwareEventHandler
class ControllerPostHandler(RequestHandler): class ControllerPostHandler(RequestHandler):

View File

@ -6,9 +6,8 @@ from signal import signal, SIGTERM, SIGINT
from tornado.ioloop import IOLoop from tornado.ioloop import IOLoop
from tfw.fsm import YamlFSM from tfw.fsm import YamlFSM
from tfw.event_handlers import EventHandlerBase, FSMAwareEventHandler, TFWServerUplinkConnector from tfw.builtins import EventHandler, FSMAwareEventHandler, TFWServerUplinkConnector
from tfw.builtins import FrontendEventHandler from tfw.builtins import IdeEventHandler, TerminalEventHandler, FrontendEventHandler
from tfw.builtins import IdeEventHandler, TerminalEventHandler
from tfw.builtins import LogMonitoringEventHandler, ProcessManagingEventHandler from tfw.builtins import LogMonitoringEventHandler, ProcessManagingEventHandler
from tfw.builtins import DirectorySnapshottingEventHandler, FSMManagingEventHandler, MessageSender from tfw.builtins import DirectorySnapshottingEventHandler, FSMManagingEventHandler, MessageSender
from tfw.components import TerminalCommands from tfw.components import TerminalCommands
@ -19,7 +18,7 @@ from tao.config import TAOENV
LOG = logging.getLogger(__name__) LOG = logging.getLogger(__name__)
class TerminalCallbackEventHandler(EventHandlerBase): class TerminalCallbackEventHandler(EventHandler):
""" """
Logs commands executed in terminal to messages and invokes an Logs commands executed in terminal to messages and invokes an
additional callback function to handle special commands. additional callback function to handle special commands.
@ -162,8 +161,8 @@ def main():
key='test' key='test'
) )
event_handlers = EventHandlerBase.get_local_instances() event_handlers = EventHandler.get_local_instances()
def stop(sig, frame): def stop(sig, frame): # pylint: disable=unused-argument
for eh in event_handlers: for eh in event_handlers:
eh.stop() eh.stop()
exit(0) exit(0)

View File

@ -14,7 +14,6 @@ class SignMessagePipeIOEventHandler(PipeIOEventHandlerBase):
When forwarding is true, it will send the signed message to the TFW When forwarding is true, it will send the signed message to the TFW
server before writing it into the output pipe. server before writing it into the output pipe.
""" """
def __init__( def __init__(
self, in_pipe_path, out_pipe_path, self, in_pipe_path, out_pipe_path,
permissions=DEFAULT_PERMISSIONS, permissions=DEFAULT_PERMISSIONS,

View File

@ -18,6 +18,8 @@ LOG = logging.getLogger(__name__)
if __name__ == '__main__': if __name__ == '__main__':
# pylint: disable=pointless-string-statement
TFWLog().start()
""" """
Creates general purpose pipes. Creates general purpose pipes.
The first parameter associates the receiving pipe with a key, which is 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() event_handlers = EventHandlerBase.get_local_instances()
def stop(sig, frame): def stop(sig, frame): # pylint: disable=unused-argument
for eh in event_handlers: for eh in event_handlers:
eh.stop() eh.stop()
exit(0) exit(0)

View File

@ -3,7 +3,7 @@
from os.path import exists from os.path import exists
from tfw.fsm import LinearFSM from tfw.fsm import LinearFSM
from tfw.networking import MessageSender from tfw.builtins import MessageSender
class TestFSM(LinearFSM): class TestFSM(LinearFSM):

View File

@ -1,5 +1,3 @@
from json import dumps
from pipe_io import PipeWriter from pipe_io import PipeWriter
from crypto import PasswordHasher from crypto import PasswordHasher
from model import User from model import User