mirror of
https://github.com/avatao-content/test-tutorial-framework
synced 2024-11-15 03:27:18 +00:00
Partially conform new TFW networking model
This commit is contained in:
parent
a1b4a87864
commit
48efb39ea5
@ -10,6 +10,7 @@ from tfw.components import IdeEventHandler, TerminalEventHandler
|
|||||||
from tfw.components import ProcessManagingEventHandler, BashMonitor
|
from tfw.components import ProcessManagingEventHandler, BashMonitor
|
||||||
from tfw.components import TerminalCommands, LogMonitoringEventHandler
|
from tfw.components import TerminalCommands, LogMonitoringEventHandler
|
||||||
from tfw.components import FSMManagingEventHandler, DirectorySnapshottingEventHandler
|
from tfw.components import FSMManagingEventHandler, DirectorySnapshottingEventHandler
|
||||||
|
from tfw.components import FrontendEventHandler
|
||||||
from tfw.networking import MessageSender, TFWServerConnector
|
from tfw.networking import MessageSender, TFWServerConnector
|
||||||
from tfw.config import TFWENV
|
from tfw.config import TFWENV
|
||||||
from tfw.config.logs import logging
|
from tfw.config.logs import logging
|
||||||
@ -44,7 +45,7 @@ class TestCommands(TerminalCommands):
|
|||||||
"""
|
"""
|
||||||
if not args:
|
if not args:
|
||||||
message_template = """'{"key": "", "data": {"command": ""}}'"""
|
message_template = """'{"key": "", "data": {"command": ""}}'"""
|
||||||
TFWServerConnector().send_to_eventhandler({
|
TFWServerConnector().send_message({
|
||||||
'key': 'shell',
|
'key': 'shell',
|
||||||
'data': {
|
'data': {
|
||||||
'command': 'write',
|
'command': 'write',
|
||||||
@ -52,7 +53,7 @@ class TestCommands(TerminalCommands):
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
else:
|
else:
|
||||||
TFWServerConnector().send(literal_eval(args[0]))
|
TFWServerConnector().send_message(literal_eval(args[0]))
|
||||||
|
|
||||||
def command_seppuku_tfw(self, *args):
|
def command_seppuku_tfw(self, *args):
|
||||||
"""
|
"""
|
||||||
@ -65,14 +66,14 @@ class TestCommands(TerminalCommands):
|
|||||||
'clear && echo "Committed seppuku! :)" && sleep infinity'
|
'clear && echo "Committed seppuku! :)" && sleep infinity'
|
||||||
)
|
)
|
||||||
uplink = TFWServerConnector()
|
uplink = TFWServerConnector()
|
||||||
uplink.send_to_eventhandler({
|
uplink.send_message({
|
||||||
'key': 'shell',
|
'key': 'shell',
|
||||||
'data': {
|
'data': {
|
||||||
'command': 'write',
|
'command': 'write',
|
||||||
'value': f'{seppuku}\n'
|
'value': f'{seppuku}\n'
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
uplink.send({
|
uplink.send_message({
|
||||||
'key': 'dashboard',
|
'key': 'dashboard',
|
||||||
'data': {
|
'data': {
|
||||||
'command': 'reloadFrontend'
|
'command': 'reloadFrontend'
|
||||||
@ -139,6 +140,7 @@ def main():
|
|||||||
TFWENV.WEBSERVICE_DIR
|
TFWENV.WEBSERVICE_DIR
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
|
frontend = FrontendEventHandler() # Proxies frontend API calls to frontend
|
||||||
|
|
||||||
# Your custom event handlers
|
# Your custom event handlers
|
||||||
message_fsm_steps_eh = MessageFSMStepsEventHandler(
|
message_fsm_steps_eh = MessageFSMStepsEventHandler(
|
||||||
|
Loading…
Reference in New Issue
Block a user