aboutsummaryrefslogtreecommitdiffstats
path: root/fg21sim/webui/app.py
diff options
context:
space:
mode:
authorAaron LI <aaronly.me@outlook.com>2016-11-02 21:16:44 +0800
committerAaron LI <aaronly.me@outlook.com>2016-11-02 21:16:44 +0800
commitd702cb4c1453981c80117a8bc68a8e46b08969ac (patch)
tree3cb2e8b9be2c9f914dbf9cd360dd39397ea2d188 /fg21sim/webui/app.py
parent3cbceb83f5368af19b6c15b6890543459d011f75 (diff)
downloadfg21sim-d702cb4c1453981c80117a8bc68a8e46b08969ac.tar.bz2
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.
Diffstat (limited to 'fg21sim/webui/app.py')
-rw-r--r--fg21sim/webui/app.py13
1 files changed, 9 insertions, 4 deletions
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