pax_global_header 0000666 0000000 0000000 00000000064 14575653726 0014536 g ustar 00root root 0000000 0000000 52 comment=5f3d558793b537a74480241ac6981479f5938cd3
woob-master-5f3d558793b537a74480241ac6981479f5938cd3-modules-transilien/ 0000775 0000000 0000000 00000000000 14575653726 0024212 5 ustar 00root root 0000000 0000000 woob-master-5f3d558793b537a74480241ac6981479f5938cd3-modules-transilien/modules/ 0000775 0000000 0000000 00000000000 14575653726 0025662 5 ustar 00root root 0000000 0000000 woob-master-5f3d558793b537a74480241ac6981479f5938cd3-modules-transilien/modules/transilien/ 0000775 0000000 0000000 00000000000 14575653726 0030032 5 ustar 00root root 0000000 0000000 __init__.py 0000664 0000000 0000000 00000001532 14575653726 0032065 0 ustar 00root root 0000000 0000000 woob-master-5f3d558793b537a74480241ac6981479f5938cd3-modules-transilien/modules/transilien # -*- coding: utf-8 -*-
# Copyright(C) 2010-2011 Julien Hébert, Romain Bignon
#
# This file is part of a woob module.
#
# This woob module is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This woob module is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this woob module. If not, see .
from .module import TransilienModule
__all__ = ['TransilienModule']
browser.py 0000664 0000000 0000000 00000006100 14575653726 0032005 0 ustar 00root root 0000000 0000000 woob-master-5f3d558793b537a74480241ac6981479f5938cd3-modules-transilien/modules/transilien # -*- coding: utf-8 -*-
# Copyright(C) 2010-2011 Julien Hébert, Romain Bignon
# Copyright(C) 2014 Benjamin Carton
#
# This file is part of a woob module.
#
# This woob module is free software: you can redistribute it and/or modify
# it under the terms of the GNU Affero General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# This woob module is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU Affero General Public License for more details.
#
# You should have received a copy of the GNU Affero General Public License
# along with this woob module. If not, see .
from datetime import datetime
from woob.browser import PagesBrowser, URL
from .pages import StationsPage, DeparturesPage, DeparturesPage2, HorairesPage, RoadMapPage
class Transilien(PagesBrowser):
BASEURL = 'http://www.transilien.com'
TIMEOUT = 20
stations_page = URL('aidesaisie/autocompletion\?saisie=(?P.*)', StationsPage)
departures_page = URL('gare/pagegare/chargerGare\?nomGare=(?P.*)',
'gare/.*', DeparturesPage)
departures_page2 = URL('fichehoraire/fichehoraire/(?P.*)',
'fichehoraire/fichehoraire/.*', DeparturesPage2)
horaires_page = URL('fiche-horaire/(?P.*)--(?P.*)-(?P.*)-(?P)-(?P)',
'fiche-horaire/.*', HorairesPage)
roadmap_page = URL('itineraire/trajet', RoadMapPage)
def get_roadmap(self, departure, arrival, filters):
dep = next(self.get_stations(departure, False))
arr = next(self.get_stations(arrival, False))
self.roadmap_page.go().request_roadmap(dep, arr, filters.departure_time, filters.arrival_time)
if self.page.is_ambiguous():
self.page.fix_ambiguity()
return self.page.get_roadmap()
def get_stations(self, pattern, only_station=True):
return self.stations_page.go(pattern=pattern).get_stations(only_station=only_station)
def get_station_departues(self, station, arrival_id, date):
if arrival_id is not None:
arrival_name = arrival_id.replace('-', ' ')
self.departures_page2.go(url='init').init_departure(station)
arrival = self.page.get_potential_arrivals().get(arrival_name)
if arrival:
station_id = self.page.get_station_id()
if date is None:
date = datetime.now()
_date = datetime.strftime(date, "%d/%m/%Y-%H:%M")
self.horaires_page.go(station=station.replace(' ', '-'), arrival=arrival_id, station2=station_id,
arrival2=arrival, date=_date)
return self.page.get_departures(station, arrival_name, date)
return []
else:
return self.departures_page.go(station=station).get_departures(station=station)
favicon.png 0000664 0000000 0000000 00000002721 14575653726 0032110 0 ustar 00root root 0000000 0000000 woob-master-5f3d558793b537a74480241ac6981479f5938cd3-modules-transilien/modules/transilien PNG
IHDR @ @ iq sRGB pHYs tIME#_0 cIDATx_h[U?7MMG\D1pn3PPE18&T}ȋ:
({_3Y>8ahjmkCmiܤM89ɽs;{~^"X oTvGzɬE{hWqh X0MB>h" Oeas-K@29Odp08$ +6MUP%+Ev(`S2e6 &qh_{'n
Ο4+/uo74 8 zbxdCLf*w.'j4~AA