diff --git a/pisi/api.py b/pisi/api.py index b2508292..e0f79f6a 100644 --- a/pisi/api.py +++ b/pisi/api.py @@ -63,7 +63,7 @@ def init(database = True, write = True, if ui is None: from pisi.cli import CLI if options: - ctx.ui = CLI(options.debug) + ctx.ui = CLI(options.debug, options.verbose) else: ctx.ui = CLI() else: @@ -317,12 +317,12 @@ def check(package): for file in files.list: if file.hash and file.type != "config" \ and not os.path.islink('/' + file.path): - ctx.ui.info(_("Checking %s...") % file.path, False, True) + ctx.ui.info(_("Checking %s...") % file.path, noln=False, verbose=True) if file.hash != util.sha1_file('/' + file.path): corrupt.append(file) ctx.ui.info("Corrupt file: %s" % file) else: - ctx.ui.info("OK", False) + ctx.ui.info("OK", verbose=True) return corrupt def index(dirs=None, output='pisi-index.xml', skip_sources=False, skip_signing=False, diff --git a/pisi/cli/__init__.py b/pisi/cli/__init__.py index ad0ee0dd..3ec6856d 100644 --- a/pisi/cli/__init__.py +++ b/pisi/cli/__init__.py @@ -67,11 +67,9 @@ class CLI(UI): def info(self, msg, verbose = False, noln = False): # TODO: need to look at more kinds of info messages # let's cheat from KDE :) - if noln: - msgend = '' - else: - msgend = '\n' - self.output( unicode(msg) + msgend, verbose=verbose) + if not noln: + msg += '\n' + self.output(unicode(msg), verbose=verbose) def warning(self, msg, verbose = False): msg = unicode(msg) diff --git a/pisi/cli/pisicli.py b/pisi/cli/pisicli.py index 46e3c5e2..4a86076f 100644 --- a/pisi/cli/pisicli.py +++ b/pisi/cli/pisicli.py @@ -82,13 +82,12 @@ class PreParser(OptionParser): class PisiCLI(object): - def __init__(self, args=None): + def __init__(self, orig_args=None): # first construct a parser for common options # this is really dummy self.parser = PreParser(version="%prog " + pisi.__version__) - try: - opts, args = self.parser.parse_args(args=args) + opts, args = self.parser.parse_args(args=orig_args) if len(args)==0: # more explicit than using IndexError if 'version' in opts: self.parser.print_version() @@ -100,7 +99,7 @@ class PisiCLI(object): except ParserError: raise Error(_('Command line parsing error')) - self.command = Command.get_command(cmd_name, args=args) + self.command = Command.get_command(cmd_name, args=orig_args) if not self.command: raise Error(_("Unrecognized command: %s") % cmd_name)