On force print a rencoder pour viter les plantages dus aux accents
Ps: dsol si les miens sont en iso ou passent mal darcs-hash:20050722121831-c3cc4-57bf3461578d2e6166e9d2147396bc2a9aa43ec1.gz
This commit is contained in:
parent
9171b281a0
commit
9b58e6ba5b
1 changed files with 14 additions and 14 deletions
|
@ -94,7 +94,7 @@ def aff(qqch,mtech=0) :
|
|||
unicode_print(machine_details(c))
|
||||
elif t == 'cid' : unicode_print(club_details(c))
|
||||
if len(qqch) > 1:
|
||||
print "Total: %d" % len(qqch)
|
||||
print u"Total: %d" % len(qqch)
|
||||
|
||||
def adhers_brief(adhers) :
|
||||
"""
|
||||
|
@ -738,7 +738,7 @@ def prise_etat(chbre) :
|
|||
def __usage_brief(err='') :
|
||||
""" Message d'erreur """
|
||||
if err : cprint(err,'gras')
|
||||
print "Pour obtenir de l'aide sur l'utilisation de ce programme utilisez l'option -h"
|
||||
print u"Pour obtenir de l'aide sur l'utilisation de ce programme utilisez l'option -h"
|
||||
sys.exit(2)
|
||||
|
||||
def __usage() :
|
||||
|
@ -815,20 +815,20 @@ def __recherche() :
|
|||
__usage_brief('Valeur du paramètre %s incorecte (doit être un entier positif)' % opt)
|
||||
elif opt in [ '-a', '--adherent' ] :
|
||||
only_adh = 1
|
||||
print "Affichage limité aux adhérents."
|
||||
print u"Affichage limité aux adhérents."
|
||||
elif opt in [ '-m', '--machine' ] :
|
||||
only_mac = 1
|
||||
print "Affichage limité aux machines."
|
||||
print u"Affichage limité aux machines."
|
||||
elif opt in [ '-c', '--club' ] :
|
||||
only_club = 1
|
||||
print "Affichage limité aux clubs."
|
||||
print u"Affichage limité aux clubs."
|
||||
elif opt == '--crans' :
|
||||
only_crans = 1
|
||||
mtech = 1
|
||||
print "Affichage limité aux machines du crans."
|
||||
print u"Affichage limité aux machines du crans."
|
||||
elif opt in [ '-b', '--bornes' ] :
|
||||
only_bornes = 1
|
||||
print "Affichage limité aux bornes wifi."
|
||||
print u"Affichage limité aux bornes wifi."
|
||||
# On va tenter de limiter un peu la recherche
|
||||
if not arg :
|
||||
# Recherche initiale sans critère
|
||||
|
@ -858,15 +858,15 @@ def __recherche() :
|
|||
try :
|
||||
chbre = reverse(prise[0].lower())[prise[1:]+'-']
|
||||
except :
|
||||
print "Prise inconnue."
|
||||
print u"Prise inconnue."
|
||||
return
|
||||
if len(chbre) != 1 :
|
||||
print "Prise correspondante à plusieurs prises %s " % ' '.join(chbre)
|
||||
print u"Prise correspondante à plusieurs prises %s " % ' '.join(chbre)
|
||||
return
|
||||
|
||||
# On fait la recherche sur la prise
|
||||
chbre= prise[0] + chbre[0]
|
||||
#print "Recherche sur chambre %s" % chbre
|
||||
#print u"Recherche sur chambre %s" % chbre
|
||||
arg = 'chbre=%s' % chbre
|
||||
|
||||
try :
|
||||
|
@ -887,9 +887,9 @@ def __recherche() :
|
|||
if arg.count('=') == 1 and arg.split('=')[0] == 'chbre' :
|
||||
# Affichage des infos de la chambre
|
||||
chbre = arg.split('=')[1]
|
||||
print "Chambre %s inocupée ou invalide (%s)" % (chbre,prise_etat(chbre))
|
||||
print u"Chambre %s inocupée ou invalide (%s)" % (chbre,prise_etat(chbre))
|
||||
else :
|
||||
print "Aucun résultat trouvé."
|
||||
print u"Aucun résultat trouvé."
|
||||
sys.exit(3)
|
||||
# L'affichage souhaité a été précisé ?
|
||||
elif only_bornes :
|
||||
|
@ -966,13 +966,13 @@ if __name__ == '__main__' :
|
|||
try :
|
||||
__recherche()
|
||||
except KeyboardInterrupt :
|
||||
print "Recherche interrompue par l'utilisateur."
|
||||
print u"Recherche interrompue par l'utilisateur."
|
||||
sys.exit(255)
|
||||
except SystemExit, c :
|
||||
# Fin
|
||||
sys.exit(c)
|
||||
except :
|
||||
print """Une erreur fatale s'est produite durant l'exécution.
|
||||
print u"""Une erreur fatale s'est produite durant l'exécution.
|
||||
Pour l'amélioration de ce programme merci de prévenir nounou en spécifiant la
|
||||
marche à suivre pour reproduire cette erreur."""
|
||||
if debug :
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue