Flake 8 lint

This commit is contained in:
Matthew Stratford 2022-03-11 23:55:53 +00:00
parent 7400272778
commit 52248bea1f
7 changed files with 7 additions and 11 deletions

View file

@ -1,6 +1,5 @@
from helpers.state_manager import StateManager from helpers.state_manager import StateManager
from helpers.os_environment import isWindows, resolve_external_file_path from helpers.os_environment import isWindows, resolve_external_file_path
from typing import List
from setproctitle import setproctitle from setproctitle import setproctitle
from multiprocessing import current_process, Queue from multiprocessing import current_process, Queue
from time import sleep from time import sleep
@ -72,7 +71,7 @@ class FileManager:
command = split[2] command = split[2]
# rest of message = split[3] # 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 we have requested a new show plan, empty the music-tmp directory for the previous show.
if command == "GETPLAN": if command == "GETPLAN":
@ -158,8 +157,6 @@ class FileManager:
) )
) )
except Exception as e: except Exception as e:
self.logger.log.exception( self.logger.log.exception(
"Received unexpected exception: {}".format(e)) "Received unexpected exception: {}".format(e))

View file

@ -37,7 +37,7 @@ class LoggingManager:
return return
# Enable debug by default # Enable debug by default
if (debug == None and package.BETA): if (debug is None and package.BETA):
debug = True debug = True
self.logger.setLevel(logging.DEBUG if debug else logging.INFO) self.logger.setLevel(logging.DEBUG if debug else logging.INFO)

View file

@ -35,7 +35,7 @@ def startServer(notifications=False):
if server and server.is_alive(): if server and server.is_alive():
server.terminate() 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. # Catch the handler being killed externally.
except Exception as e: except Exception as e:

View file

@ -931,7 +931,7 @@ class Player:
def _retAll(self, msg): def _retAll(self, msg):
if self.out_q: 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( def _retMsg(
self, msg: Any, okay_str: bool = False, custom_prefix: Optional[str] = None self, msg: Any, okay_str: bool = False, custom_prefix: Optional[str] = None
@ -1108,7 +1108,7 @@ class Player:
# We got a message. # 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 # This is here so that we can check often, but not every single loop
# Only when user gives input. # Only when user gives input.
self._checkIsLoaded() self._checkIsLoaded()

View file

@ -27,7 +27,7 @@ class PlayerHandler:
q_msg = channel_from_q.get_nowait() q_msg = channel_from_q.get_nowait()
if not isinstance(q_msg, str): if not isinstance(q_msg, str):
continue continue
split = q_msg.split(":",1) split = q_msg.split(":", 1)
message = split[1] message = split[1]
source = message.split(":")[0] source = message.split(":")[0]
command = message.split(":")[1] command = message.split(":")[1]

View file

@ -473,7 +473,7 @@ def status(channel: int):
while retries < 40: while retries < 40:
try: try:
message = player_from_q.get_nowait() message = player_from_q.get_nowait()
split = message.split(":",1) split = message.split(":", 1)
channel = int(split[0]) channel = int(split[0])
response = split[1] response = split[1]
if response.startswith("UI:STATUS:"): if response.startswith("UI:STATUS:"):

View file

@ -255,7 +255,6 @@ class WebsocketServer:
"Exception trying to send to websocket:", e "Exception trying to send to websocket:", e
) )
self.quit() self.quit()