mirror of
https://github.com/avatao-content/test-tutorial-framework
synced 2024-11-14 21:47:18 +00:00
commit
9c6cd15bb2
@ -3,7 +3,7 @@ from ast import literal_eval
|
|||||||
from tornado.ioloop import IOLoop
|
from tornado.ioloop import IOLoop
|
||||||
|
|
||||||
from tfw.components import IdeEventHandler, TerminalEventHandler, ProcessManagingEventHandler, BashMonitor
|
from tfw.components import IdeEventHandler, TerminalEventHandler, ProcessManagingEventHandler, BashMonitor
|
||||||
from tfw.components import TerminalCommands
|
from tfw.components import TerminalCommands, LogMonitoringEventHandler
|
||||||
from tfw.networking import MessageSender, TFWServerConnector
|
from tfw.networking import MessageSender, TFWServerConnector
|
||||||
from tfw.config import TFWENV
|
from tfw.config import TFWENV
|
||||||
from tfw.config.logs import logging
|
from tfw.config.logs import logging
|
||||||
@ -74,21 +74,26 @@ if __name__ == '__main__':
|
|||||||
directory=TFWENV.IDE_WD, exclude=['*.pyc'],
|
directory=TFWENV.IDE_WD, exclude=['*.pyc'],
|
||||||
additional_watched_directories=[TFWENV.WEBSERVICE_DIR]
|
additional_watched_directories=[TFWENV.WEBSERVICE_DIR]
|
||||||
)
|
)
|
||||||
terminal = TerminalEventHandler( # Web shell backend
|
terminal = TerminalEventHandler( # Web shell backend
|
||||||
key='shell',
|
key='shell',
|
||||||
monitor=BashMonitor(TFWENV.HISTFILE)
|
monitor=BashMonitor(TFWENV.HISTFILE)
|
||||||
)
|
)
|
||||||
processmanager = ProcessManagingEventHandler( # Handles 'deploy' button clicks
|
processmanager = ProcessManagingEventHandler( # Handles 'deploy' button clicks
|
||||||
key='processmanager',
|
key='processmanager',
|
||||||
dirmonitor=ide.monitor
|
dirmonitor=ide.monitor,
|
||||||
|
log_tail=2000
|
||||||
)
|
)
|
||||||
|
logmonitor = LogMonitoringEventHandler( # Sends live logs of webservice process to frontend
|
||||||
|
'webservice',
|
||||||
|
log_tail=2000
|
||||||
|
)
|
||||||
|
eventhandlers = {ide, terminal, processmanager, logmonitor}
|
||||||
|
|
||||||
terminal.historymonitor.subscribe_callback(cenator)
|
terminal.historymonitor.subscribe_callback(cenator)
|
||||||
|
|
||||||
commands = TestCommands(bashrc=f'/home/{TAOENV.USER}/.bashrc')
|
commands = TestCommands(bashrc=f'/home/{TAOENV.USER}/.bashrc')
|
||||||
terminal.historymonitor.subscribe_callback(commands.callback)
|
terminal.historymonitor.subscribe_callback(commands.callback)
|
||||||
|
|
||||||
eventhandlers = {ide, terminal, processmanager}
|
|
||||||
try:
|
try:
|
||||||
IOLoop.instance().start()
|
IOLoop.instance().start()
|
||||||
finally:
|
finally:
|
||||||
|
@ -4,3 +4,6 @@ directory=%(ENV_TFW_WEBSERVICE_DIR)s
|
|||||||
environment=BASEURL="/webservice"
|
environment=BASEURL="/webservice"
|
||||||
command=python3 server.py
|
command=python3 server.py
|
||||||
autostart=true
|
autostart=true
|
||||||
|
startretries=0
|
||||||
|
stdout_logfile=/tmp/webservice_logs
|
||||||
|
stderr_logfile=/tmp/webservice_logs
|
||||||
|
Loading…
Reference in New Issue
Block a user