From d702cb4c1453981c80117a8bc68a8e46b08969ac Mon Sep 17 00:00:00 2001 From: Aaron LI Date: Wed, 2 Nov 2016 21:16:44 +0800 Subject: webui: Rewrite "websocket.py" with "FG21simWSHandler" NOTE: This "FG21simWSHandler" is still very preliminary, and there are a lot of necessary functions need to be implemented. --- fg21sim/webui/app.py | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'fg21sim/webui/app.py') diff --git a/fg21sim/webui/app.py b/fg21sim/webui/app.py index 63d80be..4fa0a05 100644 --- a/fg21sim/webui/app.py +++ b/fg21sim/webui/app.py @@ -2,16 +2,20 @@ # MIT license """ -Web user interface (UI) of "fg21sim" based upon Tornado_. +Web user interface (UI) of "fg21sim" based upon Tornado_ web server and +using the WebSocket_ protocol. .. _Tornado: http://www.tornadoweb.org/ + +.. _WebSocket: https://en.wikipedia.org/wiki/WebSocket , + http://caniuse.com/#feat=websockets """ import os import tornado.web -from .websocket import EchoWSHandler +from .websocket import FG21simWSHandler class IndexHandler(tornado.web.RequestHandler): @@ -20,7 +24,8 @@ class IndexHandler(tornado.web.RequestHandler): _settings = { - # The static files will be served from the default "/static/" URI + # The static files will be served from the default "/static/" URI. + # Recommend to use `{{ static_url(filepath) }}` in the templates. "static_path": os.path.join(os.path.dirname(__file__), "static"), "template_path": os.path.join(os.path.dirname(__file__), "templates"), } @@ -32,6 +37,6 @@ def make_application(**kwargs): appplication = tornado.web.Application( handlers=[ (r"/", IndexHandler), - (r"/ws", EchoWSHandler), + (r"/ws", FG21simWSHandler), ], **settings) return appplication -- cgit v1.2.2