Getty Ritter 4 years ago
parent
commit
d51bc1837a
1 changed files with 6 additions and 2 deletions
  1. 6 2
      parley.py

+ 6 - 2
parley.py

@@ -1,4 +1,4 @@
-import sanic # type: ignore
+import sanic  # type: ignore
 
 import messages
 import storage
@@ -8,19 +8,23 @@ app = sanic.Sanic()
 cache = storage.Cache()
 db = storage.Storage()
 
+
 @app.route("/static/<f>")
 async def static(request: sanic.request.Request, f: str) -> sanic.response.Response:
     return await sanic.response.file('static/{}'.format(f))
 
+
 @app.route("/")
 async def index(request: sanic.request.Request) -> sanic.response.Response:
     return await sanic.response.file('static/index.html')
 
+
 @app.websocket("/socket")
 async def socket(request: sanic.request.Request, ws: sanic.websocket.WebSocketConnection) -> sanic.response.Response:
     initial = await ws.recv()
     config: messages.InitialConfig = messages.Message.decode(initial)
-    sanic.log.logger.info(f'connected websocket for {config.user} in game {config.game}')
+    sanic.log.logger.info(
+        f'connected websocket for {config.user} in game {config.game}')
     cache.add_connection(config.game, ws)
 
     try: