Skip to content

Commit 4170e67

Browse files
Refactor stops_for_location.py for improved readability and maintainability
1 parent 0edb289 commit 4170e67

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

examples/stops_for_location.py

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
from onebusaway import OnebusawaySDK
66

7-
# Load settings from .en`v file, if it exists. If not, we'll use the
7+
# Load settings from .env file, if it exists. If not, we'll use the
88
# Puget Sound server URL (which is also the default in the SDK) and
99
# the 'TEST' API key.
1010
settings = load_settings(
@@ -27,8 +27,8 @@
2727

2828
# make it easy to look up routes by ID.
2929
reference_map = {}
30-
for route in references.routes:
31-
reference_map[route.id] = route
30+
for ref_route in references.routes:
31+
reference_map[ref_route.id] = ref_route
3232

3333
for stop in stops:
3434
print(f"{stop.name} ({stop.lat}, {stop.lon})")
@@ -39,7 +39,7 @@
3939
route: Any = reference_map[route_id]
4040

4141
# Get a string that looks like "D Line - Blue Ridge/Crown Hill - Ballard - Downtown Seattle"
42-
description = [route.null_safe_short_name, route.description]
43-
description = [e for e in description if e]
44-
description = " - ".join(description)
45-
print(f" {description}")
42+
description_list = [route.null_safe_short_name, route.description]
43+
description_list = [e for e in description_list if e]
44+
description_str = " - ".join(description_list)
45+
print(f" {description_str}")

0 commit comments

Comments
 (0)