Ajout des V³ électriques
This commit is contained in:
parent
58447d04fc
commit
dd627a1172
5
vcub.py
5
vcub.py
|
@ -21,6 +21,7 @@ class Vcub ():
|
||||||
'typeVlsPlus': 'VLS_PLUS' si V³+ 'PAS_VLS_PLUS' sinon,
|
'typeVlsPlus': 'VLS_PLUS' si V³+ 'PAS_VLS_PLUS' sinon,
|
||||||
'nbPlaceAvailable': 33,
|
'nbPlaceAvailable': 33,
|
||||||
'nbBikeAvailable': 0
|
'nbBikeAvailable': 0
|
||||||
|
'nbElectricBikeAvailable': 6
|
||||||
'latitude': float,
|
'latitude': float,
|
||||||
'longitude': float,
|
'longitude': float,
|
||||||
},
|
},
|
||||||
|
@ -50,6 +51,7 @@ class Vcub ():
|
||||||
'plus': i ['typeVlsPlus'] == 'VLS_PLUS',
|
'plus': i ['typeVlsPlus'] == 'VLS_PLUS',
|
||||||
'empty': int (i ['nbPlaceAvailable']),
|
'empty': int (i ['nbPlaceAvailable']),
|
||||||
'bikes': int (i ['nbBikeAvailable']),
|
'bikes': int (i ['nbBikeAvailable']),
|
||||||
|
'ebikes': int (i ['nbElectricBikeAvailable']),
|
||||||
'location': (float (i ['latitude']), float (i ['longitude']))
|
'location': (float (i ['latitude']), float (i ['longitude']))
|
||||||
}
|
}
|
||||||
self.data [int (i ['id'])] = e
|
self.data [int (i ['id'])] = e
|
||||||
|
@ -95,6 +97,7 @@ class Vcub ():
|
||||||
self.online = self.data ['online']
|
self.online = self.data ['online']
|
||||||
self.isplus = self.data ['plus']
|
self.isplus = self.data ['plus']
|
||||||
self.bikes = self.data ['bikes']
|
self.bikes = self.data ['bikes']
|
||||||
|
self.ebikes = self.data ['ebikes']
|
||||||
self.empty = self.data ['empty']
|
self.empty = self.data ['empty']
|
||||||
|
|
||||||
def __int__ (self):
|
def __int__ (self):
|
||||||
|
@ -106,4 +109,4 @@ class Vcub ():
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
v = Vcub ()
|
v = Vcub ()
|
||||||
for i in (v.get_by_id (149), v.get_by_id (v.get_names ()['Buttiniere']), v.get_by_id (v.get_locations () [(44.8875, -0.51763)])):
|
for i in (v.get_by_id (149), v.get_by_id (v.get_names ()['Buttiniere']), v.get_by_id (v.get_locations () [(44.8875, -0.51763)])):
|
||||||
print ('%s (%d) (%f, %f)%s%s\n\tbikes: %d\n\tfree: %d\n\t' % (i.name, i, i.location [0], i.location [1], i.isplus and ' (VCUB+)' or '', i.online and ' ' or ' OFFLINE', i.bikes, i.empty))
|
print ('%s (%d) (%f, %f)%s%s\n\tbikes: %d\n\te-bikes: %d\n\tfree: %d\n\t' % (i.name, i, i.location [0], i.location [1], i.isplus and ' (VCUB+)' or '', i.online and ' ' or ' OFFLINE', i.bikes, i.ebikes, i.empty))
|
Loading…
Reference in New Issue