diff --git a/osc/commandline.py b/osc/commandline.py index 30c22fc6..66d86f21 100755 --- a/osc/commandline.py +++ b/osc/commandline.py @@ -129,9 +129,7 @@ class Osc(cmdln.Cmdln): conf.add_section(e.file, e.url, user, passwd) if try_again: self.postoptparse(try_again = False) - self.conf = conf self.options.verbose = conf.config['verbose'] - conf.exclude_glob = conf.config['exclude_glob'].split() def get_cmd_help(self, cmdname): @@ -225,8 +223,11 @@ class Osc(cmdln.Cmdln): """ args = slash_split(args) - if (subcmd == 'll'): opts.verbose = True; - if (subcmd == 'lL' or subcmd == 'LL'): opts.verbose = True; opts.expand = True; + if subcmd == 'll': + opts.verbose = True + if subcmd == 'lL' or subcmd == 'LL': + opts.verbose = True + opts.expand = True if len(args) == 1: project = args[0] @@ -1224,14 +1225,14 @@ Please submit there instead, or use --nodevelproject to force direct submission. ${cmd_option_list} """ - if (subcmd == 'branch_co' or subcmd == 'branchco' or subcmd == 'bco'): opts.checkout = True + if subcmd == 'branch_co' or subcmd == 'branchco' or subcmd == 'bco': opts.checkout = True args = slash_split(args) tproject = tpackage = None - if (len(args) == 1): - print >>sys.stderr, "defaulting to %s/%s" % (conf.config['branch_project'],args[0]) + if len(args) == 1: + print >>sys.stderr, 'defaulting to %s/%s' % (conf.config['branch_project'], args[0]) # python has no args.unshift ??? - args = [ conf.config['branch_project'] , args[0] ] + args = [ conf.config['branch_project'], args[0] ] if not (len(args) >= 2 and len(args) <= 4): diff --git a/osc/conf.py b/osc/conf.py index 62c27ef2..bb128565 100644 --- a/osc/conf.py +++ b/osc/conf.py @@ -440,6 +440,7 @@ def get_config(override_conffile = None, raise oscerr.ConfigError('cannot parse \'%s\' setting: ' % i + str(e), conffile) config['packagecachedir'] = os.path.expanduser(config['packagecachedir']) + config['exclude_glob'] = config['exclude_glob'].split() re_clist = re.compile('[, ]+') config['extra-pkgs'] = [ i.strip() for i in re_clist.split(config['extra-pkgs'].strip()) if i ] diff --git a/osc/core.py b/osc/core.py index 8b854bb7..dbdbfd30 100755 --- a/osc/core.py +++ b/osc/core.py @@ -283,8 +283,8 @@ class Project: if conf.config['do_package_tracking']: self.pac_root = self.read_packages().getroot() self.pacs_have = [ pac.get('name') for pac in self.pac_root.findall('package') ] - self.pacs_excluded = [ i for i in os.listdir(self.dir) - for j in conf.exclude_glob + self.pacs_excluded = [ i for i in os.listdir(self.dir) + for j in conf.config['exclude_glob'] if fnmatch.fnmatch(i, j) ] self.pacs_unvers = [ i for i in os.listdir(self.dir) if i not in self.pacs_have and i not in self.pacs_excluded ] # store all broken packages (e.g. packages which where removed by a non-osc cmd) @@ -363,7 +363,7 @@ class Project: def addPackage(self, pac): import fnmatch - for i in conf.exclude_glob: + for i in conf.config['exclude_glob']: if fnmatch.fnmatch(pac, i): return False state = self.get_state(pac) @@ -955,7 +955,7 @@ class Package: # gather unversioned files, but ignore some stuff self.excluded = [ i for i in os.listdir(self.dir) - for j in conf.exclude_glob + for j in conf.config['exclude_glob'] if fnmatch.fnmatch(i, j) ] self.filenamelist_unvers = [ i for i in os.listdir(self.dir) if i not in self.excluded