Kaydet (Commit) 44807cc9 authored tarafından Eray Özkural's avatar Eray Özkural

* fix: pass original args correctlyl, oops

üst 9c946358
...@@ -63,7 +63,7 @@ def init(database = True, write = True, ...@@ -63,7 +63,7 @@ def init(database = True, write = True,
if ui is None: if ui is None:
from pisi.cli import CLI from pisi.cli import CLI
if options: if options:
ctx.ui = CLI(options.debug) ctx.ui = CLI(options.debug, options.verbose)
else: else:
ctx.ui = CLI() ctx.ui = CLI()
else: else:
...@@ -317,12 +317,12 @@ def check(package): ...@@ -317,12 +317,12 @@ def check(package):
for file in files.list: for file in files.list:
if file.hash and file.type != "config" \ if file.hash and file.type != "config" \
and not os.path.islink('/' + file.path): 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): if file.hash != util.sha1_file('/' + file.path):
corrupt.append(file) corrupt.append(file)
ctx.ui.info("Corrupt file: %s" % file) ctx.ui.info("Corrupt file: %s" % file)
else: else:
ctx.ui.info("OK", False) ctx.ui.info("OK", verbose=True)
return corrupt return corrupt
def index(dirs=None, output='pisi-index.xml', skip_sources=False, skip_signing=False, def index(dirs=None, output='pisi-index.xml', skip_sources=False, skip_signing=False,
......
...@@ -67,11 +67,9 @@ class CLI(UI): ...@@ -67,11 +67,9 @@ class CLI(UI):
def info(self, msg, verbose = False, noln = False): def info(self, msg, verbose = False, noln = False):
# TODO: need to look at more kinds of info messages # TODO: need to look at more kinds of info messages
# let's cheat from KDE :) # let's cheat from KDE :)
if noln: if not noln:
msgend = '' msg += '\n'
else: self.output(unicode(msg), verbose=verbose)
msgend = '\n'
self.output( unicode(msg) + msgend, verbose=verbose)
def warning(self, msg, verbose = False): def warning(self, msg, verbose = False):
msg = unicode(msg) msg = unicode(msg)
......
...@@ -82,13 +82,12 @@ class PreParser(OptionParser): ...@@ -82,13 +82,12 @@ class PreParser(OptionParser):
class PisiCLI(object): class PisiCLI(object):
def __init__(self, args=None): def __init__(self, orig_args=None):
# first construct a parser for common options # first construct a parser for common options
# this is really dummy # this is really dummy
self.parser = PreParser(version="%prog " + pisi.__version__) self.parser = PreParser(version="%prog " + pisi.__version__)
try: 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 len(args)==0: # more explicit than using IndexError
if 'version' in opts: if 'version' in opts:
self.parser.print_version() self.parser.print_version()
...@@ -100,7 +99,7 @@ class PisiCLI(object): ...@@ -100,7 +99,7 @@ class PisiCLI(object):
except ParserError: except ParserError:
raise Error(_('Command line parsing error')) 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: if not self.command:
raise Error(_("Unrecognized command: %s") % cmd_name) raise Error(_("Unrecognized command: %s") % cmd_name)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment