Skip to content

Commit

Permalink
Fix getRoutes bug
Browse files Browse the repository at this point in the history
  • Loading branch information
athuler committed Aug 18, 2024
1 parent e0f5e5d commit beb86bf
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 4 deletions.
11 changes: 11 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
# Changelog


## 0.2.1 (Unreleased)

### Added

### Changed

- Fixed `AttributeError: 'list' object has no attribute 'items'` error thrown in `TransportationSystem.getRoutes()`

### Removed


## 0.2.0 (2024-07-31)

### Added
Expand Down
7 changes: 4 additions & 3 deletions passiogo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -149,12 +149,13 @@ def getRoutes(
if(routes == None):
return(None)


# Handle Differing Response Format
if "all" in routes:
routes = routes["all"]

allRoutes = []
for digit, route in routes.items():
for route in routes:
possibleKeys = ["id", "groupId", "groupColor", "name", "shortName", "nameOrig", "fullname", "myid", "mapApp", "archive", "goPrefixRouteName", "goShowSchedule", "outdated", "distance", "latitude", "longitude", "timezone", "serviceTime", "serviceTimeShort"]

for possibleKey in possibleKeys:
Expand Down Expand Up @@ -634,12 +635,12 @@ def launchWS():


def handleWsError(wsapp, error):
vars.errors.append(f"->WebSocketError: {error}")
...


def handleWsClose(wsapp, close_status_code, close_msg):
wsapp.close()
vars.logs.append("Closing WebSocket")
...


def subscribeWS(
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@

setup(
name='PassioGo',
version="0.2.0",
version="0.2.1",
description="An unofficial API for Passio Go",
long_description=long_description,
long_description_content_type='text/markdown',
Expand Down

0 comments on commit beb86bf

Please sign in to comment.