[dialog] Filtrage de plus d'erreurs dialog
This commit is contained in:
parent
08f4d259b7
commit
83512121a2
2 changed files with 17 additions and 5 deletions
|
@ -17,7 +17,8 @@ import traceback
|
|||
if '/usr/scripts' not in sys.path:
|
||||
sys.path.append('/usr/scripts')
|
||||
from pythondialog import Dialog as PythonDialog
|
||||
from pythondialog import DialogError, DialogTerminatedBySignal
|
||||
from pythondialog import DialogTerminatedBySignal, PythonDialogErrorBeforeExecInChildProcess
|
||||
from pythondialog import error as DialogError
|
||||
from gestion.affich_tools import get_screen_size, coul
|
||||
|
||||
debug_enable = False
|
||||
|
@ -261,6 +262,18 @@ class Dialog(object):
|
|||
raise Continue(cancel_cont)
|
||||
else:
|
||||
raise
|
||||
except PythonDialogErrorBeforeExecInChildProcess:
|
||||
self.dialog.msgbox(
|
||||
"La fenêtre dialog à été fermée et a retourné le code 127 : \n" +\
|
||||
" * peut être que dialog n'a put être éxécuté\n" +\
|
||||
" * peut être qu'il n'y a plus de mémoire disponible\n" +\
|
||||
" * peut être que le nombre max de descripteur de fichier a été atteins\n" +\
|
||||
"ou peut être que dialog fait juste du caca.\n" +\
|
||||
"Quitter l'interface ?",
|
||||
title="Erreur rencontrée", width=73, height=12, defaultno=True,
|
||||
timeout=self.timeout
|
||||
)
|
||||
raise Continue(cancel_cont)
|
||||
finally:
|
||||
if ret:
|
||||
return ret
|
||||
|
@ -391,7 +404,7 @@ class Dialog(object):
|
|||
(hour, minute, second) = get_time(hour, minute, second, day, month, year)
|
||||
return (year, month, day) + (hour, minute, second)
|
||||
|
||||
def confirm(self, text, title, defaultno=False):
|
||||
def confirm(self, text, title, defaultno=False, width=0, height=0):
|
||||
"""wrapper autour du widget yesno"""
|
||||
return self.dialog.yesno(
|
||||
text,
|
||||
|
@ -401,7 +414,7 @@ class Dialog(object):
|
|||
timeout=self.timeout,
|
||||
title=title,
|
||||
defaultno=defaultno,
|
||||
width=0, height=0,
|
||||
width=width, height=height,
|
||||
backtitle="Appuyez sur MAJ pour selectionner du texte"
|
||||
) == self.dialog.DIALOG_OK
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ import traceback
|
|||
if '/usr/scripts' not in sys.path:
|
||||
sys.path.append('/usr/scripts')
|
||||
from pythondialog import Dialog
|
||||
from pythondialog import DialogError, DialogTerminatedBySignal
|
||||
from pythondialog import error as DialogError
|
||||
|
||||
from gestion.affich_tools import get_screen_size, coul
|
||||
|
||||
|
@ -25,7 +25,6 @@ import lc_ldap.printing as printing
|
|||
import CPS
|
||||
from CPS import TailCall, tailcaller, Continue, TailCaller
|
||||
|
||||
|
||||
class Dialog(CPS.Dialog):
|
||||
def __init__(self, debug_enable=False, ldap_test=False, custom_user=None):
|
||||
super(Dialog, self).__init__(debug_enable=debug_enable)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue