L'erreur que renvoie getopt n'est pas en unicode.
darcs-hash:20060404215742-9e428-ed112a6eaf2f5d57e80ca4e7f7014d85ab5f2601.gz
This commit is contained in:
parent
cc394f30c7
commit
bf58f3db6c
1 changed files with 7 additions and 6 deletions
|
@ -932,7 +932,8 @@ def __recherche() :
|
|||
try :
|
||||
options, arg = getopt.getopt(sys.argv[1:], 'hamctbil:L:', [ 'debug', 'help', 'adherent', 'machine', 'club' , 'tech', 'bornes', 'limit=', 'limit-historique=', 'ipsec', 'crans' ])
|
||||
except getopt.error, msg :
|
||||
__usage_brief(msg)
|
||||
__usage_brief(unicode(msg))
|
||||
|
||||
|
||||
# Traitement des options
|
||||
only_adh=0
|
||||
|
@ -952,12 +953,12 @@ def __recherche() :
|
|||
# Passage mode condensé, mode détaillé
|
||||
try : limit_aff_details = int(val)
|
||||
except :
|
||||
__usage_brief('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':
|
||||
# Limitation du nombre de lignes d'historique
|
||||
try : limit_aff_historique = int(val)
|
||||
except :
|
||||
__usage_brief('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' ] :
|
||||
only_adh = 1
|
||||
cprint(u"Affichage limité aux adhérents.")
|
||||
|
@ -989,7 +990,7 @@ def __recherche() :
|
|||
aff_ipsec = 1
|
||||
|
||||
if only_adh + only_mac + only_club + only_bornes > 1 :
|
||||
__usage_brief('Options utilisées incompatibles')
|
||||
__usage_brief(u'Options utilisées incompatibles')
|
||||
|
||||
arg = ' '.join(arg)
|
||||
# Cas particulier de recherche sur prise
|
||||
|
@ -1012,7 +1013,7 @@ def __recherche() :
|
|||
# On fait la recherche sur la chambre
|
||||
chbre= prise[0] + chbre[0]
|
||||
#cprint(u"Recherche sur chambre %s" % chbre)
|
||||
arg = 'chbre=%s' % chbre
|
||||
arg = u'chbre=%s' % chbre
|
||||
# sinon on ne fait rien et on recherche sur le champ prise
|
||||
|
||||
try:
|
||||
|
@ -1021,7 +1022,7 @@ def __recherche() :
|
|||
else :
|
||||
if not arg :
|
||||
# Pas de chaine de recherche fournie
|
||||
__usage_brief('Chaine de recherche incorrecte.')
|
||||
__usage_brief(u'Chaine de recherche incorrecte.')
|
||||
res = base.search(arg)
|
||||
except ValueError, c :
|
||||
__usage_brief(c.args[0])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue