diff --git a/vcub.py b/vcub.py index c30dee1..9d814e9 100644 --- a/vcub.py +++ b/vcub.py @@ -111,6 +111,9 @@ class Vcub (): return (self.id) return (Station (self.data [id], id)) + + def get_all_ids (self): + return (tuple (self.data.keys ())) if __name__ == '__main__': @@ -119,4 +122,5 @@ if __name__ == '__main__': 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)) v = Vcub (data = get_data_from_json (vcub_url)) 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)) \ No newline at end of file + 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 ()) \ No newline at end of file