mirror of
https://github.com/avatao-content/baseimage-tutorial-framework
synced 2024-11-22 14:21:33 +00:00
Create event handler to wrap TerminalCommands
This commit is contained in:
parent
98271a3783
commit
9be21d88ac
@ -8,5 +8,6 @@ from .log_monitoring_event_handler import LogMonitoringEventHandler
|
||||
from .pipe_io_event_handler import PipeIOEventHandlerBase, PipeIOEventHandler
|
||||
from .pipe_io_event_handler import TransformerPipeIOEventHandler, CommandEventHandler
|
||||
from .process_managing_event_handler import ProcessManagingEventHandler
|
||||
from .terminal_commands_event_handler import TerminalCommandsEventHandler
|
||||
from .terminal_event_handler import TerminalEventHandler
|
||||
from .tfw_server_connector import TFWServerUplinkConnector, TFWServerConnector
|
||||
|
14
lib/tfw/builtins/terminal_commands_event_handler.py
Normal file
14
lib/tfw/builtins/terminal_commands_event_handler.py
Normal file
@ -0,0 +1,14 @@
|
||||
from tfw.components import TerminalCommands
|
||||
from tfw.networking import Scope
|
||||
|
||||
from .event_handler import EventHandler
|
||||
|
||||
|
||||
class TerminalCommandsEventHandler(EventHandler, TerminalCommands):
|
||||
def __init__(self, key, scope=Scope.ZMQ, bashrc=None):
|
||||
EventHandler.__init__(self, key, scope)
|
||||
TerminalCommands.__init__(self, bashrc)
|
||||
|
||||
def handle_event(self, message):
|
||||
command = message['value']
|
||||
self.callback(command)
|
Loading…
Reference in New Issue
Block a user