From dd627a1172ea91bd83db2004061089fac7248d0a Mon Sep 17 00:00:00 2001 From: Sasha MOREL Date: Wed, 9 Jun 2021 07:02:35 +0200 Subject: [PATCH] =?UTF-8?q?Ajout=20des=20V=C2=B3=20=C3=A9lectriques?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- vcub.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/vcub.py b/vcub.py index 327b7fe..7bea1c9 100644 --- a/vcub.py +++ b/vcub.py @@ -21,6 +21,7 @@ class Vcub (): 'typeVlsPlus': 'VLS_PLUS' si V³+ 'PAS_VLS_PLUS' sinon, 'nbPlaceAvailable': 33, 'nbBikeAvailable': 0 + 'nbElectricBikeAvailable': 6 'latitude': float, 'longitude': float, }, @@ -50,6 +51,7 @@ class Vcub (): 'plus': i ['typeVlsPlus'] == 'VLS_PLUS', 'empty': int (i ['nbPlaceAvailable']), 'bikes': int (i ['nbBikeAvailable']), + 'ebikes': int (i ['nbElectricBikeAvailable']), 'location': (float (i ['latitude']), float (i ['longitude'])) } self.data [int (i ['id'])] = e @@ -95,6 +97,7 @@ class Vcub (): self.online = self.data ['online'] self.isplus = self.data ['plus'] self.bikes = self.data ['bikes'] + self.ebikes = self.data ['ebikes'] self.empty = self.data ['empty'] def __int__ (self): @@ -106,4 +109,4 @@ class Vcub (): if __name__ == '__main__': 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)])): - 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)) \ 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)) \ No newline at end of file