baseimage-tutorial-framework/lib/tfw/builtins/terminal_commands_event_handler.py
2019-07-08 14:13:58 +02:00

15 lines
447 B
Python

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)