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

18 lines
630 B
Python
Raw Normal View History

2018-01-31 14:50:52 +00:00
from tfw.event_handler_base import EventHandlerBase
2018-02-13 16:51:19 +00:00
from tfw.components.mixins import SupervisorMixin
from tfw.config import tfwenv
2018-01-31 14:50:52 +00:00
from tfw.config.logs import logging
2018-01-29 17:36:29 +00:00
log = logging.getLogger(__name__)
class TerminadoEventHandler(EventHandlerBase, SupervisorMixin):
def __init__(self, anchor, process_name):
super().__init__(anchor)
self.working_directory = tfwenv.TERMINADO_DIR
self.process_name = process_name
self.start_process()
def handle_event(self, anchor, data_json):
2018-01-29 17:36:29 +00:00
log.debug('TerminadoEventHandler received event for anchor {}'.format(anchor))
# TODO: wat do?