Skip to content

Commit 1f40d7d

Browse files
committed
style: resolve final pylint warnings for 10/10 score
1 parent bc3c4e3 commit 1f40d7d

2 files changed

Lines changed: 11 additions & 19 deletions

File tree

src/UniparkGUI.py

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -83,14 +83,14 @@ def get_time_phase(self):
8383
"""Calcola la fase attuale basata sull'orologio di sistema e imposta la probabilità di sosta."""
8484
hour = datetime.now().hour
8585
if 8 <= hour < 14:
86-
return "PICCO MATTUTINO", 85 # Molte auto in entrata
87-
elif 14 <= hour < 16:
88-
return "TRAFFICO POMERIDIANO", 55 # Situazione stabile
89-
elif 16 <= hour < 19:
90-
return "DEFLUSSO POMERIDIANO", 25 # Le auto iniziano a uscire
91-
elif 19 <= hour < 22:
92-
return "SVUOTAMENTO SERALE", 10 # Parcheggi quasi deserti
93-
return "FASCIA NOTTURNA", 2 # Nessuna attività
86+
return "PICCO MATTUTINO", 85
87+
if 14 <= hour < 16:
88+
return "TRAFFICO POMERIDIANO", 55
89+
if 16 <= hour < 19:
90+
return "DEFLUSSO POMERIDIANO", 25
91+
if 19 <= hour < 22:
92+
return "SVUOTAMENTO SERALE", 10
93+
return "FASCIA NOTTURNA", 2
9494

9595
def set_theme_colors(self):
9696
"""Palette colori centrale dell'applicazione per facilitare future modifiche al tema."""
@@ -224,16 +224,8 @@ def setup_main_layout(self):
224224
self.canvas.create_image(
225225
0, 0, anchor="nw", image=self.bg_img, tags="static_map"
226226
)
227-
except Exception as e:
228-
# pylint: disable=broad-exception-caught
229-
self.canvas.create_text(
230-
400,
231-
300,
232-
text="Mappa non trovata ('mappa.png')",
233-
font=("Consolas", 14, "bold"),
234-
fill=self.colors["accent_red"],
235-
tags="static_map",
236-
)
227+
except Exception: # pylint: disable=broad-exception-caught
228+
self.canvas.create_text(400, 300, text="Mappa non trovata ('mappa.png')", font=("Consolas", 14, "bold"), fill=self.colors["accent_red"], tags="static_map")
237229

238230
# --- PANNELLO DASHBOARD (Destra) ---
239231
dashboard_panel = tk.Frame(main_container, bg=self.colors["bg_app"], width=460)

tests/test_UniParkGUI.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
import pytest
55

66
# Importiamo la classe GUI
7-
from UniparkGUI import UniParkApp
7+
from UniparkGUI import UniParkApp # pylint: disable=import-error
88

99

1010
@pytest.fixture

0 commit comments

Comments
 (0)