Revert r37178 "cli: Add verbose and noln parameters to error() and status()"

This commit is contained in:
Ozan Çağlayan
2011-06-07 11:03:53 +00:00
parent 1d551a66b4
commit 229f3fe307
2 changed files with 7 additions and 9 deletions
+5 -7
View File
@@ -118,17 +118,15 @@ class CLI(pisi.ui.UI):
else:
self.output(pisi.util.colorize(msg + '\n', 'brightyellow'), err=True, verbose=verbose)
def error(self, msg, noln = False):
def error(self, msg):
msg = unicode(msg)
self.errors += 1
if not noln:
msg = '%s\n' % msg
if ctx.log:
ctx.log.error(msg)
if ctx.get_option('no_color'):
self.output(_('Error: ') + msg, err=True)
self.output(_('Error: ') + msg + '\n', err=True)
else:
self.output(pisi.util.colorize(msg, 'brightred'), err=True)
self.output(pisi.util.colorize(msg + '\n', 'brightred'), err=True)
def action(self, msg, verbose = False):
#TODO: this seems quite redundant?
@@ -186,10 +184,10 @@ class CLI(pisi.ui.UI):
if ka['percent'] == 100:
self.output(pisi.util.colorize(_(' [complete]\n'), 'gray'))
def status(self, msg = None, verbose = False):
def status(self, msg = None):
if msg:
msg = unicode(msg)
self.output(pisi.util.colorize(msg + '\n', 'brightgreen'), verbose=verbose)
self.output(pisi.util.colorize(msg + '\n', 'brightgreen'))
pisi.util.xterm_title(msg)
def notify(self, event, **keywords):
+2 -2
View File
@@ -68,7 +68,7 @@ class UI(object):
"warn the user"
pass
def error(self, msg, noln = False):
def error(self,msg):
"inform a (possibly fatal) error"
pass
@@ -90,7 +90,7 @@ class UI(object):
"display progress"
pass
def status(self, msg = None, verbose = False):
def status(self, msg = None):
"set status, if not given clear it"
pass