mirror of
				https://github.com/avatao-content/test-tutorial-framework
				synced 2025-11-04 02:52:55 +00:00 
			
		
		
		
	Comply TFW lib changes
This commit is contained in:
		@@ -4,7 +4,7 @@ import json
 | 
				
			|||||||
from tornado.ioloop import IOLoop
 | 
					from tornado.ioloop import IOLoop
 | 
				
			||||||
from tornado.web import RequestHandler, Application
 | 
					from tornado.web import RequestHandler, Application
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from tfw.event_handler_base import FSMAwareEventHandler
 | 
					from tfw.event_handlers import FSMAwareEventHandler
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
class ControllerPostHandler(RequestHandler):
 | 
					class ControllerPostHandler(RequestHandler):
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -5,13 +5,12 @@ from signal import signal, SIGTERM, SIGINT
 | 
				
			|||||||
from tornado.ioloop import IOLoop
 | 
					from tornado.ioloop import IOLoop
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from tfw.fsm import YamlFSM
 | 
					from tfw.fsm import YamlFSM
 | 
				
			||||||
from tfw.event_handler_base import EventHandlerBase, FSMAwareEventHandler
 | 
					from tfw.event_handlers import EventHandlerBase, FSMAwareEventHandler, TFWServerUplinkConnector
 | 
				
			||||||
from tfw.components import IdeEventHandler, TerminalEventHandler
 | 
					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.components import FrontendEventHandler, MessageSender
 | 
				
			||||||
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
 | 
				
			||||||
from tao.config import TAOENV
 | 
					from tao.config import TAOENV
 | 
				
			||||||
@@ -45,7 +44,7 @@ class TestCommands(TerminalCommands):
 | 
				
			|||||||
        """
 | 
					        """
 | 
				
			||||||
        if not args:
 | 
					        if not args:
 | 
				
			||||||
            message_template = """'{"key": "", "data": {"command": ""}}'"""
 | 
					            message_template = """'{"key": "", "data": {"command": ""}}'"""
 | 
				
			||||||
            TFWServerConnector().send_message({
 | 
					            TFWServerUplinkConnector().send_message({
 | 
				
			||||||
                'key': 'shell',
 | 
					                'key': 'shell',
 | 
				
			||||||
                'data': {
 | 
					                'data': {
 | 
				
			||||||
                    'command': 'write',
 | 
					                    'command': 'write',
 | 
				
			||||||
@@ -53,7 +52,7 @@ class TestCommands(TerminalCommands):
 | 
				
			|||||||
                }
 | 
					                }
 | 
				
			||||||
            })
 | 
					            })
 | 
				
			||||||
        else:
 | 
					        else:
 | 
				
			||||||
            TFWServerConnector().send_message(literal_eval(args[0]))
 | 
					            TFWServerUplinkConnector().send_message(literal_eval(args[0]))
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    def command_seppuku_tfw(self, *args):
 | 
					    def command_seppuku_tfw(self, *args):
 | 
				
			||||||
        """
 | 
					        """
 | 
				
			||||||
@@ -65,7 +64,7 @@ class TestCommands(TerminalCommands):
 | 
				
			|||||||
            'nohup sh -c "supervisorctl restart tfwserver event_handler_main" &> /dev/null & '
 | 
					            'nohup sh -c "supervisorctl restart tfwserver event_handler_main" &> /dev/null & '
 | 
				
			||||||
            'clear && echo "Committed seppuku! :)" && sleep infinity'
 | 
					            'clear && echo "Committed seppuku! :)" && sleep infinity'
 | 
				
			||||||
        )
 | 
					        )
 | 
				
			||||||
        uplink = TFWServerConnector()
 | 
					        uplink = TFWServerUplinkConnector()
 | 
				
			||||||
        uplink.send_message({
 | 
					        uplink.send_message({
 | 
				
			||||||
            'key': 'shell',
 | 
					            'key': 'shell',
 | 
				
			||||||
            'data': {
 | 
					            'data': {
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -2,7 +2,7 @@ from signal import signal, SIGTERM, SIGINT
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
from tornado.ioloop import IOLoop
 | 
					from tornado.ioloop import IOLoop
 | 
				
			||||||
 | 
					
 | 
				
			||||||
from tfw.event_handler_base import EventHandlerBase
 | 
					from tfw.event_handlers import EventHandlerBase
 | 
				
			||||||
from tfw.components import PipeIOEventHandler
 | 
					from tfw.components import PipeIOEventHandler
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user