From 27314c0c45518320123c4e30643eebfeb300ad43 Mon Sep 17 00:00:00 2001 From: Pierre-Olivier Mercier Date: Mon, 16 Sep 2024 06:57:37 +0200 Subject: [PATCH 1/3] 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: From 835dee0e96b340218ca5e7d5baa2f3cde6f2e507 Mon Sep 17 00:00:00 2001 From: Pierre-Olivier Mercier Date: Mon, 16 Sep 2024 06:57:57 +0200 Subject: [PATCH 2/3] Color in black line icon for next stop --- modules/ratp.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ratp.py b/modules/ratp.py index f819101..d8c7e90 100644 --- a/modules/ratp.py +++ b/modules/ratp.py @@ -511,7 +511,7 @@ class RATPNextStopModule: prep[s["destination"]] = [] prep[s["destination"]].append(s) - icon = IDFMAPI.get_line_icon(config, mode, line, int(line_height*(1.5 if len(prep.keys()) > 1 else 1))) + icon = IDFMAPI.get_line_icon(config, mode, line, int(line_height*(1.5 if len(prep.keys()) > 1 else 1)), "black") image.paste(icon, (0 if len(prep.keys()) > 1 else int(line_height * 1.5 / 2 - icon.width / 2), align), icon) max_dest = 64 From cf1db8f746c4412eabb79c596a0fec5ff6f36bc2 Mon Sep 17 00:00:00 2001 From: Pierre-Olivier Mercier Date: Mon, 16 Sep 2024 06:58:12 +0200 Subject: [PATCH 3/3] RER B is far away, not others transportations --- modules/ratp.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/ratp.py b/modules/ratp.py index d8c7e90..90221e7 100644 --- a/modules/ratp.py +++ b/modules/ratp.py @@ -490,10 +490,10 @@ class RATPNextStopModule: mode = tmp[0][0] line = tmp[0][1:] - if tmp[0] == "M14": - mint = datetime.now() + timedelta(minutes=4) - else: + if tmp[0] == "RB": mint = datetime.now() + timedelta(minutes=10) + else: + mint = datetime.now() + timedelta(minutes=4) try: if 1 < len(tmp) < 4: