1
0
mirror of https://github.com/avatao-content/test-tutorial-framework synced 2024-12-05 02:31:33 +00:00

Instantiate FrontendReadyHandler

This commit is contained in:
R. Richard 2019-08-27 13:08:41 +02:00
parent 106b932c6b
commit 21cfaebe8a

View File

@ -7,7 +7,7 @@ from tfw.fsm import YamlFSM
from tfw.event_handlers import FSMAwareEventHandler, ControlEventHandler
from tfw.components.ide import IdeHandler, DeployHandler
from tfw.components.terminal import TerminalHandler
from tfw.components.frontend import FrontendProxyHandler, ConsoleLogsHandler, MessageQueueHandler
from tfw.components.frontend import FrontendProxyHandler, FrontendReadyHandler, ConsoleLogsHandler, MessageQueueHandler
from tfw.components.process_management import ProcessHandler, ProcessLogHandler
from tfw.components.fsm import FSMHandler
from tfw.main import EventHandlerFactory, setup_logger, setup_signal_handlers
@ -18,6 +18,7 @@ from custom_handlers import CenatorHandler, TestCommandsHandler, messageFSMSteps
LOG = logging.getLogger(__name__)
def main():
# pylint: disable=unused-variable
setup_logger(__file__)
@ -30,8 +31,7 @@ def main():
YamlFSM,
'test_fsm.yml',
{} # jinja2 variables, empty dict enables jinja2 without any variables
),
initial_trigger='step_1'
)
), event_handler_type=ControlEventHandler)
# Web IDE backend
ide_eh = eh_factory.build(IdeHandler(
@ -57,6 +57,9 @@ def main():
), event_handler_type=ControlEventHandler)
# Proxies frontend API calls to frontend
frontend_eh = eh_factory.build(FrontendProxyHandler(), event_handler_type=ControlEventHandler)
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)
# Writes live logs to console on frontend
console_logs_eh = eh_factory.build(ConsoleLogsHandler(stream='stdout'))