ratp: Include tramways in alerts

This commit is contained in:
nemunaire 2023-01-19 12:57:25 +01:00
commit 615f2a8652
2 changed files with 4 additions and 3 deletions

View file

@ -77,7 +77,7 @@ class IDFMAPI:
"MessageType": "SHORT_MESSAGE",
"MessageText": {
"id": src["id"],
"title": src["title"].replace("Métro " + line + " : ", '').replace("Ligne " + line + " : ", ''),
"title": src["title"].replace("Métro " + line + " : ", '').replace("Ligne " + line + " : ", '').replace("Tramway " + line + " : ", ''),
"value": re.sub(cleanr, '', re.sub(cleanrA, '', src["message"].replace('&nbsp;', ' ').replace('&#8217;', "'").replace('&#224;', 'à').replace('&#233;', 'é').replace('&#232;', 'è').replace('<br>', ' ').replace('</p>', ' ').replace('Information Ile de France Mobilités :', ''))).strip(),
}
}],
@ -91,6 +91,7 @@ class IDFMAPI:
mode = "rers"
elif mode == "T":
mode = "tramways"
line = line[1:]
elif mode == "B":
mode = "buses"
elif mode == "N":
@ -194,7 +195,7 @@ class IDFMAPI:
draw.rounded_rectangle((0, 0, width, size), radius=4, fill=fill)
else:
draw.rectangle((0, 0, width, size), fill=fill)
draw.text((int(width / 2), int(size / 2)), line, fill="white" if (fill == "black" and mode == "tramways") or (fill != "white" and mode != "tramways") else "black", anchor="mm", font=fnt_icon)
draw.text((int(width / 2), int(size / 2)), line, fill="white" if (fill == "black" and mode == "tramways") or (fill != "white" and mode != "tramways") or (fill == "white" and mode == "tramways") else "black", anchor="mm", font=fnt_icon)
return image