Skip to content

Commit

Permalink
Update function name
Browse files Browse the repository at this point in the history
  • Loading branch information
Dale Nguyen committed Jul 19, 2019
1 parent 8c8fa9b commit de997de
Show file tree
Hide file tree
Showing 6 changed files with 6 additions and 9 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ stops = [
{'routeTag': 506, 'stopTag': 3292}
]

predictions = bus.get_prediction(stops)
predictions = bus.get_predictions(stops)

print(predictions)
```
Expand Down
2 changes: 1 addition & 1 deletion bustracker/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
http://www.nextbus.com/xmlFeedDocs/NextBusXMLFeed.pdf
"""

__version__ = '0.0.1'
__version__ = '0.0.2'
__author__ = 'Dale Nguyen'
__name__ = 'bustracker'

Expand Down
5 changes: 1 addition & 4 deletions bustracker/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,11 @@ def _prepare_request(self, stops):
for stop in stops:
stopsParams += '&stops=' + str(stop['routeTag']) + '|' + str(stop['stopTag'])


print(stopsParams)
url = 'http://webservices.nextbus.com/service/publicJSONFeed?command=predictionsForMultiStops&a={agency}&{stops}'.format(
agency = self.agency,
stops = stopsParams
)

print(url)
)

return url

Expand Down
2 changes: 1 addition & 1 deletion bustracker/bus_tracker.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ class BusTracker(Base):
def __init__(self, agency):
super(BusTracker, self).__init__(agency)

def get_prediction(self, stops):
def get_predictions(self, stops):
if (isinstance(stops, list) and len(stops) > 0):
return self._request(stops)
else:
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@

setuptools.setup(
name="bustracker",
version="0.0.1",
version="0.0.2",
author="Dale Nguyen",
author_email="dungnq@itbox4vn.com",
description="Get bus predictions from NextBus",
Expand Down
2 changes: 1 addition & 1 deletion tests/test.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ def test_predictions(self):
{'routeTag': 83, 'stopTag': 7871}
]

predictions = self.ttc.get_prediction(stops)
predictions = self.ttc.get_predictions(stops)
self.assertTrue(isinstance(predictions, dict))

if __name__ == '__main__':
Expand Down

0 comments on commit de997de

Please sign in to comment.