From 12a004ad3bcc2150dca5ae45c963161e7eedc25c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20P=C3=A9rez-Cerezo?= Date: Thu, 11 Oct 2018 16:22:31 +0200 Subject: [PATCH 1/3] Fix Issue #11 from github --- bvggrabber/api/actualdeparture.py | 3 ++- bvggrabber/api/scheduleddeparture.py | 3 ++- setup.py | 4 ++-- 3 files changed, 6 insertions(+), 4 deletions(-) diff --git a/bvggrabber/api/actualdeparture.py b/bvggrabber/api/actualdeparture.py index e7c084b..00b6d1d 100644 --- a/bvggrabber/api/actualdeparture.py +++ b/bvggrabber/api/actualdeparture.py @@ -51,12 +51,13 @@ def call(self): departures = [] for row in rows: if row.parent.name == 'tbody': + stro = row.find_all("strong") td = row.find_all('td') if td: dep = Departure(start=self.station, end=td[2].text.strip(), when=td[0].text.strip(), - line=td[1].text.strip()) + line=stro[1].text.strip()) departures.append(dep) return Response(True, self.station, departures) else: diff --git a/bvggrabber/api/scheduleddeparture.py b/bvggrabber/api/scheduleddeparture.py index f316b6e..101f692 100644 --- a/bvggrabber/api/scheduleddeparture.py +++ b/bvggrabber/api/scheduleddeparture.py @@ -70,10 +70,11 @@ def call(self): departures = [] for row in rows: tds = row.find_all('td') + stro = row.find_all('strong') dep = Departure(start=self.station, end=tds[2].text.strip(), when=tds[0].text.strip(), - line=tds[1].text.strip()) + line=stro[1].text.strip()) departures.append(dep) return Response(True, self.station, departures) else: diff --git a/setup.py b/setup.py index 8661e64..4b73677 100755 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ name='bvg-grabber', description='Querying the upcoming public transport departures in Berlin', long_description=description, - version='0.1.1', + version='0.1.2', url='https://github.com/MarkusH/bvg-grabber', author='Christian Struck, Markus Holtermann', author_email='info@markusholtermann.eu', @@ -27,7 +27,7 @@ 'requests>=1.2.3', 'six>=1.3.0', ], - test_suite="tests", +# test_suite="tests", scripts=['bvg-grabber.py'], classifiers=[ 'Development Status :: 4 - Beta', From 9a9369e0c135bd8e984ede19030f037338c27dd4 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20P=C3=A9rez-Cerezo?= Date: Wed, 28 Nov 2018 12:10:00 +0100 Subject: [PATCH 2/3] Fixed program after bvg changed their website --- bvggrabber/api/actualdeparture.py | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bvggrabber/api/actualdeparture.py b/bvggrabber/api/actualdeparture.py index 00b6d1d..c4b5977 100644 --- a/bvggrabber/api/actualdeparture.py +++ b/bvggrabber/api/actualdeparture.py @@ -57,7 +57,7 @@ def call(self): dep = Departure(start=self.station, end=td[2].text.strip(), when=td[0].text.strip(), - line=stro[1].text.strip()) + line=stro[0].text.strip()) departures.append(dep) return Response(True, self.station, departures) else: diff --git a/setup.py b/setup.py index 4b73677..9120a66 100755 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ name='bvg-grabber', description='Querying the upcoming public transport departures in Berlin', long_description=description, - version='0.1.2', + version='0.1.3', url='https://github.com/MarkusH/bvg-grabber', author='Christian Struck, Markus Holtermann', author_email='info@markusholtermann.eu', From 7e74926bd8e2da4fdcdcc7ff5ca5adfc3c0c7083 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Gabriel=20P=C3=A9rez-Cerezo?= Date: Tue, 11 Dec 2018 13:10:20 +0100 Subject: [PATCH 3/3] Same error also occurred in scheduleddeparture.py Bumped version number to 0.1.4 --- bvggrabber/api/scheduleddeparture.py | 2 +- setup.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bvggrabber/api/scheduleddeparture.py b/bvggrabber/api/scheduleddeparture.py index 101f692..69defcf 100644 --- a/bvggrabber/api/scheduleddeparture.py +++ b/bvggrabber/api/scheduleddeparture.py @@ -74,7 +74,7 @@ def call(self): dep = Departure(start=self.station, end=tds[2].text.strip(), when=tds[0].text.strip(), - line=stro[1].text.strip()) + line=stro[0].text.strip()) departures.append(dep) return Response(True, self.station, departures) else: diff --git a/setup.py b/setup.py index 9120a66..98864cf 100755 --- a/setup.py +++ b/setup.py @@ -14,7 +14,7 @@ name='bvg-grabber', description='Querying the upcoming public transport departures in Berlin', long_description=description, - version='0.1.3', + version='0.1.4', url='https://github.com/MarkusH/bvg-grabber', author='Christian Struck, Markus Holtermann', author_email='info@markusholtermann.eu',