on force l'encodage ici sinon il est fait au moment de l'impression a
l'ecran et il empeche l'affichage de toutes les infos. Les problmes d'encodage viennent des caractres exotiques dans les noms de fichiers imprims avec l'intranet depuis un systme d'exploitation exotique. darcs-hash:20061201135916-f46e9-3d181872a037e2a2be82d703aee4c618461c2a63.gz
This commit is contained in:
parent
c469b9d8b3
commit
1c05521bd2
1 changed files with 23 additions and 13 deletions
|
@ -96,6 +96,8 @@ def aff(qqch,mtech=0) :
|
||||||
cprint(machine_details(c).strip())
|
cprint(machine_details(c).strip())
|
||||||
elif t == 'cid':
|
elif t == 'cid':
|
||||||
cprint(club_details(c).strip())
|
cprint(club_details(c).strip())
|
||||||
|
|
||||||
|
# affiche le nombre de résultats
|
||||||
if len(qqch) > 1:
|
if len(qqch) > 1:
|
||||||
cprint(u"Total: %d" % len(qqch))
|
cprint(u"Total: %d" % len(qqch))
|
||||||
|
|
||||||
|
@ -322,7 +324,7 @@ def adher_details(adher) :
|
||||||
"""
|
"""
|
||||||
Affichage du détail des propriétés d'un adhérent
|
Affichage du détail des propriétés d'un adhérent
|
||||||
"""
|
"""
|
||||||
f=''
|
f=u''
|
||||||
# Aid
|
# Aid
|
||||||
f+= coul(u'aid=%s ' % adher.id() ,'bleu')
|
f+= coul(u'aid=%s ' % adher.id() ,'bleu')
|
||||||
# Nom, prenom
|
# Nom, prenom
|
||||||
|
@ -330,19 +332,19 @@ def adher_details(adher) :
|
||||||
|
|
||||||
# Mail
|
# Mail
|
||||||
GL = RMH = u''
|
GL = RMH = u''
|
||||||
if adher.mail().find('@')!=-1 :
|
if adher.mail().find(u'@')!=-1 :
|
||||||
f += coul(u'Adresse mail : ','gras') + "%s\n" % adher.mail()
|
f += coul(u'Adresse mail : ','gras') + u"%s\n" % adher.mail()
|
||||||
else :
|
else :
|
||||||
f += coul(u'Login : ','gras') + "%s\t" % adher.mail()
|
f += coul(u'Login : ','gras') + u"%s\t" % adher.mail()
|
||||||
# controurneGreylisting
|
# controurneGreylisting
|
||||||
if not adher.contourneGreylist():
|
if not adher.contourneGreylist():
|
||||||
GL = u' (%s)'%coul(u'GreyList','gris')
|
GL = u' (%s)'%coul(u'GreyList','gris')
|
||||||
if adher.rewriteMailHeaders():
|
if adher.rewriteMailHeaders():
|
||||||
RMH = u' (%s)'%coul(u'réécriture en-têtes mail','gris')
|
RMH = u' (%s)'%coul(u'réécriture en-têtes mail','gris')
|
||||||
|
|
||||||
alias = ', '.join([adher.canonical_alias()] + adher.alias())
|
alias = u', '.join([adher.canonical_alias()] + adher.alias())
|
||||||
if alias:
|
if alias:
|
||||||
if alias[0] == ',':
|
if alias[0] == u',':
|
||||||
# Canonical étéait vide
|
# Canonical étéait vide
|
||||||
alias = alias[2:]
|
alias = alias[2:]
|
||||||
f += coul(u'Alias : ','gras') + alias
|
f += coul(u'Alias : ','gras') + alias
|
||||||
|
@ -352,9 +354,9 @@ def adher_details(adher) :
|
||||||
try:
|
try:
|
||||||
forward = file("/home/%s/.forward" % adher.compte()).readlines()
|
forward = file("/home/%s/.forward" % adher.compte()).readlines()
|
||||||
if len(forward) > 1:
|
if len(forward) > 1:
|
||||||
forward = forward[0].strip() + " ...\n"
|
forward = forward[0].strip() + u" ...\n"
|
||||||
elif len(forward) == 1:
|
elif len(forward) == 1:
|
||||||
forward = forward[0].strip() + "\n"
|
forward = forward[0].strip() + u"\n"
|
||||||
if forward:
|
if forward:
|
||||||
f += coul(u'Redirection : ', 'gras') + forward
|
f += coul(u'Redirection : ', 'gras') + forward
|
||||||
except IOError, e:
|
except IOError, e:
|
||||||
|
@ -728,7 +730,7 @@ def _info(clas) :
|
||||||
def _hist(clas) :
|
def _hist(clas) :
|
||||||
""" Formatage de l'historique de la classe fournie """
|
""" Formatage de l'historique de la classe fournie """
|
||||||
if limit_aff_historique==0 : return ''
|
if limit_aff_historique==0 : return ''
|
||||||
f=''
|
f=u''
|
||||||
h = clas.historique()
|
h = clas.historique()
|
||||||
h.reverse()
|
h.reverse()
|
||||||
if h :
|
if h :
|
||||||
|
@ -737,7 +739,15 @@ def _hist(clas) :
|
||||||
try :
|
try :
|
||||||
a = h[i] # Produit une erreur si i trop grand
|
a = h[i] # Produit une erreur si i trop grand
|
||||||
if i !=0 : f += ' '
|
if i !=0 : f += ' '
|
||||||
f += '%s\n' % a
|
try:
|
||||||
|
# on force l'encodage ici sinon il est fait au moment de l'impression a
|
||||||
|
# l'ecran et il empeche l'affichage de toutes les infos
|
||||||
|
f += u'%s\n' % a.encode().decode()
|
||||||
|
except Exception, e:
|
||||||
|
if debug:
|
||||||
|
f += coul(u'*** non affichable [%s] ***\n' % str(e), 'rouge')
|
||||||
|
else:
|
||||||
|
f += coul(u'*** non affichable ***\n', 'rouge')
|
||||||
except :
|
except :
|
||||||
break
|
break
|
||||||
try :
|
try :
|
||||||
|
@ -967,7 +977,7 @@ def __recherche() :
|
||||||
__usage_brief(u'Valeur du paramètre %s incorecte (doit être un entier positif)' % opt)
|
__usage_brief(u'Valeur du paramètre %s incorecte (doit être un entier positif)' % opt)
|
||||||
elif opt == '-L' or opt =='--limit-historique':
|
elif opt == '-L' or opt =='--limit-historique':
|
||||||
# Limitation du nombre de lignes d'historique
|
# Limitation du nombre de lignes d'historique
|
||||||
try : limit_aff_historique = int(val)
|
try : limit_affv_historique = int(val)
|
||||||
except :
|
except :
|
||||||
__usage_brief(u'Valeur du paramètre %s incorecte (doit être un entier positif)' % opt)
|
__usage_brief(u'Valeur du paramètre %s incorecte (doit être un entier positif)' % opt)
|
||||||
elif opt in [ '-a', '--adherent' ] :
|
elif opt in [ '-a', '--adherent' ] :
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue