[gestion/ressuscite.py] Rollback d'un vieux commit

Le commit de quand certaines lignes avaient ete commentees n'aurait jamais du
etre fait ...

darcs-hash:20091202020924-ddb99-7e801d3fec047de71a952623239e91a8b94dd9cd.gz
This commit is contained in:
Michel Blockelet 2009-12-02 03:09:24 +01:00
parent 0ae1a92a41
commit 8e0eafdeb2

View file

@ -221,10 +221,10 @@ def choixadherent(machine, oldadh=None):
# Est-ce que l'adhérent existe encore ? # Est-ce que l'adhérent existe encore ?
if (len(oldadhl) > 0 and str(machine.proprio) == "%s %s" if (len(oldadhl) > 0 and str(machine.proprio) == "%s %s"
% (oldadhl[0].prenom(), oldadhl[0].nom())): % (oldadhl[0].prenom(), oldadhl[0].nom())):
# annul, choix = dlg.menu(u"Le propriétaire de la machine est %s" % machine.proprio, annul, choix = dlg.menu(u"Le propriétaire de la machine est %s" % machine.proprio,
# choices=[("Garder",u"Ajouter à cet adhérent"), choices=[("Garder",u"Ajouter à cet adhérent"),
# ("Autre",u"Ajouter à un autre adhérent")], ("Autre",u"Ajouter à un autre adhérent")],
# title=u"Adhérent auquel rattacher la machine") title=u"Adhérent auquel rattacher la machine")
annul = False annul = False
choix = "Garder" choix = "Garder"
else: else:
@ -299,21 +299,17 @@ def ressuscite(adh, oldmachine):
# Certaines fois, on peut vouloir transformer une machine Fixe en Wifi, # Certaines fois, on peut vouloir transformer une machine Fixe en Wifi,
# et inversement (erreurs d'ajout ...) # et inversement (erreurs d'ajout ...)
# annul, choix = dlg.menu(strmachine, annul, choix = dlg.menu(strmachine,
# choices=[("Fixe",u"Ressusciter en tant que machine Fixe"), choices=[("Fixe",u"Ressusciter en tant que machine Fixe"),
# ("Wifi",u"Ressusciter en tant que machine Wifi")], ("Wifi",u"Ressusciter en tant que machine Wifi")],
# default_item=strdef, default_item=strdef,
# title=u"Nouveau type de machine") title=u"Nouveau type de machine")
#
# if annul: return False if annul: return False
#
# if choix == 'Fixe': if choix == 'Fixe':
# machine = MachineFixe(adh)
# elif choix == 'Wifi':
# machine = MachineWifi(adh)
if strdef == 'Fixe':
machine = MachineFixe(adh) machine = MachineFixe(adh)
elif strdef == 'Wifi': elif choix == 'Wifi':
machine = MachineWifi(adh) machine = MachineWifi(adh)
@ -355,9 +351,7 @@ def ressuscite(adh, oldmachine):
# Des erreurs ? # Des erreurs ?
if err: if err:
dlg.msgbox(text=u"%s" % err,title=u"Paramètres machine") dlg.msgbox(text=u"%s" % err,title=u"Paramètres machine")
# set_machine(machine) set_machine(machine)
machine.save()
return True return True
@ -439,11 +433,11 @@ if __name__ == '__main__':
os.system("clear") os.system("clear")
else: else:
for path in sys.argv[1:]: for path in sys.argv[1:]:
# try: try:
fichier = open(path, 'r') fichier = open(path, 'r')
machine = cPickle.load(fichier) machine = cPickle.load(fichier)
adh = choixadherent(machine) adh = choixadherent(machine)
if adh: if adh:
ressuscite(adh, machine) ressuscite(adh, machine)
# except: except:
# print "Fichier invalide : %s" % fichier print "Fichier invalide : %s" % fichier