From 2e4cc9af552249fbfdc239ba796a02d812ff0356 Mon Sep 17 00:00:00 2001 From: Lucas Vivo Date: Sun, 15 Nov 2026 22:13:32 +0100 Subject: [PATCH] style(wallpaper_changer): ruff auto fix --- wallpaper_changer/main.py | 4 ++-- wallpaper_changer/src/wallpaper_changer/monitor_manager.py | 2 +- .../src/wallpaper_changer/wallpaper_builder.py | 3 ++- wallpaper_changer/tests/unit/test_monitor_manager.py | 7 ++++--- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/wallpaper_changer/main.py b/wallpaper_changer/main.py index 181477d..026b9d2 100755 --- a/wallpaper_changer/main.py +++ b/wallpaper_changer/main.py @@ -2,8 +2,6 @@ import sys from pathlib import Path -from serverlibrary import setup_logging - from wallpaper_changer.argument_parser import parse_args from wallpaper_changer.config import Config from wallpaper_changer.encryption_manager import EncryptionManager @@ -13,6 +11,8 @@ from wallpaper_changer.monitor_manager import MonitorManager from wallpaper_changer.wallpaper_builder import WallpaperBuilder from wallpaper_changer.wallpaper_setter import WallpaperSetter +from serverlibrary import setup_logging + logger = get_logger(__name__) diff --git a/wallpaper_changer/src/wallpaper_changer/monitor_manager.py b/wallpaper_changer/src/wallpaper_changer/monitor_manager.py index b8e21f6..54656cd 100644 --- a/wallpaper_changer/src/wallpaper_changer/monitor_manager.py +++ b/wallpaper_changer/src/wallpaper_changer/monitor_manager.py @@ -1,7 +1,7 @@ -from glob import glob import re import xml.etree.ElementTree as ET from dataclasses import dataclass +from glob import glob from pathlib import Path from wallpaper_changer.logging_utils import get_logger diff --git a/wallpaper_changer/src/wallpaper_changer/wallpaper_builder.py b/wallpaper_changer/src/wallpaper_changer/wallpaper_builder.py index 07dd668..63d50b1 100644 --- a/wallpaper_changer/src/wallpaper_changer/wallpaper_builder.py +++ b/wallpaper_changer/src/wallpaper_changer/wallpaper_builder.py @@ -185,7 +185,8 @@ class WallpaperBuilder: raise ValueError( f"Cannot open encrypted image while encryption is disabled: {image_path}" ) - decrypted = ImageRepository(image_path.parent).decode_image(image_path, None, private_key, image_record.get("hash")) + decrypted = ImageRepository(image_path.parent).decode_image(image_path, None, + private_key, str(image_record.get("hash"))) if decrypted is None: raise ValueError(f"Could not decrypt image: {image_path}") image_data = decrypted diff --git a/wallpaper_changer/tests/unit/test_monitor_manager.py b/wallpaper_changer/tests/unit/test_monitor_manager.py index 81ce4bd..8939e0f 100644 --- a/wallpaper_changer/tests/unit/test_monitor_manager.py +++ b/wallpaper_changer/tests/unit/test_monitor_manager.py @@ -1,5 +1,4 @@ import random -import tkinter as tk import unittest import xml.etree.ElementTree as ET from pathlib import Path @@ -19,7 +18,7 @@ class MonitorManagerTests(unittest.TestCase): for max_monitors in range(1, 5): x_coord = 0 layout_monitors = [] - for _ in range(0, max_monitors): + for _ in range(max_monitors): layout_monitors.append(Monitor(1920, 1080, x_coord,set("TestMon"))) x_coord+=1920 monitors = ScreenLayout(tuple(layout_monitors)) @@ -144,7 +143,9 @@ class MonitorManagerTests(unittest.TestCase): drm_root=drm_root, ) self.assertEqual(monitors.monitor_count, 2) - + + # import tkinter as tk + #def test_detect_single_connected_monitor_actual_monitor(self) -> None: # """Verify a single enabled connector produces a one-monitor layout.""" # args = self.parse_args()