s/velib/jcvelaux

This commit is contained in:
Florent 2013-12-17 10:50:14 +01:00
commit 9db428ab3f
5 changed files with 12 additions and 11 deletions

View file

@ -18,7 +18,7 @@
# along with weboob. If not, see <http://www.gnu.org/licenses/>. # along with weboob. If not, see <http://www.gnu.org/licenses/>.
from .backend import VelibBackend from .backend import jcvelauxBackend
__all__ = ['VelibBackend'] __all__ = ['jcvelauxBackend']

View file

@ -26,17 +26,18 @@ from weboob.tools.value import Value
from .browser import VelibBrowser from .browser import VelibBrowser
__all__ = ['VelibBackend'] __all__ = ['jcvelauxBackend']
SENSOR_TYPES = {u'available_bike_stands': u'Free stands', SENSOR_TYPES = {u'available_bike_stands': u'Free stands',
u'available_bikes': u'Available bikes', u'available_bikes': u'Available bikes',
u'bike_stands': u'Total stands'} u'bike_stands': u'Total stands'}
CITIES = ("Paris", "Rouen", "Toulouse", "Luxembourg", "Valence", "Stockholm", CITIES = ("Paris", "Rouen", "Toulouse", "Luxembourg", "Valence", "Stockholm",
"Goteborg", "Santander", "Amiens", "Lillestrom", "Mulhouse", "Lyon", "Goteborg", "Santander", "Amiens", "Lillestrom", "Mulhouse", "Lyon",
"Ljubljana", "Seville", "Namur", "Nancy", "Creteil", "Bruxelles-Capitale", "Ljubljana", "Seville", "Namur", "Nancy", "Creteil", "Bruxelles-Capitale",
"Cergy-Pontoise", "Vilnius", "Toyama", "Kazan", "Marseille", "Nantes", "Cergy-Pontoise", "Vilnius", "Toyama", "Kazan", "Marseille", "Nantes",
"Besancon") "Besancon")
class BikeMeasure(GaugeMeasure): class BikeMeasure(GaugeMeasure):
@ -49,8 +50,8 @@ class BikeSensor(GaugeSensor):
latitude = StringField('Latitude of the sensor') latitude = StringField('Latitude of the sensor')
class VelibBackend(BaseBackend, ICapGauge): class jcvelauxBackend(BaseBackend, ICapGauge):
NAME = 'velib' NAME = 'jcvelaux'
DESCRIPTION = (u'City bike renting availability information.\nCities: %s' % DESCRIPTION = (u'City bike renting availability information.\nCities: %s' %
u', '.join(CITIES)) u', '.join(CITIES))
MAINTAINER = u'Herve Werner' MAINTAINER = u'Herve Werner'
@ -65,7 +66,7 @@ class VelibBackend(BaseBackend, ICapGauge):
choices=CITIES + ("ALL",))) choices=CITIES + ("ALL",)))
def __init__(self, *a, **kw): def __init__(self, *a, **kw):
super(VelibBackend, self).__init__(*a, **kw) super(jcvelauxBackend, self).__init__(*a, **kw)
self.cities = None self.cities = None
def _make_gauge(self, info): def _make_gauge(self, info):

View file

Before

Width:  |  Height:  |  Size: 2.1 KiB

After

Width:  |  Height:  |  Size: 2.1 KiB

Before After
Before After

View file

@ -21,7 +21,7 @@ from weboob.tools.test import BackendTest
class VelibTest(BackendTest): class VelibTest(BackendTest):
BACKEND = 'velib' BACKEND = 'jcvelaux'
def test_velib(self): def test_velib(self):
l = list(self.backend.iter_gauges()) l = list(self.backend.iter_gauges())