[numeros_disponibles.py] Barre de progression aussi
Je m'ennuyais un peu pendant la perm darcs-hash:20111116125635-ddb99-fe59a709ae45fb9deebc2a9b55cfb40a35e1b55c.gz
This commit is contained in:
parent
af7894e07e
commit
74fab55081
1 changed files with 11 additions and 0 deletions
|
@ -11,6 +11,10 @@ Licence : GPLv2
|
|||
|
||||
from config import NETs
|
||||
from iptools import AddrInNet
|
||||
try:
|
||||
from dialog import Dialog
|
||||
except:
|
||||
pass
|
||||
|
||||
repertoire = '/usr/scripts/var/numeros_disponibles/'
|
||||
|
||||
|
@ -75,6 +79,13 @@ def update_ip_wifi_adh(occupees):
|
|||
update_ip('wifi-adh','ip_wifi-adh', occupees)
|
||||
|
||||
if __name__ == "__main__":
|
||||
dlg = Dialog()
|
||||
dlg.gauge_start(text="Recherche des machines...", backtitle="numeros_disponibles")
|
||||
ip_occupees = lister_ip_utilisees()
|
||||
done = 1
|
||||
for net in NETs.keys():
|
||||
dlg.gauge_update(int(done*100/(len(NETs)+1)), text="IP libres dans %s" % net, update_text=True)
|
||||
update_ip(net, ip_occupees)
|
||||
done += 1
|
||||
dlg.gauge_update(100, text="Fini !", update_text=True)
|
||||
dlg.gauge_stop()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue