diff --git a/pisi/cli/__init__.py b/pisi/cli/__init__.py index 87722c71..c357ebd3 100644 --- a/pisi/cli/__init__.py +++ b/pisi/cli/__init__.py @@ -118,15 +118,17 @@ class CLI(pisi.ui.UI): else: self.output(pisi.util.colorize(msg + '\n', 'brightyellow'), err=True, verbose=verbose) - def error(self, msg): + def error(self, msg, noln = False): 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 + '\n', err=True) + self.output(_('Error: ') + msg, err=True) else: - self.output(pisi.util.colorize(msg + '\n', 'brightred'), err=True) + self.output(pisi.util.colorize(msg, 'brightred'), err=True) def action(self, msg, verbose = False): #TODO: this seems quite redundant? @@ -184,10 +186,10 @@ class CLI(pisi.ui.UI): if ka['percent'] == 100: self.output(pisi.util.colorize(_(' [complete]\n'), 'gray')) - def status(self, msg = None): + def status(self, msg = None, verbose = False): if msg: msg = unicode(msg) - self.output(pisi.util.colorize(msg + '\n', 'brightgreen')) + self.output(pisi.util.colorize(msg + '\n', 'brightgreen'), verbose=verbose) pisi.util.xterm_title(msg) def notify(self, event, **keywords): diff --git a/pisi/ui.py b/pisi/ui.py index 31a77ba4..b1751b57 100644 --- a/pisi/ui.py +++ b/pisi/ui.py @@ -68,7 +68,7 @@ class UI(object): "warn the user" pass - def error(self,msg): + def error(self, msg, noln = False): "inform a (possibly fatal) error" pass @@ -90,7 +90,7 @@ class UI(object): "display progress" pass - def status(self, msg = None): + def status(self, msg = None, verbose = False): "set status, if not given clear it" pass