baseimage-tutorial-framework/lib/tfw/components/terminado_event_handler.py

18 lines
629 B
Python

from tfw.event_handler_base import TriggerlessEventHandler
from tfw.components.mixins import SupervisorMixin
from tfw.config import tfwenv
from tfw.config.logs import logging
log = logging.getLogger(__name__)
class TerminadoEventHandler(TriggerlessEventHandler, SupervisorMixin):
def __init__(self, key, process_name):
super().__init__(key)
self.working_directory = tfwenv.TERMINADO_DIR
self.process_name = process_name
self.start_process()
def handle_event(self, key, data_json):
log.debug('TerminadoEventHandler received event for key {}'.format(key))
# TODO: wat do?