diff --git a/gestion/ressuscite.py b/gestion/ressuscite.py index cc8e26ef..1ef62f91 100644 --- a/gestion/ressuscite.py +++ b/gestion/ressuscite.py @@ -192,7 +192,8 @@ def choixrecherche(condition=None): if annul: return None # On cherche les machines - machines = recherche(choix == 'Fixe' or choix == 'Tous', + machines = recherche(dlg, + choix == 'Fixe' or choix == 'Tous', choix == 'Wifi' or choix == 'Tous', condition) @@ -204,7 +205,7 @@ def choixrecherche(condition=None): return choixmachine(machines) -def recherche(fixe=False, wifi=False, condition=None): +def recherche(dlg, fixe=False, wifi=False, condition=None): """Recherche des machines du type demandĂ©, et satisfaisant une condition : la fonction condition doit ĂȘtre de la forme condition(machine, date) @@ -219,6 +220,8 @@ def recherche(fixe=False, wifi=False, condition=None): # On regarde chacun des fichiers valid = [] + done = 0 + dlg.gauge_start(text="Recherche en cours...") for fichier in cimetiere: try: machine = cPickle.load(open(fichier, 'r')) @@ -227,6 +230,9 @@ def recherche(fixe=False, wifi=False, condition=None): valid.append((machine, date)) except: pass + done += 1 + dlg.gauge_update(int(done*100/len(cimetiere))) + dlg.gauge_stop() return valid