diff --git a/printing/templates/templates.py b/printing/templates/templates.py index bce7891..9f8e6a7 100644 --- a/printing/templates/templates.py +++ b/printing/templates/templates.py @@ -121,10 +121,19 @@ def machine(machine, params): def list_machines(machines, width=None): - return tableau([ - [m['mid'][0], m['rid'][0] , str(m['objectClass'][0])[7:], str(m['host'][0]).split('.')[0], - m['ipHostNumber'][0] if m.get('ipHostNumber',[]) else '-', m['macAddress'][0], - m.blacklist_actif()[0] if m.blacklist_actif() else '-'] for m in machines], + data = [ + [ + m['mid'][0], + m['rid'][0] if m['rid'] else '-', + str(m['objectClass'][0])[7:], + str(m['host'][0]).split('.')[0], + m['ipHostNumber'][0] if m.get('ipHostNumber',[]) else '-', + m['macAddress'][0], + m.blacklist_actif()[0] if m.blacklist_actif() else '-', + ] + for m in machines + ] + return tableau(data, titre = [u'mid', u'rid', u'Type', u'Nom de machine', u'Adresse IP', u'Adresse MAC', u'Limitation'], largeur = [5, 5, 6, '*', 15, 17, 10], alignement = ['d', 'd', 'c', 'c', 'c', 'c', 'c'],