Create event handler to wrap TerminalCommands

This commit is contained in:
R. Richard 2019-07-08 14:06:44 +02:00 committed by therealkrispet
parent 98271a3783
commit 9be21d88ac
2 changed files with 15 additions and 0 deletions

View File

@ -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

View 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)