From de997de5804f8928fe64afced39e8e6a2f95a5d6 Mon Sep 17 00:00:00 2001 From: Dale Nguyen Date: Fri, 19 Jul 2019 11:01:53 -0400 Subject: [PATCH] Update function name --- README.md | 2 +- bustracker/__init__.py | 2 +- bustracker/base.py | 5 +---- bustracker/bus_tracker.py | 2 +- setup.py | 2 +- tests/test.py | 2 +- 6 files changed, 6 insertions(+), 9 deletions(-) diff --git a/README.md b/README.md index cd7bde9..15d8bfd 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ stops = [ {'routeTag': 506, 'stopTag': 3292} ] -predictions = bus.get_prediction(stops) +predictions = bus.get_predictions(stops) print(predictions) ``` diff --git a/bustracker/__init__.py b/bustracker/__init__.py index 2ddec88..79426e1 100644 --- a/bustracker/__init__.py +++ b/bustracker/__init__.py @@ -3,7 +3,7 @@ http://www.nextbus.com/xmlFeedDocs/NextBusXMLFeed.pdf """ -__version__ = '0.0.1' +__version__ = '0.0.2' __author__ = 'Dale Nguyen' __name__ = 'bustracker' diff --git a/bustracker/base.py b/bustracker/base.py index 4951523..08c806a 100644 --- a/bustracker/base.py +++ b/bustracker/base.py @@ -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 diff --git a/bustracker/bus_tracker.py b/bustracker/bus_tracker.py index 22eedbb..0bf915c 100644 --- a/bustracker/bus_tracker.py +++ b/bustracker/bus_tracker.py @@ -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: diff --git a/setup.py b/setup.py index 3b33898..0986675 100644 --- a/setup.py +++ b/setup.py @@ -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", diff --git a/tests/test.py b/tests/test.py index 5988a51..738ef4c 100644 --- a/tests/test.py +++ b/tests/test.py @@ -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__':