diff --git a/gestion/tools/locate-wifi.py b/gestion/tools/locate-wifi.py index 510e6f85..8ca47b8a 100755 --- a/gestion/tools/locate-wifi.py +++ b/gestion/tools/locate-wifi.py @@ -34,6 +34,9 @@ def done (mac) : mac_done.append(mac) return False +# liste des résultats +results = [] + # classe d'interrogation des bornes class interroge_borne (threading.Thread) : def __init__ (self, db, borne, mac = None) : @@ -60,7 +63,8 @@ class interroge_borne (threading.Thread) : coul_rssi = 'jaune' else: coul_rssi = 'rouge' - print '%-10s %-30s (%-15s, RSSI: %s)' % (self.borne.nom().split('.')[0], res[0].proprietaire().Nom(), res[0].nom().split('.')[0],coul("%d" % rssi, coul_rssi)) + global results + results.append('%-10s %-30s (%-15s, RSSI: %s)' % (self.borne.nom().split('.')[0], res[0].proprietaire().Nom(), res[0].nom().split('.')[0],coul("%d" % rssi, coul_rssi))) def run (self) : nom = self.borne.nom() @@ -82,3 +86,6 @@ for i in range(0,3) : # on attend la fin de threads while len(threading.enumerate()) > 1 : sleep(1) + +results.sort() +print '\n'.join(results)