1
0
mirror of https://github.com/avatao-content/test-tutorial-framework synced 2025-07-07 07:06:23 +00:00

Use new event handling model

This commit is contained in:
Kristóf Tóth
2019-07-12 23:26:57 +02:00
parent eb60c1e08e
commit d9e69a6327
5 changed files with 59 additions and 93 deletions

View File

@ -6,14 +6,8 @@ from tornado.ioloop import IOLoop
from tfw.builtins import PipeIOEventHandler
from tfw.config import TFWENV
from tfw.logging import Log, Logger, LogFormatter, VerboseLogFormatter
from tfw.main import EventHandlerFactory, setup_signal_handlers
from pipe_io_auxlib import (
SignMessagePipeIOEventHandler, VerifyMessagePipeIOEventHandler,
BotPipeIOEventHandler,
DeployPipeIOEventHandler, IdePipeIOEventHandler,
FSMPipeIOEventHandler
)
from signal_handling import setup_signal_handlers
LOG = logging.getLogger(__name__)
@ -25,46 +19,14 @@ def main():
Log(TFWENV.LOGFILE, VerboseLogFormatter())
]).start()
eh_factory = EventHandlerFactory()
json_pipe = PipeIOEventHandler(
'',
'/tmp/tfw_json_send',
'/tmp/tfw_json_recv'
'/tmp/tfw_send',
'/tmp/tfw_recv'
)
json_pipe_eh = eh_factory.build(json_pipe)
sign_pipe = SignMessagePipeIOEventHandler(
'/tmp/tfw_sign_send',
'/tmp/tfw_sign_recv',
forwarding=True
)
verify_pipe = VerifyMessagePipeIOEventHandler(
'/tmp/tfw_verify_send',
'/tmp/tfw_verify_recv'
)
bot_pipe = BotPipeIOEventHandler(
'/tmp/tfw_bot_send',
'/tmp/tfw_bot_recv',
permissions=0o666
)
deploy_pipe = DeployPipeIOEventHandler(
'/tmp/tfw_deploy_send',
'/tmp/tfw_deploy_recv',
'webservice'
)
ide_pipe = IdePipeIOEventHandler(
'/tmp/tfw_ide_send',
'/tmp/tfw_ide_recv',
'user_ops.py',
selected=True
)
fsm_pipe = FSMPipeIOEventHandler(
'/tmp/tfw_fsm_send',
'/tmp/tfw_fsm_recv'
)
setup_signal_handlers()
IOLoop.instance().start()