Skip to content

Commit

Permalink
Merge pull request #23 from athuler/0.2.2
Browse files Browse the repository at this point in the history
Fixed Getting Systems Bug
  • Loading branch information
athuler authored Sep 10, 2024
2 parents 49dc2e7 + e32e174 commit ea6e420
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 22 deletions.
43 changes: 22 additions & 21 deletions passiogo/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -429,27 +429,28 @@ def getSystems(
for parameter in system.keys():
if system[parameter] == '':
system[parameter] = None
try:
allSystems.append(TransportationSystem(
id = int(system["id"]),
name = system["fullname"],
username = system["username"],
goAgencyName = system["goAgencyName"],
email = system["email"],
goTestMode = bool(int(system["goTestMode"])),
name2 = bool(int(system["name2"])),
homepage = system["homepage"],
logo = bool(int(system["logo"])),
goRoutePlannerEnabled = bool(int(system["goRoutePlannerEnabled"])),
goColor = system["goColor"],
goSupportEmail = system["goSupportEmail"],
goSharedCode = toIntInclNone(system["goSharedCode"]),
goAuthenticationType = bool(int(system["goAuthenticationType"])),
))
except Exception as e:
print(e)
print(system)
return()

# Check all keys exist
for key in ["goAgencyName", "email", "email", "goTestMode", "name2", "homepage", "logo", "goRoutePlannerEnabled", "goColor", "goSupportEmail", "goSharedCode", "goAuthenticationType"]:
if key not in system.keys():
system[key] = None

allSystems.append(TransportationSystem(
id = int(system["id"]),
name = system["fullname"],
username = system["username"],
goAgencyName = system["goAgencyName"],
email = system["email"],
goTestMode = bool(int(system["goTestMode"])),
name2 = bool(int(system["name2"])),
homepage = system["homepage"],
logo = bool(int(system["logo"])),
goRoutePlannerEnabled = bool(int(system["goRoutePlannerEnabled"])),
goColor = system["goColor"],
goSupportEmail = system["goSupportEmail"],
goSharedCode = toIntInclNone(system["goSharedCode"]),
goAuthenticationType = bool(int(system["goAuthenticationType"])),
))


return(allSystems)
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.1",
version="0.2.2",
description="An unofficial API for Passio Go",
long_description=long_description,
long_description_content_type='text/markdown',
Expand Down

0 comments on commit ea6e420

Please sign in to comment.