style: enforce consistent codestyle via ruff config and auto-fixes
- Configure ruff: isort, pyupgrade, bugbear, flake8 rules - Auto-fix import sorting, redundant parens, exception chaining - Remove from __future__ import annotations (Python 3.13+) - Convert debug print() to logger calls - Fix typo applicaiton → application in icon_resolver - Remove bare returns in animator setters - Move TYPE_CHECKING imports to runtime where used at runtime
This commit is contained in:
60 files changed
+243
-217
No files matched your search
@@ -13,9 +13,9 @@ from fabric.widgets.wayland import WaylandWindow as Window
|
||||
from services.mpris import PlayerManager, PlayerService
|
||||
from utils.utils import svg_file
|
||||
from window.controlcenter.player import (
|
||||
PLAYER_FALLBACK_ART,
|
||||
apply_player_art,
|
||||
get_shared_mpris_manager,
|
||||
PLAYER_FALLBACK_ART,
|
||||
)
|
||||
|
||||
|
||||
@@ -667,9 +667,10 @@ class PlayerBox(Box):
|
||||
self.play_pause_icon.dynamic_file(icon_file)
|
||||
else:
|
||||
# Fallback if play_pause_icon isn't available
|
||||
from utils.utils import get_relative_path
|
||||
import os
|
||||
|
||||
from utils.utils import get_relative_path
|
||||
|
||||
self.play_pause_button.get_child().set_from_file(
|
||||
os.path.join(get_relative_path("assets/icons/"), icon_file)
|
||||
)
|
||||
|
||||
@@ -3,10 +3,11 @@ from fabric.widgets.box import Box
|
||||
from fabric.widgets.button import Button
|
||||
from fabric.widgets.image import Image
|
||||
from fabric.widgets.label import Label
|
||||
from shared.widgets.flat_scale import FlatScale
|
||||
from fabric.widgets.scrolledwindow import ScrolledWindow
|
||||
from fabric.widgets.separator import Separator
|
||||
|
||||
from shared.widgets.flat_scale import FlatScale
|
||||
|
||||
# Local imports
|
||||
from utils.roam import audio_service
|
||||
|
||||
@@ -208,9 +209,10 @@ class PerAppVolumeControl(Box):
|
||||
for i, app in enumerate(applications):
|
||||
if hasattr(app, "name") and hasattr(app, "volume"):
|
||||
app_widget = self._create_app_control(app)
|
||||
self.apps_container.children = list(
|
||||
self.apps_container.children
|
||||
) + [app_widget]
|
||||
self.apps_container.children = [
|
||||
*list(self.apps_container.children),
|
||||
app_widget,
|
||||
]
|
||||
|
||||
# Add separator between apps (except for last one)
|
||||
if i < len(applications) - 1:
|
||||
@@ -218,9 +220,10 @@ class PerAppVolumeControl(Box):
|
||||
orientation="horizontal",
|
||||
style_classes="app-volume-separator",
|
||||
)
|
||||
self.apps_container.children = list(
|
||||
self.apps_container.children
|
||||
) + [separator]
|
||||
self.apps_container.children = [
|
||||
*list(self.apps_container.children),
|
||||
separator,
|
||||
]
|
||||
|
||||
self._app_widgets[app.name] = (app_widget, app)
|
||||
else:
|
||||
|
||||
Reference in new issue
Block a user