From 2c01e9fabdc37659ceeb600a8b739838e3e67b5d Mon Sep 17 00:00:00 2001 From: Philipp Spitzer Date: Wed, 19 Jul 2023 00:08:08 +0200 Subject: [PATCH] Make vao_ext_id_to_ifopt_stop_id( working for whole Austria. --- wrpylib/lib_update_public_transport.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/wrpylib/lib_update_public_transport.py b/wrpylib/lib_update_public_transport.py index 7fb8027..8136cda 100644 --- a/wrpylib/lib_update_public_transport.py +++ b/wrpylib/lib_update_public_transport.py @@ -27,7 +27,8 @@ def default_query_date(today: date) -> date: def vao_ext_id_to_ifopt_stop_id(vao_ext_id: str) -> Optional[str]: """Converts a VAO EXT ID like "476164600" to the IFOPT stop ID like "at:47:61646". In case the vao_ext_id cannot be converted, None is returned.""" - if match := re.match(r'(47)(\d{5})00', vao_ext_id): + if match := re.match(r'(4[1-9])(\d{5})00$', vao_ext_id): g1, g2 = match.groups() + g2 = int(g2) return f"at:{g1}:{g2}" return None -- 2.39.5