Dans affich_tools, tableau_ng remplace dornavant tableau.

darcs-hash:20060326160011-68412-d87c57d6e2edf22dd78fd5c78e07793a19421ff5.gz
This commit is contained in:
glondu 2006-03-26 18:00:11 +02:00
parent 821905a295
commit 7428178ab9
5 changed files with 101 additions and 123 deletions

View file

@ -171,11 +171,12 @@ def controle_interactif(quoi):
okc, nokc =_controle_interactif_clubs(todo_list['club'])
print coul(u'\nRécapitulatif des nouveaux contrôles +%s :' % quoi, 'violet')
liste = [(u'Catégorie', u'OK', u'pas OK'),
(u'adhérents', str(oka), str(noka))]
liste = [[u'adhérents', str(oka), str(noka)]]
if quoi == 'p':
liste.append((u'clubs', str(okc), str(nokc)))
print tableau([15, 10, 10], liste)
liste.append([u'clubs', str(okc), str(nokc)])
print tableau(liste,
titre = [u'Catégorie', u'OK', u'pas OK'],
largeur = [15, 10, 10])
def formater_pour_cableur(liste):
@ -183,15 +184,18 @@ def formater_pour_cableur(liste):
Formate la liste d'adhérents ou de clubs avec les dates correspondantes.
liste est une liste de couples (date, objet).
"""
lignes = [(u'id', u'Nom', u'Date Heure')]
lignes = []
total = 0
liste.sort(lambda x, y: cmp(x[1].nom(), y[1].nom()))
for date, a in liste:
lignes.append((a.id(), a.Nom(), date))
lignes.append([a.id(), a.Nom(), date])
total += 1
return tableau([6, 40, 18], lignes) + u'\nTotal : %d' % total
return tableau(lignes,
titre = [u'id', u'Nom', u'Date Heure'],
largeur = [6, 40, 18],
alignement = ['d', 'c', 'c']) + u'\nTotal : %d' % total
def formater_pour_bureau(dico):
@ -199,17 +203,20 @@ def formater_pour_bureau(dico):
Formate la liste d'adhérents ou de clubs avec les câbleurs correspondantes
pour le mail récapitulatif envoyé à bureau.
"""
lignes = [(u'id', u'Nom', u'Câbleur', u'Date')]
lignes = []
total = 0
liste = dico.keys()
liste.sort()
for cableur in liste:
for date, a in dico[cableur]:
lignes.append((a.id(), a.Nom(), cableur, date))
lignes.append([a.id(), a.Nom(), cableur, date])
total += 1
return tableau([6, 40, 18, 18], lignes) + u'\nTotal : %d' % total
return tableau(lignes,
titre = [u'id', u'Nom', u'Câbleur', u'Date'],
largeur = [6, 40, 18, 18],
alignement = ['d', 'c', 'c', 'c']) + u'\nTotal : %d' % total
def qui(historique, quoi):