Salloperie d'encodage, ca devrai mieux aller.
darcs-hash:20041009145048-41617-736acd2ee276b47ecb09039bde0b0281a48183b2.gz
This commit is contained in:
parent
4d5cca0b3a
commit
611b9c8061
1 changed files with 13 additions and 9 deletions
|
@ -53,6 +53,10 @@ limit_aff_details = 1
|
|||
limit_aff_historique = 4
|
||||
aff_ipsec = 0
|
||||
|
||||
def unicode_print(truc) :
|
||||
""" Conversion de truc en iso-8859-15 puis affichage à l'écran """
|
||||
print truc.encode('iso-8859-15','ignore')
|
||||
|
||||
def aff(qqch,mtech=0) :
|
||||
""" Affichage de qqch.
|
||||
qqch peut être une liste d'instances des classes adhérent ou machine
|
||||
|
@ -70,22 +74,22 @@ def aff(qqch,mtech=0) :
|
|||
if len(qqch) > limit_aff_details :
|
||||
t = qqch[0].idn
|
||||
if t == 'aid' :
|
||||
print adhers_brief(qqch)
|
||||
unicode_print(adhers_brief(qqch))
|
||||
elif t == 'mid' :
|
||||
if mtech : print list_machines(qqch)
|
||||
else : print machines_brief(qqch)
|
||||
if mtech : unicode_print(list_machines(qqch))
|
||||
else : unicode_print(machines_brief(qqch))
|
||||
elif t == 'cid' :
|
||||
print clubs_brief(qqch)
|
||||
unicode_print(clubs_brief(qqch))
|
||||
else :
|
||||
i = 0
|
||||
for c in qqch :
|
||||
t = c.idn
|
||||
if i : print coul(u'='*80,'cyan')
|
||||
i = 1
|
||||
if t == 'aid' : print adher_details(c)
|
||||
if t == 'aid' : unicode_print(adher_details(c))
|
||||
elif t == 'mid' :
|
||||
print machine_details(c)
|
||||
elif t == 'cid' : print club_details(c)
|
||||
unicode_print(machine_details(c))
|
||||
elif t == 'cid' : unicode_print(club_details(c))
|
||||
if len(qqch) > 1:
|
||||
print "Total: %d" % len(qqch)
|
||||
|
||||
|
@ -789,7 +793,7 @@ def __recherche() :
|
|||
sys.exit(4)
|
||||
else :
|
||||
if len(res['machine']) > limit_aff_details :
|
||||
print list_bornes(res['machine'])
|
||||
unicode_print(list_bornes(res['machine']))
|
||||
else :
|
||||
aff(res['machine'])
|
||||
elif only_adh :
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue