From 355f6a9a39d251132677b357683b598b3c8b762c Mon Sep 17 00:00:00 2001 From: Roman Date: Sun, 24 Sep 2023 23:33:37 +0900 Subject: [PATCH] Improving error messages --- waypaper/__main__.py | 2 +- waypaper/changer.py | 4 ++-- waypaper/translation_en.py | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/waypaper/__main__.py b/waypaper/__main__.py index af1516f..743c85c 100644 --- a/waypaper/__main__.py +++ b/waypaper/__main__.py @@ -9,7 +9,7 @@ from waypaper.arguments import args -__version__ = "1.9.2" +__version__ = "2.0" def run(): diff --git a/waypaper/changer.py b/waypaper/changer.py index a915ff3..d8a708a 100644 --- a/waypaper/changer.py +++ b/waypaper/changer.py @@ -17,7 +17,7 @@ def change_wallpaper(image_path, fill_option, color, backend, monitor): subprocess.Popen(["killall", "swaybg"]) time.sleep(0.005) except Exception as e: - print(e) + print(f"{ERR_KILL} {e}") command = ["swaybg"] # if monitor != "All": # command.extend(["-o", monitor]) @@ -40,7 +40,7 @@ def change_wallpaper(image_path, fill_option, color, backend, monitor): subprocess.Popen(["killall", "swaybg"]) time.sleep(0.005) except Exception as e: - print(e) + print(f"{ERR_KILL} {e}") subprocess.Popen(["swww", "init"]) command = ["swww", "img", image_path] command.extend(["--resize", fill]) diff --git a/waypaper/translation_en.py b/waypaper/translation_en.py index 32ffc21..95fa97f 100644 --- a/waypaper/translation_en.py +++ b/waypaper/translation_en.py @@ -18,7 +18,7 @@ MSG_CHANGEFOLDER = "Change wallpaper folder" MSG_CHOOSEFOLDER = "Please choose a folder" MSG_CACHING = "Caching wallpapers..." -MSG_SETWITH = "Wallpaper was set with" +MSG_SETWITH = "Sent command to set wallpaper was set with" MSG_HELP = "Waypaper's hotkeys:\n\nhjkl - Navigation (←↓↑→)\nf - Change wallpaper folder\n" MSG_HELP += "g - Scroll to top\nG - Scroll to bottom\nR - Set random wallpaper\nr - Recache wallpapers\n" @@ -34,6 +34,7 @@ ERR_WALL = "Error changing wallpaper:" ERR_NOTSUP = "The backend is not supported:" ERR_DISP = "Error determining monitor names:" +ERR_KILL = "Warning related to killall:" TIP_SUBFOLDER = "Include/exclude images in subfolders" TIP_REFRESH = "Recache the folder of images"