mirror of
https://github.com/avatao-content/test-tutorial-framework
synced 2025-07-13 23:46:23 +00:00
Configure frontend on 'frontend.ready' event
This commit is contained in:
@ -1,4 +1,5 @@
|
||||
import logging
|
||||
from os.path import dirname, realpath, join
|
||||
from functools import partial
|
||||
|
||||
from tornado.ioloop import IOLoop
|
||||
@ -7,7 +8,8 @@ from tfw.fsm import YamlFSM
|
||||
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
|
||||
from tfw.components.frontend import FrontendProxyHandler, FrontendReadyHandler
|
||||
from tfw.components.frontend import ConsoleLogsHandler, MessageQueueHandler, FrontendConfigHandler
|
||||
from tfw.components.process_management import ProcessHandler, ProcessLogHandler
|
||||
from tfw.components.fsm import FSMHandler
|
||||
from tfw.main import EventHandlerFactory, setup_logger, setup_signal_handlers
|
||||
@ -16,11 +18,12 @@ from tfw.config import TFWENV, TAOENV
|
||||
from custom_handlers import CenatorHandler, TestCommandsHandler, messageFSMStepsHandler
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
here = dirname(realpath(__file__))
|
||||
|
||||
|
||||
|
||||
def main():
|
||||
# pylint: disable=unused-variable
|
||||
# pylint: disable=unused-variable,too-many-locals
|
||||
setup_logger(__file__)
|
||||
|
||||
eh_factory = EventHandlerFactory()
|
||||
@ -58,9 +61,13 @@ def main():
|
||||
# Proxies frontend API calls to frontend
|
||||
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
|
||||
frontendready = FrontendReadyHandler('step_1')
|
||||
frontendready_eh = eh_factory.build(frontendready)
|
||||
frontendready.stop = frontendready_eh.stop
|
||||
# Configures frontend
|
||||
frontendconfig_eh = eh_factory.build(
|
||||
FrontendConfigHandler(join(here, 'frontend_config.yaml'))
|
||||
)
|
||||
# Manages message queues
|
||||
messagequeue_eh = eh_factory.build(MessageQueueHandler(25))
|
||||
# Writes live logs to console on frontend
|
||||
|
Reference in New Issue
Block a user