From b1a16b603b3607fbbc91645df4ff3626f1eb41d7 Mon Sep 17 00:00:00 2001 From: Julian Metzler Date: Wed, 30 Nov 2022 21:37:00 +0100 Subject: [PATCH] Add destination replacements and strip all destination suffixes in parentheses --- run.py | 2 ++ settings_phalos.py | 7 ++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/run.py b/run.py index 579b00f..8ae892f 100644 --- a/run.py +++ b/run.py @@ -7,6 +7,7 @@ from util import timeout, TimeoutError import hashlib import json import random +import re import time import traceback @@ -156,6 +157,7 @@ def update_display(display, dbi): display.destination.set(text) else: dest = filter_route(train['route'])[-1]['name'] + dest = re.sub(r"\(.*\)$", "", dest).strip() text = DESTINATION_MAP.get(dest, dest).replace("ß", "ss") if train_type == "S": text = "".join(train['train'].split()) + " " + text diff --git a/settings_phalos.py b/settings_phalos.py index d0e2ff0..290c57f 100644 --- a/settings_phalos.py +++ b/settings_phalos.py @@ -89,7 +89,7 @@ DESTINATION_MAP = { "München Flughafen Terminal": "Flughafen/Airp.", "Amsterdam Centraal": "Amsterdam CS", "Venezia Santa Lucia": "Venezia", - "Zagreb Glavni kolodvor": "Zagreb", + "Zagreb Glavni kolodvor": "Zagreb Glavni K.", "Kempten(Allgäu)Hbf": "Kempten Hbf", "Höhenkirchen-Siegertsbrunn": "Höhenkirchen", "München-Trudering": "Trudering", @@ -100,6 +100,11 @@ DESTINATION_MAP = { "Budapest Déli": "Budapest Deli", "Köln Messe/Deutz Gl. 9-10": "Köln Messe/Deutz", "Köln Messe/Deutz Gl.11-12": "Köln Messe/Deutz", + "Frankfurt(M) Flughafen Fernbf": "Frankfurt Flugh.", + "Dachau Bahnhof": "Dachau", + "München Ost": "Ostbahnhof", + "Wolfratshausen": "Wolfratshsn", + "München-Pasing": "Pasing", } ARRIVAL_MAP = {