- use YESEXPR and NOEXPR for in confirm
- a workaround for string conversion in python exceptions (thanks Gürer)
This commit is contained in:
+3
-3
@@ -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))
|
||||
|
||||
@@ -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):
|
||||
|
||||
Reference in New Issue
Block a user