Last few pep issues.
This commit is contained in:
parent
612478b777
commit
023cafad90
7 changed files with 29 additions and 26 deletions
|
@ -9,6 +9,7 @@ from helpers.logging_manager import LoggingManager
|
||||||
from helpers.state_manager import StateManager
|
from helpers.state_manager import StateManager
|
||||||
from controllers.controller import Controller
|
from controllers.controller import Controller
|
||||||
|
|
||||||
|
|
||||||
class MattchBox(Controller):
|
class MattchBox(Controller):
|
||||||
ser: Optional[serial.Serial]
|
ser: Optional[serial.Serial]
|
||||||
port: Optional[str]
|
port: Optional[str]
|
||||||
|
|
|
@ -42,6 +42,7 @@ from plan import PlanItem
|
||||||
# TODO ENUM
|
# TODO ENUM
|
||||||
VALID_MESSAGE_SOURCES = ["WEBSOCKET", "UI", "CONTROLLER", "TEST", "ALL"]
|
VALID_MESSAGE_SOURCES = ["WEBSOCKET", "UI", "CONTROLLER", "TEST", "ALL"]
|
||||||
|
|
||||||
|
|
||||||
class Player:
|
class Player:
|
||||||
out_q: multiprocessing.Queue
|
out_q: multiprocessing.Queue
|
||||||
last_msg: str
|
last_msg: str
|
||||||
|
|
|
@ -5,6 +5,7 @@ from os import _exit
|
||||||
|
|
||||||
from helpers.logging_manager import LoggingManager
|
from helpers.logging_manager import LoggingManager
|
||||||
|
|
||||||
|
|
||||||
class PlayerHandler:
|
class PlayerHandler:
|
||||||
logger: LoggingManager
|
logger: LoggingManager
|
||||||
|
|
||||||
|
|
|
@ -11,6 +11,7 @@ from os import _exit
|
||||||
from helpers.logging_manager import LoggingManager
|
from helpers.logging_manager import LoggingManager
|
||||||
from websockets.server import Serve
|
from websockets.server import Serve
|
||||||
|
|
||||||
|
|
||||||
class WebsocketServer:
|
class WebsocketServer:
|
||||||
|
|
||||||
threads = Future
|
threads = Future
|
||||||
|
@ -52,7 +53,7 @@ class WebsocketServer:
|
||||||
print("Deleting websocket server")
|
print("Deleting websocket server")
|
||||||
self.quit()
|
self.quit()
|
||||||
|
|
||||||
async def websocket_handler(self, websocket, _):
|
async def websocket_handler(self, websocket, path):
|
||||||
self.baps_clients.add(websocket)
|
self.baps_clients.add(websocket)
|
||||||
await websocket.send(
|
await websocket.send(
|
||||||
json.dumps({"message": "Hello", "serverName": self.server_name})
|
json.dumps({"message": "Hello", "serverName": self.server_name})
|
||||||
|
@ -84,7 +85,6 @@ class WebsocketServer:
|
||||||
self.logger.log.error(
|
self.logger.log.error(
|
||||||
"Client Disconncted {}, {}".format(websocket, e))
|
"Client Disconncted {}, {}".format(websocket, e))
|
||||||
|
|
||||||
# TODO: Proper Logging
|
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
self.logger.log.exception(
|
self.logger.log.exception(
|
||||||
"Exception handling messages from Websocket.\n{}".format(e)
|
"Exception handling messages from Websocket.\n{}".format(e)
|
||||||
|
|
Loading…
Reference in a new issue