From 8e0243a600a2c4dcc0582b9e6a7c8e4f49e3b3af Mon Sep 17 00:00:00 2001 From: Matthieu Houdebine Date: Sat, 5 Apr 2025 12:32:55 +0200 Subject: [PATCH] Fix Lint issues --- library/config.py | 1 - library/scheduler.py | 2 -- library/sensors/sensors_python.py | 5 ----- theme-editor.py | 2 -- 4 files changed, 10 deletions(-) diff --git a/library/config.py b/library/config.py index 32e47459..9fea02aa 100644 --- a/library/config.py +++ b/library/config.py @@ -68,7 +68,6 @@ def load_theme(): def check_theme_compatible(display_size: str): - global THEME_DATA # Check if theme is compatible with hardware revision if display_size != THEME_DATA['display'].get("DISPLAY_SIZE", '3.5"'): logger.error("The selected theme " + CONFIG_DATA['config'][ diff --git a/library/scheduler.py b/library/scheduler.py index 15cb0ef2..f64460ef 100644 --- a/library/scheduler.py +++ b/library/scheduler.py @@ -56,7 +56,6 @@ def decorator(func): def periodic(scheduler, periodic_interval, action, actionargs=()): """ Wrap the scheduler with our periodic interval """ - global STOPPING if not STOPPING: # If the program is not stopping: re-schedule the task for future execution scheduler.enter(periodic_interval, 1, periodic, @@ -188,7 +187,6 @@ def PingStats(): @schedule(timedelta(milliseconds=1).total_seconds()) def QueueHandler(): # Do next action waiting in the queue - global STOPPING if STOPPING: # Empty the action queue to allow program to exit cleanly while not config.update_queue.empty(): diff --git a/library/sensors/sensors_python.py b/library/sensors/sensors_python.py index 289e8800..6401c811 100644 --- a/library/sensors/sensors_python.py +++ b/library/sensors/sensors_python.py @@ -175,7 +175,6 @@ class Gpu(sensors.Gpu): @staticmethod def stats() -> Tuple[ float, float, float, float, float]: # load (%) / used mem (%) / used mem (Mb) / total mem (Mb) / temp (°C) - global DETECTED_GPU if DETECTED_GPU == GpuType.AMD: return GpuAmd.stats() elif DETECTED_GPU == GpuType.NVIDIA: @@ -185,7 +184,6 @@ def stats() -> Tuple[ @staticmethod def fps() -> int: - global DETECTED_GPU if DETECTED_GPU == GpuType.AMD: return GpuAmd.fps() elif DETECTED_GPU == GpuType.NVIDIA: @@ -195,7 +193,6 @@ def fps() -> int: @staticmethod def fan_percent() -> float: - global DETECTED_GPU if DETECTED_GPU == GpuType.AMD: return GpuAmd.fan_percent() elif DETECTED_GPU == GpuType.NVIDIA: @@ -205,7 +202,6 @@ def fan_percent() -> float: @staticmethod def frequency() -> float: - global DETECTED_GPU if DETECTED_GPU == GpuType.AMD: return GpuAmd.frequency() elif DETECTED_GPU == GpuType.NVIDIA: @@ -471,7 +467,6 @@ class Net(sensors.Net): @staticmethod def stats(if_name, interval) -> Tuple[ int, int, int, int]: # up rate (B/s), uploaded (B), dl rate (B/s), downloaded (B) - global PNIC_BEFORE try: # Get current counters pnic_after = psutil.net_io_counters(pernic=True) diff --git a/theme-editor.py b/theme-editor.py index eded372b..bec917c2 100755 --- a/theme-editor.py +++ b/theme-editor.py @@ -163,7 +163,6 @@ def on_button1_press(event): def on_button1_press_and_drag(event): - global x0, y0 display_width, display_height = int(display.lcd.get_width() / RESIZE_FACTOR), int( display.lcd.get_height() / RESIZE_FACTOR) x1, y1 = event.x, event.y @@ -186,7 +185,6 @@ def on_button1_press_and_drag(event): def on_button1_release(event): - global x0, y0 display_width, display_height = int(display.lcd.get_width() / RESIZE_FACTOR), int( display.lcd.get_height() / RESIZE_FACTOR) x1, y1 = event.x, event.y