1
0
mirror of https://github.com/avatao-content/test-tutorial-framework synced 2024-11-15 01:47:16 +00:00
test-tutorial-framework/solvable/src/tfw_server.py
Bokros Bálint 31a385fced Merge pull request #2 from avatao-content/linearfsm
Add LinearFSM example to test project
2018-04-10 17:37:12 +02:00

26 lines
753 B
Python

import sys
from functools import partial
import zmq
import tornado
from tornado.ioloop import IOLoop
from test_fsm import TestFSM
from tfw.networking import TFWServer
from tfw.config import TFWENV
from tfw.config.logs import logging
LOG = logging.getLogger(__name__)
if __name__ == '__main__':
# pylint: disable=invalid-name
FiveStepTestFSM = partial(TestFSM, 5)
TFWServer(FiveStepTestFSM).listen(TFWENV.WEB_PORT)
LOG.debug('Python version: %s', sys.version[:5])
LOG.debug('Tornado version: %s', tornado.version)
LOG.debug('ZeroMQ version: %s', zmq.zmq_version())
LOG.debug('PyZMQ version: %s', zmq.pyzmq_version())
LOG.info('Tornado application listening on port %s', TFWENV.WEB_PORT)
IOLoop.instance().start()