diff --git a/gestion/dialog/CPS.py b/gestion/dialog/CPS.py index 7d70c000..81c3e182 100644 --- a/gestion/dialog/CPS.py +++ b/gestion/dialog/CPS.py @@ -19,7 +19,7 @@ if '/usr/scripts' not in sys.path: from pythondialog import Dialog as PythonDialog from pythondialog import DialogTerminatedBySignal, PythonDialogErrorBeforeExecInChildProcess from pythondialog import error as DialogError -from gestion.affich_tools import get_screen_size, coul +from gestion import affichage debug_enable = False debugf = None @@ -230,7 +230,7 @@ class Dialog(object): """ Nyan nyan nyan nyan nyan nyan nyan nyan nyan nyan nyan nyan nyan nyan nyan nyan """ - (lines, cols) = get_screen_size() + (cols, lines) = affichage.getTerminalSize() print "\033[48;5;17m" print " "*(lines * cols) cols = int(min(cols/2, 65)) diff --git a/gestion/dialog/blacklist.py b/gestion/dialog/blacklist.py index 1f785a5d..a3db7af0 100644 --- a/gestion/dialog/blacklist.py +++ b/gestion/dialog/blacklist.py @@ -13,7 +13,7 @@ import traceback if '/usr/scripts' not in sys.path: sys.path.append('/usr/scripts') -from gestion.affich_tools import coul +from gestion import affichage import gestion.config as config import lc_ldap.objets as objets @@ -37,10 +37,14 @@ class Dialog(lc.Dialog): index = 0 for bl in obj['blacklist']: choices.append( - (str(index), - coul("%s [%s]" % (bl['type'], bl['comm']), 'rouge' if bl['actif'] else None, - dialog=True) - ) + ( + str(index), + affichage.style( + "%s [%s]" % (bl['type'], bl['comm']), + 'rouge' if bl['actif'] else None, + dialog=True + ) + ) ) index+=1 return self.dialog.menu( diff --git a/gestion/dialog/lc.py b/gestion/dialog/lc.py index da36b86f..035651cf 100644 --- a/gestion/dialog/lc.py +++ b/gestion/dialog/lc.py @@ -17,7 +17,7 @@ if '/usr/scripts' not in sys.path: from pythondialog import Dialog from pythondialog import error as DialogError -from gestion.affich_tools import get_screen_size, coul +from gestion import affichage import lc_ldap.shortcuts import lc_ldap.objets as objets @@ -347,7 +347,7 @@ class Dialog(CPS.Dialog): # pour prendre en compte la largeur du widget dialog del items[:] # On vide la liste pour la modifier en place items_id = {} - (line, col) = get_screen_size() + (col, line) = affichage.getTerminalSize() for c in classes: items.extend(olist[c]) items_s = printing.sprint_list(olist[c], col-20).encode('utf-8').split('\n')