- YESEXPR is a regexp (shame on me...)
- apply the workaround to other except block...
This commit is contained in:
+2
-1
@@ -97,7 +97,8 @@ def install(packages):
|
|||||||
ctx.ui.error(e.args[0])
|
ctx.ui.error(e.args[0])
|
||||||
|
|
||||||
except packagedb.Error, e:
|
except packagedb.Error, e:
|
||||||
ctx.ui.error("PackageDBError: (%s)" % str(e))
|
# FIXME: same workaround...
|
||||||
|
ctx.ui.error("PackageDBError: (%s)" % e.args[0])
|
||||||
ctx.ui.error(_("Package is not installable."))
|
ctx.ui.error(_("Package is not installable."))
|
||||||
|
|
||||||
#except Exception, e:
|
#except Exception, e:
|
||||||
|
|||||||
@@ -90,12 +90,15 @@ class CLI(UI):
|
|||||||
if ctx.config.options and ctx.config.options.yes_all:
|
if ctx.config.options and ctx.config.options.yes_all:
|
||||||
return True
|
return True
|
||||||
while True:
|
while True:
|
||||||
|
import re
|
||||||
|
yesexpr = re.compile(locale.nl_langinfo(locale.YESEXPR))
|
||||||
|
|
||||||
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[0] in locale.nl_langinfo(locale.YESEXPR):
|
if yesexpr.search(s):
|
||||||
return True
|
return True
|
||||||
elif s[0] in locale.nl_langinfo(locale.NOEXPR):
|
|
||||||
return False
|
return False
|
||||||
|
|
||||||
def display_progress(self, pd):
|
def display_progress(self, pd):
|
||||||
out = '\r%-30.30s %3d%% %12.2f %s' % \
|
out = '\r%-30.30s %3d%% %12.2f %s' % \
|
||||||
|
|||||||
Reference in New Issue
Block a user