aboutsummaryrefslogtreecommitdiffstats
path: root/snekweb.py
diff options
context:
space:
mode:
authorGravatar scragly <[email protected]>2019-03-25 09:41:47 +1000
committerGravatar GitHub <[email protected]>2019-03-25 09:41:47 +1000
commit5bdf06c2fc86f8d8ab1ead63c30e856d9fead0cd (patch)
treeb71e0889a4ea6ed8d22852b9805bd13a60994f00 /snekweb.py
parentMerge pull request #11 from python-discord/add-flake8-extensions (diff)
parentMore formatting fixes (diff)
Merge pull request #10 from python-discord/flake8-updates
Flake8 Docstrings Co-authored-by: S. Co1 <[email protected]>
Diffstat (limited to 'snekweb.py')
-rw-r--r--snekweb.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/snekweb.py b/snekweb.py
index 57d79e2..ff1a72c 100644
--- a/snekweb.py
+++ b/snekweb.py
@@ -3,8 +3,7 @@ import logging
import threading
import traceback
-from flask import Flask
-from flask import render_template
+from flask import Flask, render_template
from flask_sockets import Sockets
from rmq import Rmq
@@ -22,11 +21,15 @@ log = app.logger
@app.route('/')
def index():
+ """Root path returns standard index.html."""
+
return render_template('index.html')
@sockets.route('/ws/<snekboxid>')
def websocket_route(ws, snekboxid):
+ """Opens a websocket that spawns and connects to a snekbox daemon."""
+
localdata = threading.local()
localdata.thread_ws = ws