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
@@ -184,17 +184,14 @@ class CachedNotifications(Notifications):
|
||||
@Signal
|
||||
def clear_all(self) -> None:
|
||||
"""Signal emitted when notifications are emptied."""
|
||||
pass
|
||||
|
||||
@Signal
|
||||
def cached_notification_added(self, notification: CachedNotification) -> None:
|
||||
"""Signal emitted when a notification is cached."""
|
||||
pass
|
||||
|
||||
@Signal
|
||||
def cached_notification_removed(self, notification: CachedNotification) -> None:
|
||||
"""Signal emitted when a notification is removed from cache."""
|
||||
pass
|
||||
|
||||
@Property(List[CachedNotification], "readable")
|
||||
def cached_notifications(self) -> List[CachedNotification]:
|
||||
@@ -269,7 +266,7 @@ class CachedNotifications(Notifications):
|
||||
def load_cached_notifications(self) -> dict[int, CachedNotification]:
|
||||
"""Load cached notifications from a JSON file (deserialization)."""
|
||||
try:
|
||||
with open(NOTIFICATION_CACHE_FILE, "r") as file:
|
||||
with open(NOTIFICATION_CACHE_FILE) as file:
|
||||
data = json.load(file) # Load list of serialized notifications
|
||||
except (FileNotFoundError, json.JSONDecodeError):
|
||||
# If file doesn't exist or is corrupted, start with empty list
|
||||
|
||||
Reference in new issue
Block a user