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

Make python and yaml FSMs eqvivalent so it's a nice example

This commit is contained in:
Kristóf Tóth
2018-07-10 17:32:43 +02:00
parent 6b1fa664c4
commit 98f297cff2
3 changed files with 65 additions and 13 deletions

View File

@ -3,6 +3,7 @@ from functools import partial
from tornado.ioloop import IOLoop
from tfw import YamlFSM
from tfw.components import IdeEventHandler, TerminalEventHandler
from tfw.components import ProcessManagingEventHandler, BashMonitor
from tfw.components import TerminalCommands, LogMonitoringEventHandler
@ -80,10 +81,9 @@ class TestCommands(TerminalCommands):
if __name__ == '__main__':
FiveStepTestFSM = partial(TestFSM, 5)
fsm = FSMManagingEventHandler( # TFW FSM
key='fsm',
fsm_type=FiveStepTestFSM
fsm_type=partial(YamlFSM, 'test_fsm.yml')
)
ide = IdeEventHandler( # Web IDE backend
key='ide',
@ -105,7 +105,7 @@ if __name__ == '__main__':
process_name='webservice',
log_tail=2000
)
eventhandlers = {ide, terminal, processmanager, logmonitor, fsm}
eventhandlers = {fsm, ide, terminal, processmanager, logmonitor}
commands = TestCommands(bashrc=f'/home/{TAOENV.USER}/.bashrc')
terminal.historymonitor.subscribe_callback(commands.callback)