From 27314c0c45518320123c4e30643eebfeb300ad43 Mon Sep 17 00:00:00 2001 From: Pierre-Olivier Mercier Date: Mon, 16 Sep 2024 06:57:37 +0200 Subject: [PATCH] Fix ratp disruption issue --- modules/ratp.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/ratp.py b/modules/ratp.py index ceff3f6..f819101 100644 --- a/modules/ratp.py +++ b/modules/ratp.py @@ -414,6 +414,7 @@ class RATPWeatherModule: align_y += int(1.5 * line_height) states = [] + disruption = {} for disruption in weather[mode][line]: status = "past" for ap in disruption["applicationPeriods"]: @@ -439,7 +440,7 @@ class RATPWeatherModule: state = "" fill = "darkgray" - if disruption["scope"] == "line" and ("NO_SERVICE" in states or "BLOQUANTE" in states): + if "scope" in disruption and disruption["scope"] == "line" and ("NO_SERVICE" in states or "BLOQUANTE" in states): fill = "black" state = "_trafic_grand" elif "PERTURBEE" in states: