From 3bc4946f6c60f066389ab72a62cc56e2d079f3ed Mon Sep 17 00:00:00 2001 From: Ultrabug Date: Sun, 10 Sep 2023 11:26:11 +0200 Subject: [PATCH] playerctl module: apply code qa --- py3status/modules/playerctl.py | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/py3status/modules/playerctl.py b/py3status/modules/playerctl.py index 6a2505d4ff..e902e94449 100644 --- a/py3status/modules/playerctl.py +++ b/py3status/modules/playerctl.py @@ -70,9 +70,9 @@ from threading import Thread import gi +from gi.repository import GLib, Playerctl gi.require_version("Playerctl", "2.0") -from gi.repository import GLib, Playerctl class Py3status: @@ -99,9 +99,7 @@ class Py3status: format_player_separator = " " players = [] seek_delta = 5 - thresholds = { - "status": [("Playing", "good"), ("Paused", "degraded"), ("Stopped", "bad")] - } + thresholds = {"status": [("Playing", "good"), ("Paused", "degraded"), ("Stopped", "bad")]} volume_delta = 10 class Meta: @@ -277,11 +275,7 @@ def playerctl(self): player_data = self._get_player_data(player) # Check if the player should cause the module to continuously update - if ( - self.position - and player_data["status"] == "Playing" - and player_data["position"] - ): + if self.position and player_data["status"] == "Playing" and player_data["position"]: cached_until = self.cache_timeout # Set the color of a player @@ -299,9 +293,7 @@ def playerctl(self): return { "cached_until": self.py3.time_in(cached_until), - "full_text": self.py3.safe_format( - self.format, {"format_player": format_players} - ), + "full_text": self.py3.safe_format(self.format, {"format_player": format_players}), } def on_click(self, event):