diff --git a/.gitignore b/.gitignore index 7bbc71c..7616e48 100644 --- a/.gitignore +++ b/.gitignore @@ -99,3 +99,6 @@ ENV/ # mypy .mypy_cache/ + +# PyCharm +.idea diff --git a/CHANGES.txt b/CHANGES.txt index 0a420c4..4fb1a69 100644 --- a/CHANGES.txt +++ b/CHANGES.txt @@ -1,10 +1,11 @@ Changes ======= -20231213 - 0.4.1 +20240113 - 0.5.0 ---------------- - Add KeyError exception (thanks @miaucl) +- Add line numbers (thanks @polgarc) 20231120 - 0.4.0 ---------------- diff --git a/opendata_transport/__init__.py b/opendata_transport/__init__.py index 3fe355b..bdd355b 100644 --- a/opendata_transport/__init__.py +++ b/opendata_transport/__init__.py @@ -252,7 +252,11 @@ def get_connection(connection): connection_info["number"] = "" for section in connection["sections"]: if section["journey"] is not None: - connection_info["number"] = section["journey"]["name"] + journey = section["journey"] + connection_info["number"] = journey["name"] + connection_info["line"] = "".join( + filter(None, [journey["category"], journey["number"]]) + ) break connection_info["platform"] = connection["from"]["platform"]