affich_tools est déprécié, utilise affichage

This commit is contained in:
Pierre-Elliott Bécue 2015-11-23 23:55:49 +01:00
parent 46b5aca99f
commit b9bd5ab1fc
3 changed files with 13 additions and 9 deletions

View file

@ -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))

View file

@ -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,9 +37,13 @@ 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

View file

@ -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')