Skip to content

Commit

Permalink
Updated example in README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
vthorsteinsson committed Nov 19, 2019
1 parent 9e3b6cd commit 263e0ba
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,16 +33,21 @@ schedule = straeto.BusSchedule()
# Your route identifier here
route_id = "14"
# Print the next two arrivals of that route at the closest bus stop
for direction, times in schedule.arrivals(route_id, s.name, n=2).items():
print(
"Direction {0}: {1}"
.format(
direction,
", ".join(
"{0:02}:{1:02}".format(hms[0], hms[1]) for hms in times
arrivals, arrives = schedule.arrivals(route_id, s, n=2)
if not arrives:
# This stop is not in the schedule for this route
print("The bus does not stop at {0}".format(s.name))
else:
for direction, times in arrivals.items():
print(
"Direction {0}: {1}"
.format(
direction,
", ".join(
"{0:02}:{1:02}".format(hms[0], hms[1]) for hms in times
)
)
)
)
```

## Documentation
Expand Down

0 comments on commit 263e0ba

Please sign in to comment.