- 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.
|
#FIXME: As Gurer warns, something's fishy with this exception proc.
|
||||||
except InstallError, e:
|
except InstallError, e:
|
||||||
print type(e)
|
# FIXME: This is a workaround for __str__ conversion used in
|
||||||
ctx.ui.error(str(e))
|
# Python exceptions
|
||||||
ctx.ui.error("InstallError:") #%s" % str(e))
|
ctx.ui.error(e.args[0])
|
||||||
|
|
||||||
except packagedb.Error, e:
|
except packagedb.Error, e:
|
||||||
ctx.ui.error("PackageDBError: (%s)" % str(e))
|
ctx.ui.error("PackageDBError: (%s)" % str(e))
|
||||||
|
|||||||
@@ -92,9 +92,9 @@ class CLI(UI):
|
|||||||
while True:
|
while True:
|
||||||
prompt = msg + colorize(_('(yes/no)'), 'red')
|
prompt = msg + colorize(_('(yes/no)'), 'red')
|
||||||
s = raw_input(prompt.encode('utf-8'))
|
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
|
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
|
return False
|
||||||
|
|
||||||
def display_progress(self, pd):
|
def display_progress(self, pd):
|
||||||
|
|||||||
Reference in New Issue
Block a user