style(wallpaper_changer): ruff auto changes

This commit is contained in:
Lucas Vivo committed 2026-11-16 19:48:08 +01:00
1 parent 49775c0863
commit 95e732b088
3 files changed
+12 -7

No files matched your search

+2 -2
View File
@@ -2,6 +2,8 @@
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
@@ -11,8 +13,6 @@ 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__)
@@ -36,7 +36,8 @@ class Config:
}
if (
args.check_encryption or args.decode_all or args.decode_argument or args.printNT or args.decryptNT or args.encryptNT
args.check_encryption or args.decode_all or args.decode_argument or
args.printNT or args.decryptNT or args.encryptNT
) and args.mode == "default" and args.folder is None:
args.mode = "x"
@@ -120,11 +120,13 @@ class ImageRepository:
existing_entry = None
for entry in naming_table:
if entry.image_hash == file_hash and not replace and len(entry.image_name) >= len(image_path.name):
logger.warning(f"Skipping already encrypted image: {image_path.name}, Entry: {entry.image_name}:{entry.encrypted_file}")
logger.warning(f"Skipping already encrypted image: {image_path.name}, "
f"Entry: {entry.image_name}:{entry.encrypted_file}")
skip = True
break
elif entry.image_hash == file_hash and not replace and len(entry.image_name) < len(image_path.name):
logger.warning(f"Already encrypted image updated with longer name {entry.image_name} -> {image_path.name}")
logger.warning(f"Already encrypted image updated with longer name "
f"{entry.image_name} -> {image_path.name}")
entry.image_name = image_path.name
skip = True
break
@@ -256,7 +258,8 @@ class ImageRepository:
if image_name is None:
image_name = self._find_name_in_legacy_tables(encrypted_path.name)
logger.warning(
f"Could not find original name for {encrypted_path.name} in naming table, checking legacy tables: {image_name}"
f"Could not find original name for {encrypted_path.name} in naming table, "
f"checking legacy tables: {image_name}"
)
if image_name is None:
image_name = f"Sexy_MISSING_{len(decoded_paths) + 1}.jpg"
@@ -290,7 +293,8 @@ class ImageRepository:
naming_table_path, private_key
)
selected_entries = [
entry for entry in naming_table if matcher.search(f"{entry.image_name};{entry.encrypted_file};{entry.image_hash}")
entry for entry in naming_table if matcher.search(
f"{entry.image_name};{entry.encrypted_file};{entry.image_hash}")
]
decoded_paths = []