Last few pep issues.

This commit is contained in:
Matthew Stratford 2021-04-08 22:32:16 +01:00
parent 612478b777
commit 023cafad90
7 changed files with 29 additions and 26 deletions

View file

@ -9,6 +9,7 @@ from helpers.logging_manager import LoggingManager
from helpers.state_manager import StateManager
from controllers.controller import Controller
class MattchBox(Controller):
ser: Optional[serial.Serial]
port: Optional[str]

View file

@ -42,6 +42,7 @@ from plan import PlanItem
# TODO ENUM
VALID_MESSAGE_SOURCES = ["WEBSOCKET", "UI", "CONTROLLER", "TEST", "ALL"]
class Player:
out_q: multiprocessing.Queue
last_msg: str

View file

@ -5,6 +5,7 @@ from os import _exit
from helpers.logging_manager import LoggingManager
class PlayerHandler:
logger: LoggingManager

View file

@ -11,6 +11,7 @@ from os import _exit
from helpers.logging_manager import LoggingManager
from websockets.server import Serve
class WebsocketServer:
threads = Future
@ -52,7 +53,7 @@ class WebsocketServer:
print("Deleting websocket server")
self.quit()
async def websocket_handler(self, websocket, _):
async def websocket_handler(self, websocket, path):
self.baps_clients.add(websocket)
await websocket.send(
json.dumps({"message": "Hello", "serverName": self.server_name})
@ -84,7 +85,6 @@ class WebsocketServer:
self.logger.log.error(
"Client Disconncted {}, {}".format(websocket, e))
# TODO: Proper Logging
except Exception as e:
self.logger.log.exception(
"Exception handling messages from Websocket.\n{}".format(e)