Skip to content

Commit

Permalink
Add line number (#18)
Browse files Browse the repository at this point in the history
* Add line number

* Reformat code
  • Loading branch information
polgarc authored Jan 24, 2024
1 parent e3f4b6d commit 7d5fd96
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -99,3 +99,6 @@ ENV/

# mypy
.mypy_cache/

# PyCharm
.idea
3 changes: 2 additions & 1 deletion CHANGES.txt
Original file line number Diff line number Diff line change
@@ -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
----------------
Expand Down
6 changes: 5 additions & 1 deletion opendata_transport/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down

0 comments on commit 7d5fd96

Please sign in to comment.