Commit f87e66ea authored by Clément Schreiner's avatar Clément Schreiner
Browse files

Fix trivial mistakes.

(Autodebtag's constructor missing an argument, wrong section BinPackages, extra whitespace in mv(), use of set.add() when an union with set.update() was intended.)
parent 451ef4b8
......@@ -96,9 +96,9 @@ class Autodebtag(autotag.Autodebtag):
"""
Use debtagsd's heuristics to assign debtags to a new package
"""
def __init__(self):
def __init__(self, *sources):
self.sources = {}
for src in (BinPackages,):
for src in sources:
self.sources[src.__name__.lower()] = src.create('data')
self.rules = list()
......@@ -112,7 +112,7 @@ class Autodebtag(autotag.Autodebtag):
tags = {}
for r in self.rules:
for pkg, added, removed in r.make_patch():
tags.setdefault(pkg, set()).add(added)
tags.setdefault(pkg, set()).update(added)
return tags
class Apriori(datasources.Action):
......@@ -148,8 +148,7 @@ class BinPackages(datasources.DataSource):
for p in packages:
pkg_from_repo = repository.get_bin_package(p.name, p.arch)
section = p.package_version.section
section = 'libs'
section = pkg_from_repo.get('Section', None)
desc = pkg_from_repo.get('Description', None)
sdesc, ldesc = utils.splitdesc(desc)
......@@ -157,7 +156,7 @@ class BinPackages(datasources.DataSource):
re_multivalue = re.compile(r'\s*,\s*')
def mv(name):
"Get list value for multivalue field"
return [x for x in re_multivalue.split(pkg_from_repo .get(name, "")) if x]
return [x for x in re_multivalue.split(pkg_from_repo.get(name, "")) if x]
info = datasources.Pkg(p.name,
p.package_version.version,
......
Supports Markdown
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