ratp: Include tramways in alerts
This commit is contained in:
parent
c84449f034
commit
615f2a8652
2 changed files with 4 additions and 3 deletions
|
|
@ -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(' ', ' ').replace('’', "'").replace('à', 'à').replace('é', 'é').replace('è', 'è').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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue