From 6020d212db76216ec93458addf9d7e1e09af04d4 Mon Sep 17 00:00:00 2001 From: pauget Date: Sun, 12 Sep 2004 01:14:55 +0200 Subject: [PATCH] Commentaire pour destruction obligatoire. Envoir bugreport que si l'option debug est absente darcs-hash:20040911231455-41617-0cd36d3ec9aa89e3ef996020ea7b8ae60ed8ec21.gz --- gestion/gest_crans.py | 44 ++++++++++++++++++++++++++++++------------- 1 file changed, 31 insertions(+), 13 deletions(-) diff --git a/gestion/gest_crans.py b/gestion/gest_crans.py index 13e4fde5..c3de512e 100755 --- a/gestion/gest_crans.py +++ b/gestion/gest_crans.py @@ -494,10 +494,16 @@ def del_adher(adher) : dialog(arg) return - arg = u'--title "Destruction adhérent %s " --colors ' % adher.Nom() - arg+= u'--inputbox "\Zr\Z1ATTENTION\Zn : la destruction est définitive\n\n%s.\n\nCommentaire à insérer ?" 0 0' % quoi - annul, res = dialog(arg) - if annul : return 1 + while 1 : + arg = u'--title "Destruction adhérent %s " --colors ' % adher.Nom() + arg+= u'--inputbox "\Zr\Z1ATTENTION\Zn : la destruction est définitive\n\n%s.\n\nCommentaire à insérer ?" 0 0' % quoi + annul, res = dialog(arg) + if annul : return 1 + if res[0] : break + arg = u'--title "Destruction adherent" ' + arg+= u'--msgbox "Le commentaire est obligatoire\n\n\n" 0 0' + dialog(arg) + adher.delete(res[0]) arg = u'--title "Destruction adhérent" ' @@ -799,10 +805,16 @@ def select_club(clas) : def del_club(club) : """ Destruction club """ quoi ='Toutes les machines associées à cet adhérent seront détruites' - arg = u'--title "Destruction club " --colors ' - arg+= u'--inputbox "\Zr\Z1ATTENTION\Zn : la destruction est définitive\n\nToutes les machines de ce club seront également détruites.\n\nCommentaire à insérer ?" 0 0' - annul, res = dialog(arg) - if annul : return 1 + while 1 : + arg = u'--title "Destruction club " --colors ' + arg+= u'--inputbox "\Zr\Z1ATTENTION\Zn : la destruction est définitive\n\nToutes les machines de ce club seront également détruites.\n\nCommentaire à insérer ?" 0 0' + annul, res = dialog(arg) + if annul : return 1 + if res[0] : break + arg = u'--title "Destruction club" ' + arg+= u'--msgbox "Le commentaire est obligatoire\n\n\n" 0 0' + dialog(arg) + club.delete(res[0]) arg = u'--title "Destruction club" ' arg+= u'--msgbox "Club détruit\n\n\n" 0 0' @@ -918,10 +930,16 @@ def del_machine(machine) : """ Destruction machine """ - arg = u'--title "Destruction machine %s" --colors ' % machine.nom() - arg+= u'--inputbox "\Zr\Z1ATTENTION\Zn : la destruction est définitive\nCommentaire à insérer ?" 0 0' - annul, res = dialog(arg) - if annul : return 1 + while 1 : + arg = u'--title "Destruction machine %s" --colors ' % machine.nom() + arg+= u'--inputbox "\Zr\Z1ATTENTION\Zn : la destruction est définitive\nCommentaire à insérer ?" 0 0' + annul, res = dialog(arg) + if annul : return 1 + if res[0] : break + arg = u'--title "Destruction machine" ' + arg+= u'--msgbox "Le commentaire est obligatoire\n\n\n" 0 0' + dialog(arg) + try : machine.delete(res[0]) except EnvironmentError, c : @@ -1574,7 +1592,7 @@ if __name__ == '__main__' : sys.stderr = sys.__stderr__ traceback = s.getvalue() try : - if To : + if not debug and To : # Paramètres pour le mail From = script_utilisateur + '@crans.org'