diff --git a/helpers/os_environment.py b/helpers/os_environment.py index 5f40712..1ad54b2 100644 --- a/helpers/os_environment.py +++ b/helpers/os_environment.py @@ -28,7 +28,7 @@ def resolve_local_file_path(relative_path: str): try: # PyInstaller creates a temp folder and stores path in _MEIPASS base_path: str = sys._MEIPASS - except Exception: + except Exception : base_path = os.path.abspath(".") return os.path.join(base_path, relative_path) diff --git a/player.py b/player.py index cc86487..487183f 100644 --- a/player.py +++ b/player.py @@ -81,7 +81,7 @@ class Player: def isInit(self): try: mixer.music.get_busy() - except Exception: + except Exception : return False return True @@ -110,10 +110,10 @@ class Player: position: float = self.state.state["pos"] mixer.music.set_volume(0) mixer.music.play(0) - except Exception: + except Exception : try: mixer.music.set_volume(1) - except Exception: + except Exception : self.logger.log.exception( "Failed to reset volume after attempting loaded test." ) @@ -148,7 +148,7 @@ class Player: try: mixer.music.play(0, pos) self.state.update("pos_offset", pos) - except Exception: + except Exception : self.logger.log.exception("Failed to play at pos: " + str(pos)) return False self.state.update("paused", False) @@ -159,7 +159,7 @@ class Player: def pause(self): try: mixer.music.pause() - except Exception: + except Exception : self.logger.log.exception("Failed to pause.") return False @@ -172,7 +172,7 @@ class Player: position: float = self.state.state["pos_true"] try: self.play(position) - except Exception: + except Exception : self.logger.log.exception( "Failed to unpause from pos: " + str(position) ) @@ -186,7 +186,7 @@ class Player: # if self.isPlaying or self.isPaused: try: mixer.music.stop() - except Exception: + except Exception : self.logger.log.exception("Failed to stop playing.") return False self.state.update("pos", 0) @@ -203,7 +203,7 @@ class Player: if self.isPlaying: try: self.play(pos) - except Exception: + except Exception : self.logger.log.exception("Failed to seek to pos: " + str(pos)) return False return True @@ -330,7 +330,7 @@ class Player: self.logger.log.info("Loading file: " + str(loaded_item.filename)) mixer.music.load(loaded_item.filename) - except Exception: + except Exception : # We couldn't load that file. self.logger.log.exception( "Couldn't load file: " + str(loaded_item.filename) @@ -346,7 +346,7 @@ class Player: "length", mixer.Sound( loaded_item.filename).get_length() / 1000 ) - except Exception: + except Exception : self.logger.log.exception( "Failed to update the length of item.") return False @@ -362,7 +362,7 @@ class Player: mixer.music.unload() self.state.update("paused", False) self.state.update("loaded_item", None) - except Exception: + except Exception : self.logger.log.exception("Failed to unload channel.") return False return not self.isLoaded @@ -372,7 +372,7 @@ class Player: mixer.quit() self.state.update("paused", False) self.logger.log.info("Quit mixer.") - except Exception: + except Exception : self.logger.log.exception("Failed to quit mixer.") def output(self, name: Optional[str] = None): @@ -387,7 +387,7 @@ class Player: mixer.init(44100, -16, 2, 1024, devicename=name) else: mixer.init(44100, -16, 2, 1024) - except Exception: + except Exception : self.logger.log.exception( "Failed to init mixer with device name: " + str(name) ) @@ -683,7 +683,7 @@ class Player: self.logger.log.info("Received SystemExit") except Exception as e: self.logger.log.exception( - "Received unexpected exception: {}".format(e)) + "Received unexpected Exception: {}".format(e)) self.logger.log.info("Quiting player " + str(channel)) self.quit() diff --git a/player_handler.py b/player_handler.py index 4d94f4a..afb67a1 100644 --- a/player_handler.py +++ b/player_handler.py @@ -31,7 +31,7 @@ class PlayerHandler: ui_to_q[channel].put(message) if source in ["ALL", "CONTROLLER"]: controller_to_q[channel].put(message) - except Exception: + except Exception : pass sleep(0.02) diff --git a/websocket_server.py b/websocket_server.py index b39109a..9bfbce2 100644 --- a/websocket_server.py +++ b/websocket_server.py @@ -39,7 +39,7 @@ class WebsocketServer: try: asyncio.get_event_loop().run_forever() - except Exception: + except Exception : # Sever died somehow, just quit out. self.quit()