From 52248bea1fa6a5834a3926b2d84208661859c01e Mon Sep 17 00:00:00 2001 From: Matthew Stratford Date: Fri, 11 Mar 2022 23:55:53 +0000 Subject: [PATCH] Flake 8 lint --- file_manager.py | 5 +---- helpers/logging_manager.py | 2 +- launch.py | 2 +- player.py | 4 ++-- player_handler.py | 2 +- web_server.py | 2 +- websocket_server.py | 1 - 7 files changed, 7 insertions(+), 11 deletions(-) diff --git a/file_manager.py b/file_manager.py index f635418..d8368a4 100644 --- a/file_manager.py +++ b/file_manager.py @@ -1,6 +1,5 @@ from helpers.state_manager import StateManager from helpers.os_environment import isWindows, resolve_external_file_path -from typing import List from setproctitle import setproctitle from multiprocessing import current_process, Queue from time import sleep @@ -72,7 +71,7 @@ class FileManager: command = split[2] # rest of message = split[3] - self.logger.log.debug("Got command {} for channel {}".format(command,channel)) + self.logger.log.debug("Got command {} for channel {}".format(command, channel)) # If we have requested a new show plan, empty the music-tmp directory for the previous show. if command == "GETPLAN": @@ -158,8 +157,6 @@ class FileManager: ) ) - - except Exception as e: self.logger.log.exception( "Received unexpected exception: {}".format(e)) diff --git a/helpers/logging_manager.py b/helpers/logging_manager.py index 16184d5..91de833 100644 --- a/helpers/logging_manager.py +++ b/helpers/logging_manager.py @@ -37,7 +37,7 @@ class LoggingManager: return # Enable debug by default - if (debug == None and package.BETA): + if (debug is None and package.BETA): debug = True self.logger.setLevel(logging.DEBUG if debug else logging.INFO) diff --git a/launch.py b/launch.py index aaeae03..61ce58e 100755 --- a/launch.py +++ b/launch.py @@ -35,7 +35,7 @@ def startServer(notifications=False): if server and server.is_alive(): server.terminate() - server.join(timeout=20) # If we somehow get stuck stopping BAPSicle let it die. + server.join(timeout=20) # If we somehow get stuck stopping BAPSicle let it die. # Catch the handler being killed externally. except Exception as e: diff --git a/player.py b/player.py index a708c04..e85682d 100644 --- a/player.py +++ b/player.py @@ -931,7 +931,7 @@ class Player: def _retAll(self, msg): if self.out_q: - self.out_q.put("{}:ALL:{}".format(self.state.get()["channel"],msg)) + self.out_q.put("{}:ALL:{}".format(self.state.get()["channel"], msg)) def _retMsg( self, msg: Any, okay_str: bool = False, custom_prefix: Optional[str] = None @@ -1108,7 +1108,7 @@ class Player: # We got a message. - ## Check if we're successfully loaded + # Check if we're successfully loaded # This is here so that we can check often, but not every single loop # Only when user gives input. self._checkIsLoaded() diff --git a/player_handler.py b/player_handler.py index ea7026e..46658cb 100644 --- a/player_handler.py +++ b/player_handler.py @@ -27,7 +27,7 @@ class PlayerHandler: q_msg = channel_from_q.get_nowait() if not isinstance(q_msg, str): continue - split = q_msg.split(":",1) + split = q_msg.split(":", 1) message = split[1] source = message.split(":")[0] command = message.split(":")[1] diff --git a/web_server.py b/web_server.py index c58d03f..ab90de1 100644 --- a/web_server.py +++ b/web_server.py @@ -473,7 +473,7 @@ def status(channel: int): while retries < 40: try: message = player_from_q.get_nowait() - split = message.split(":",1) + split = message.split(":", 1) channel = int(split[0]) response = split[1] if response.startswith("UI:STATUS:"): diff --git a/websocket_server.py b/websocket_server.py index f53ba18..d58f777 100644 --- a/websocket_server.py +++ b/websocket_server.py @@ -255,7 +255,6 @@ class WebsocketServer: "Exception trying to send to websocket:", e ) - self.quit()