Listage des ids de toutes les stations
This commit is contained in:
parent
c80eeac919
commit
dd82e9afe9
4
vcub.py
4
vcub.py
|
@ -112,6 +112,9 @@ class Vcub ():
|
||||||
|
|
||||||
return (Station (self.data [id], id))
|
return (Station (self.data [id], id))
|
||||||
|
|
||||||
|
def get_all_ids (self):
|
||||||
|
return (tuple (self.data.keys ()))
|
||||||
|
|
||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
v = Vcub ()
|
v = Vcub ()
|
||||||
|
@ -120,3 +123,4 @@ if __name__ == '__main__':
|
||||||
v = Vcub (data = get_data_from_json (vcub_url))
|
v = Vcub (data = get_data_from_json (vcub_url))
|
||||||
for i in (v.get_by_id (v.get_locations () [(44.8875, -0.51763)]), ):
|
for i in (v.get_by_id (v.get_locations () [(44.8875, -0.51763)]), ):
|
||||||
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))
|
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))
|
||||||
|
print ('stations :', v.get_all_ids ())
|
Loading…
Reference in New Issue