1
0
mirror of https://github.com/avatao-content/test-tutorial-framework synced 2025-06-28 07:05:13 +00:00

Use new event handling model

This commit is contained in:
Kristóf Tóth
2019-07-12 23:26:57 +02:00
parent eb60c1e08e
commit d9e69a6327
5 changed files with 59 additions and 93 deletions

View File

@ -5,11 +5,12 @@ from tornado.ioloop import IOLoop
from tornado.web import RequestHandler, Application
from tfw.builtins import FSMAwareEventHandler
from tfw.main import EventHandlerFactory
class ControllerPostHandler(RequestHandler):
# pylint: disable=abstract-method
def initialize(self, **kwargs): # pylint: disable=arguments-differ
# pylint: disable=abstract-method,attribute-defined-outside-init,unused-argument
def initialize(self, **kwargs):
self.controller = kwargs['controller']
def post(self, *args, **kwargs):
@ -26,6 +27,8 @@ class ControllerEventHandler(FSMAwareEventHandler):
if __name__ == '__main__':
controller = ControllerEventHandler('controller')
controller_eh = EventHandlerFactory().build(controller)
application = Application([(
f'/{os.environ["SECRET"]}',
ControllerPostHandler,