[affich_tools] Remaniement de dialog
This commit is contained in:
parent
22c3d4eb71
commit
5d11ca086b
2 changed files with 167 additions and 110 deletions
|
@ -53,19 +53,31 @@ isbureau = u'Bureau' in droits
|
|||
encoding = sys.stdin.encoding or 'UTF-8'
|
||||
|
||||
if u'Nounou' in droits:
|
||||
# Si on est nounou
|
||||
if os.path.exists(os.path.expanduser('~/.dialogrc')):
|
||||
dialogrc='~/.dialogrc'
|
||||
# Si on a un fichier de configuration du programme dialog dans son
|
||||
# HOME, alors on récupère son chemin.
|
||||
DIALOGRC = '~/.dialogrc'
|
||||
else:
|
||||
dialogrc='/etc/dialog.rc'
|
||||
dlg = dialog.Dialog(DIALOGRC=dialogrc)
|
||||
dialog_theme='DIALOGRC='+dialogrc
|
||||
# Sinon on utilise celui du système.
|
||||
DIALOGRC = '/etc/dialog.rc'
|
||||
|
||||
dlg = dialog.Dialog(DIALOGRC=DIALOGRC)
|
||||
else:
|
||||
# Si on est pas nounou, on est libre de faire ce que l'on veut avec la
|
||||
# variable d'environnement DIALOGRC.
|
||||
DIALOGRC = ''
|
||||
|
||||
dlg = dialog.Dialog()
|
||||
dialog_theme=''
|
||||
|
||||
|
||||
def dialog(arg):
|
||||
return affich_tools.dialog(u'Gestion des adhérents et machines du Crans', arg, dialog_theme)
|
||||
"""
|
||||
Raccourci permettant d'appeler :py:func:`affich_tools.dialog`.
|
||||
|
||||
.. seealso:: :py:func:`affich_tools.dialog`
|
||||
"""
|
||||
return affich_tools.dialog(u'Gestion des adhérents et machines du Crans', arg, DIALOGRC)
|
||||
|
||||
in_facture = None
|
||||
#########################################################################
|
||||
|
@ -92,7 +104,8 @@ def set_bases(adher):
|
|||
|
||||
# Affichage
|
||||
annul, result = dialog(arg)
|
||||
if annul: return 1
|
||||
if annul:
|
||||
return 1
|
||||
|
||||
# Traitement
|
||||
err = ''
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue