Add noqa instructions for linting

This commit is contained in:
Emma Nora Theuer 2025-02-27 15:53:46 +01:00
parent 3ae7d21c24
commit 3d84d7cd83
Signed by: emma
GPG key ID: 9565B852BFB0E11E

View file

@ -1,34 +1,22 @@
from os import chdir from os import chdir
import logging import logging
from PIL import Image
from pystray import Icon, MenuItem as item, Menu # noqa: F401
# Use logger that is also in wallman_lib # Use logger that is also in wallman_lib
logger = logging.getLogger("wallman") logger = logging.getLogger("wallman")
try:
from PIL import Image
except ImportError:
logging.error("Couldn't import PIL, wallman will launch without a systray.")
print("Couldn't import PIL, wallman will launch without a systray.")
raise
try:
from pystray import Icon, MenuItem as item, Menu
except ImportError:
logging.error("Couldn't import pystray, wallman will launch without a systray.")
print("Couldn't import pystray, wallman will launch without a systray.")
raise
# This should always be ran with "set_wallpaper_by_time" as input! # This should always be ran with "set_wallpaper_by_time" as input!
def set_wallpaper_again(icon, item, wallpaper_setter): def set_wallpaper_again(icon, item, wallpaper_setter): # noqa: F811
logging.info("Re-Setting wallpaper due to systray input.") logging.info("Re-Setting wallpaper due to systray input.")
wallpaper_setter() wallpaper_setter()
def reroll_wallpapers(icon, item, wallpaper_chooser, wallpaper_setter): def reroll_wallpapers(icon, item, wallpaper_chooser, wallpaper_setter): # noqa: F811
logging.info("Rerolling Wallpaper sets and resetting wallpaper due to systray input") logging.info("Rerolling Wallpaper sets and resetting wallpaper due to systray input")
wallpaper_chooser() wallpaper_chooser()
wallpaper_setter() wallpaper_setter()
# This should always be ran with "scheduler.shutdown" as input! # This should always be ran with "scheduler.shutdown" as input!
def on_quit(icon, item, shutdown_scheduler): def on_quit(icon, item, shutdown_scheduler): # noqa: F811
logging.info("Shutting down wallman due to systray input.") logging.info("Shutting down wallman due to systray input.")
shutdown_scheduler() shutdown_scheduler()
icon.stop() icon.stop()