- use YESEXPR and NOEXPR for in confirm

- a workaround for string conversion in python exceptions
(thanks Gürer)
This commit is contained in:
Barış Metin
2005-10-05 08:52:27 +00:00
parent adbcc62ead
commit d84565b4dd
2 changed files with 5 additions and 5 deletions
+3 -3
View File
@@ -92,9 +92,9 @@ def install(packages):
#FIXME: As Gurer warns, something's fishy with this exception proc.
except InstallError, e:
print type(e)
ctx.ui.error(str(e))
ctx.ui.error("InstallError:") #%s" % str(e))
# FIXME: This is a workaround for __str__ conversion used in
# Python exceptions
ctx.ui.error(e.args[0])
except packagedb.Error, e:
ctx.ui.error("PackageDBError: (%s)" % str(e))
+2 -2
View File
@@ -92,9 +92,9 @@ class CLI(UI):
while True:
prompt = msg + colorize(_('(yes/no)'), 'red')
s = raw_input(prompt.encode('utf-8'))
if s.startswith(_('y').encode('utf-8')) or s.startswith(_('Y').encode('utf-8')):
if s[0] in locale.nl_langinfo(locale.YESEXPR):
return True
if s.startswith(_('n').encode('utf-8')) or s.startswith(_('N').encode('utf-8')):
elif s[0] in locale.nl_langinfo(locale.NOEXPR):
return False
def display_progress(self, pd):