mirror of
https://github.com/avatao-content/baseimage-tutorial-framework
synced 2024-11-22 20:31:31 +00:00
Reintroduce glorious JOHN CENA to demo ¯\_(ツ)_/¯
This commit is contained in:
parent
3e0592c176
commit
306607c972
@ -4,14 +4,21 @@ from tfw.components.source_code_event_handler import SourceCodeEventHandler
|
|||||||
from tfw.components.terminado_event_handler import TerminadoEventHandler
|
from tfw.components.terminado_event_handler import TerminadoEventHandler
|
||||||
from tfw.components.process_managing_event_handler import ProcessManagingEventHandler
|
from tfw.components.process_managing_event_handler import ProcessManagingEventHandler
|
||||||
from tfw.config import tfwenv
|
from tfw.config import tfwenv
|
||||||
|
from tfw.message_sender import MessageSender
|
||||||
from tfw.config.logs import logging
|
from tfw.config.logs import logging
|
||||||
log = logging.getLogger(__name__)
|
log = logging.getLogger(__name__)
|
||||||
|
|
||||||
|
|
||||||
|
def cenator(history):
|
||||||
|
message_sender = MessageSender()
|
||||||
|
log.debug('User executed command: "{}"'.format(history[-1]))
|
||||||
|
message_sender.send('JOHN CENA', 'You\'ve executed "{}"'.format(history[-1]))
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
ide = SourceCodeEventHandler(key='webide', directory=tfwenv.WEBIDE_WD, exclude=['__pycache__'])
|
ide = SourceCodeEventHandler(key='webide', directory=tfwenv.WEBIDE_WD, exclude=['__pycache__'])
|
||||||
terminado = TerminadoEventHandler(key='shell')
|
terminado = TerminadoEventHandler(key='shell')
|
||||||
terminado.historymonitor.subscribe_callback(callback=lambda hist: log.debug('User executed command: "{}"'.format(hist[-1])))
|
terminado.historymonitor.subscribe_callback(cenator)
|
||||||
processmanager = ProcessManagingEventHandler(key='processmanager', dirmonitor=ide.monitor)
|
processmanager = ProcessManagingEventHandler(key='processmanager', dirmonitor=ide.monitor)
|
||||||
|
|
||||||
eventhandlers = {ide, terminado, processmanager}
|
eventhandlers = {ide, terminado, processmanager}
|
||||||
|
Loading…
Reference in New Issue
Block a user