From d9fa35767289e76352b7fac2c2645cb1deef93dd Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Krist=C3=B3f=20T=C3=B3th?= Date: Fri, 30 Aug 2019 14:46:15 +0200 Subject: [PATCH] Remove now duplicate EventHandler type specifications --- solvable/src/event_handler_main.py | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/solvable/src/event_handler_main.py b/solvable/src/event_handler_main.py index fddd5f3..c06def8 100644 --- a/solvable/src/event_handler_main.py +++ b/solvable/src/event_handler_main.py @@ -4,7 +4,7 @@ from functools import partial from tornado.ioloop import IOLoop from tfw.fsm import YamlFSM -from tfw.event_handlers import FSMAwareEventHandler, ControlEventHandler +from tfw.event_handlers import FSMAwareEventHandler from tfw.components.ide import IdeHandler, DeployHandler from tfw.components.terminal import TerminalHandler from tfw.components.frontend import FrontendProxyHandler, FrontendReadyHandler, ConsoleLogsHandler, MessageQueueHandler @@ -32,11 +32,11 @@ def main(): 'test_fsm.yml', {} # jinja2 variables, empty dict enables jinja2 without any variables ) - ), event_handler_type=ControlEventHandler) + )) # Web IDE backend ide_eh = eh_factory.build(IdeHandler( patterns=['/home/user/workdir/*', '/srv/webservice/user_ops.py'] - ), event_handler_type=ControlEventHandler) + )) deploy_eh = eh_factory.build(DeployHandler()) # Web shell backend terminal_eh = eh_factory.build(TerminalHandler( @@ -44,23 +44,25 @@ def main(): user=TAOENV.USER, working_directory=TFWENV.TERMINADO_WD, histfile=TFWENV.HISTFILE - ), event_handler_type=ControlEventHandler) + )) # Handles 'deploy' button clicks - processmanager_eh = eh_factory.build(ProcessHandler( + process_eh = eh_factory.build(ProcessHandler( supervisor_uri=TFWENV.SUPERVISOR_HTTP_URI - ), event_handler_type=ControlEventHandler) + )) # Sends live logs of webservice process to frontend - logmonitor_eh = eh_factory.build(ProcessLogHandler( + processlog_eh = eh_factory.build(ProcessLogHandler( process_name='webservice', supervisor_uri=TFWENV.SUPERVISOR_HTTP_URI, log_tail=2000 - ), event_handler_type=ControlEventHandler) + )) # Proxies frontend API calls to frontend - frontend_eh = eh_factory.build(FrontendProxyHandler(), event_handler_type=ControlEventHandler) + frontendproxy_eh = eh_factory.build(FrontendProxyHandler()) + # Initiates first FSM step ready = FrontendReadyHandler('step_1') ready_eh = eh_factory.build(ready) ready.stop = ready_eh.stop - message_queue_eh = eh_factory.build(MessageQueueHandler(25), event_handler_type=ControlEventHandler) + # Manages message queues + messagequeue_eh = eh_factory.build(MessageQueueHandler(25)) # Writes live logs to console on frontend console_logs_eh = eh_factory.build(ConsoleLogsHandler(stream='stdout'))