2018-02-23 13:07:41 +00:00
|
|
|
from tfw.event_handler_base import TriggerlessEventHandler
|
2018-02-13 16:51:19 +00:00
|
|
|
from tfw.components.mixins import SupervisorMixin
|
2018-02-09 08:58:47 +00:00
|
|
|
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__)
|
2018-01-17 15:33:34 +00:00
|
|
|
|
|
|
|
|
2018-02-23 13:07:41 +00:00
|
|
|
class TerminadoEventHandler(TriggerlessEventHandler, SupervisorMixin):
|
2018-02-21 14:28:16 +00:00
|
|
|
def __init__(self, key, process_name):
|
|
|
|
super().__init__(key)
|
2018-02-09 08:58:47 +00:00
|
|
|
self.working_directory = tfwenv.TERMINADO_DIR
|
2018-01-24 14:10:59 +00:00
|
|
|
self.process_name = process_name
|
2018-02-27 14:54:31 +00:00
|
|
|
self.start_process(self.process_name)
|
2018-01-17 15:33:34 +00:00
|
|
|
|
2018-02-21 14:28:16 +00:00
|
|
|
def handle_event(self, key, data_json):
|
|
|
|
log.debug('TerminadoEventHandler received event for key {}'.format(key))
|
2018-01-24 15:36:32 +00:00
|
|
|
# TODO: wat do?
|