add parameter 'date' to ICapTravel.iter_station_departures
This commit is contained in:
parent
13fdcdc8c2
commit
c36cfdc811
3 changed files with 5 additions and 3 deletions
|
|
@ -39,7 +39,7 @@ class CanalTPBackend(BaseBackend, ICapTravel):
|
|||
for _id, name in self.browser.iter_station_search(pattern):
|
||||
yield Station(_id, name)
|
||||
|
||||
def iter_station_departures(self, station_id, arrival_id=None):
|
||||
def iter_station_departures(self, station_id, arrival_id=None, date=None):
|
||||
for i, d in enumerate(self.browser.iter_station_departures(station_id, arrival_id)):
|
||||
departure = Departure(i, d['type'], d['time'])
|
||||
departure.departure_station = d['departure']
|
||||
|
|
|
|||
|
|
@ -42,7 +42,7 @@ class TransilienBackend(BaseBackend, ICapTravel):
|
|||
if name.lower().find(pattern) >= 0:
|
||||
yield Station(_id, name)
|
||||
|
||||
def iter_station_departures(self, station_id, arrival_id=None):
|
||||
def iter_station_departures(self, station_id, arrival_id=None, date=None):
|
||||
with self.browser:
|
||||
for i, d in enumerate(self.browser.iter_station_departures(station_id, arrival_id)):
|
||||
departure = Departure(i, d['type'], d['time'])
|
||||
|
|
|
|||
|
|
@ -107,7 +107,7 @@ class ICapTravel(IBaseCap):
|
|||
"""
|
||||
raise NotImplementedError()
|
||||
|
||||
def iter_station_departures(self, station_id, arrival_id=None):
|
||||
def iter_station_departures(self, station_id, arrival_id=None, date=None):
|
||||
"""
|
||||
Iterate on departures.
|
||||
|
||||
|
|
@ -115,6 +115,8 @@ class ICapTravel(IBaseCap):
|
|||
:type station_id: str
|
||||
:param arrival_id: optionnal arrival station ID
|
||||
:type arrival_id: str
|
||||
:param date: optional date
|
||||
:type date: datetime.datetime
|
||||
:rtype: iter[:class:`Departure`]
|
||||
"""
|
||||
raise NotImplementedError()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue