baseimage-tutorial-framework/lib/tfw/builtins/terminal_commands_event_handler.py

15 lines
447 B
Python
Raw Normal View History

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)