Pep8 lint
This commit is contained in:
parent
47fcf40ec6
commit
5d4c7224d9
3 changed files with 15 additions and 11 deletions
|
@ -49,6 +49,7 @@ def startServer(notifications=False):
|
||||||
def printer(msg: Any):
|
def printer(msg: Any):
|
||||||
print("LAUNCHER:{}".format(msg))
|
print("LAUNCHER:{}".format(msg))
|
||||||
|
|
||||||
|
|
||||||
def notif(msg: str):
|
def notif(msg: str):
|
||||||
print("NOTIFICATION:{}".format(msg))
|
print("NOTIFICATION:{}".format(msg))
|
||||||
|
|
||||||
|
|
17
player.py
17
player.py
|
@ -132,7 +132,9 @@ class Player:
|
||||||
if not self.state.get()["loaded_item"] or not self.isInit:
|
if not self.state.get()["loaded_item"] or not self.isInit:
|
||||||
loaded = False
|
loaded = False
|
||||||
elif not self.isPlaying:
|
elif not self.isPlaying:
|
||||||
# Because this function can be called very often, only some (less frequent) checks will initiate a full trial of loading success, for efficiency.
|
# Because this function can be called very often, only some (less
|
||||||
|
# frequent) checks will initiate a full trial of loading success, for
|
||||||
|
# efficiency.
|
||||||
if not short_test:
|
if not short_test:
|
||||||
# We're not playing now, so we can quickly test run
|
# We're not playing now, so we can quickly test run
|
||||||
# If that works, we're truely loaded.
|
# If that works, we're truely loaded.
|
||||||
|
@ -184,9 +186,9 @@ class Player:
|
||||||
|
|
||||||
# Audio Playout Related Methods
|
# Audio Playout Related Methods
|
||||||
|
|
||||||
|
|
||||||
# Loads a plan item into the player, ready for playing.
|
# Loads a plan item into the player, ready for playing.
|
||||||
# This includes some retry logic to try and double-down on ensuring it plays successfully.
|
# This includes some retry logic to try and double-down on ensuring it plays successfully.
|
||||||
|
|
||||||
def load(self, weight: int):
|
def load(self, weight: int):
|
||||||
if not self.isPlaying:
|
if not self.isPlaying:
|
||||||
# If we have something loaded already, unload it first.
|
# If we have something loaded already, unload it first.
|
||||||
|
@ -358,8 +360,8 @@ class Player:
|
||||||
# If we successfully unloaded, this will return true, for success!
|
# If we successfully unloaded, this will return true, for success!
|
||||||
return not self.isLoaded
|
return not self.isLoaded
|
||||||
|
|
||||||
|
|
||||||
# Starts playing the loaded item, from a given position (secs)
|
# Starts playing the loaded item, from a given position (secs)
|
||||||
|
|
||||||
def play(self, pos: float = 0):
|
def play(self, pos: float = 0):
|
||||||
self.logger.log.info("Playing from pos: " + str(pos))
|
self.logger.log.info("Playing from pos: " + str(pos))
|
||||||
if not self.isLoaded:
|
if not self.isLoaded:
|
||||||
|
@ -513,9 +515,9 @@ class Player:
|
||||||
except Exception:
|
except Exception:
|
||||||
self.logger.log.exception("Failed to quit mixer.")
|
self.logger.log.exception("Failed to quit mixer.")
|
||||||
|
|
||||||
|
|
||||||
# Sets whether auto advance is on or off
|
# Sets whether auto advance is on or off
|
||||||
# Auto advance is where the next item in the list is selected after the current item is finished playing.
|
# Auto advance is where the next item in the list is selected after the current item is finished playing.
|
||||||
|
|
||||||
def set_auto_advance(self, message: bool) -> bool:
|
def set_auto_advance(self, message: bool) -> bool:
|
||||||
self.state.update("auto_advance", message)
|
self.state.update("auto_advance", message)
|
||||||
return True
|
return True
|
||||||
|
@ -534,7 +536,6 @@ class Player:
|
||||||
self.state.update("play_on_load", message)
|
self.state.update("play_on_load", message)
|
||||||
return True
|
return True
|
||||||
|
|
||||||
|
|
||||||
# Show Plan Related Methods
|
# Show Plan Related Methods
|
||||||
|
|
||||||
def _check_ghosts(self, item: PlanItem):
|
def _check_ghosts(self, item: PlanItem):
|
||||||
|
@ -775,7 +776,8 @@ class Player:
|
||||||
# If we're going to live (potentially from not live/PFL), potentially tracklist if it's playing.
|
# If we're going to live (potentially from not live/PFL), potentially tracklist if it's playing.
|
||||||
if live:
|
if live:
|
||||||
self._potentially_tracklist()
|
self._potentially_tracklist()
|
||||||
# If the fader is now not live, don't bother stopping the tracklist, incase it's faded up again during the same playback.
|
# If the fader is now not live, don't bother stopping the tracklist,
|
||||||
|
# incase it's faded up again during the same playback.
|
||||||
return True
|
return True
|
||||||
|
|
||||||
# Helper functions
|
# Helper functions
|
||||||
|
@ -1049,7 +1051,8 @@ class Player:
|
||||||
"Message return Queue is missing!!!! Can't send message."
|
"Message return Queue is missing!!!! Can't send message."
|
||||||
)
|
)
|
||||||
|
|
||||||
# Send the current status to all other modules/clients. Used for updating all client UIs when one of them causes a change etc.
|
# Send the current status to all other modules/clients. Used for updating
|
||||||
|
# all client UIs when one of them causes a change etc.
|
||||||
def _send_status(self):
|
def _send_status(self):
|
||||||
self._retMsg(str(self.status), okay_str=True,
|
self._retMsg(str(self.status), okay_str=True,
|
||||||
custom_prefix="ALL:STATUS:")
|
custom_prefix="ALL:STATUS:")
|
||||||
|
|
Loading…
Reference in a new issue