Commit d12d198b authored by Bastian Blank's avatar Bastian Blank 🙊 Committed by Joerg Jaspert

Fix E202: Whitespace before ')'

parent 681c3f4b
......@@ -56,7 +56,7 @@ def main():
('u',"user","Add-User::Options::User", "HasArg"),
]
for i in ["help" ]:
for i in ["help"]:
key = "Add-User::Options::%s" % i
if key not in Cnf:
Cnf[key] = ""
......
......@@ -1045,7 +1045,7 @@ def forget_signature(args):
data = fh.read()
session = DBConn().session()
keyrings = [k.keyring_name for k in session.query(Keyring).filter_by(active=True).order_by(Keyring.priority) ]
keyrings = [k.keyring_name for k in session.query(Keyring).filter_by(active=True).order_by(Keyring.priority)]
signed_file = daklib.gpg.SignedFile(data, keyrings)
history = SignatureHistory.from_signed_file(signed_file).query(session)
if history is not None:
......@@ -1066,7 +1066,7 @@ def main():
Cnf = utils.get_conf()
arguments = [('h', "help", "Admin::Options::Help"),
('n', "dry-run", "Admin::Options::Dry-Run")]
for i in ["help", "dry-run" ]:
for i in ["help", "dry-run"]:
key = "Admin::Options::%s" % i
if key not in Cnf:
Cnf[key] = ""
......
......@@ -78,10 +78,10 @@ class BugClassifier(object):
>>> BugClassifier.dak_re.match( "[dak] Packages.diff/Index broken" ) != None
True
"""
rm_re = re.compile("^RM" )
dak_re = re.compile("^\[dak\]" )
arch_re = re.compile("^\[Architectures\]" )
override_re = re.compile("^override" )
rm_re = re.compile("^RM")
dak_re = re.compile("^\[dak\]")
arch_re = re.compile("^\[Architectures\]")
override_re = re.compile("^override")
classifiers = {rm_re: 'remove',
dak_re: 'dak',
......@@ -99,8 +99,8 @@ class BugClassifier(object):
for tags in tagged_bugs.keys():
tagged_bugs_ftp += tagged_bugs[tags]
return [bug for bug in bts.get_status(bts.get_bugs("package", "ftp.debian.org" ) ) \
if bug.pending=='pending' and bug.bug_num not in tagged_bugs_ftp ]
return [bug for bug in bts.get_status(bts.get_bugs("package", "ftp.debian.org")) \
if bug.pending=='pending' and bug.bug_num not in tagged_bugs_ftp]
def classify_bug(self, bug):
"""
......@@ -149,7 +149,7 @@ def send_email(commands, simulate=False):
if simulate:
print bts_mail_message
else:
utils.send_mail(bts_mail_message )
utils.send_mail(bts_mail_message)
def main():
......@@ -170,7 +170,7 @@ def main():
if Options["Help"]:
usage()
sys.exit(0 )
sys.exit(0)
if Options["Quiet"]:
level=logging.ERROR
......@@ -183,7 +183,7 @@ def main():
logging.basicConfig(level=level,
format='%(asctime)s %(levelname)s %(message)s',
stream=sys.stderr )
stream=sys.stderr)
body = BugClassifier().email_text()
......@@ -191,7 +191,7 @@ def main():
send_email(body, Options["Simulate"])
else:
log.info("nothing to do" )
log.info("nothing to do")
if __name__ == '__main__':
......
......@@ -207,7 +207,7 @@ def check_override():
"""
session = DBConn().session()
for suite_name in ["stable", "unstable" ]:
for suite_name in ["stable", "unstable"]:
print suite_name
print "-" * len(suite_name)
print
......@@ -442,10 +442,10 @@ def check_indices_files_exist():
"""
Ensure files mentioned in Packages & Sources exist
"""
for suite in ["stable", "testing", "unstable" ]:
for suite in ["stable", "testing", "unstable"]:
for component in get_component_names():
architectures = get_suite_architectures(suite)
for arch in [i.arch_string.lower() for i in architectures ]:
for arch in [i.arch_string.lower() for i in architectures]:
if arch == "source":
validate_sources(suite, component)
elif arch == "all":
......@@ -481,7 +481,7 @@ def chk_bd_process_dir(unused, dirname, filenames):
continue
filename = os.path.abspath(dirname+'/'+name)
dsc = utils.parse_changes(filename, dsc_file=1)
for field_name in ["build-depends", "build-depends-indep" ]:
for field_name in ["build-depends", "build-depends-indep"]:
field = dsc.get(field_name)
if field:
try:
......@@ -548,7 +548,7 @@ def main():
cnf = Config()
Arguments = [('h',"help","Check-Archive::Options::Help")]
for i in ["help" ]:
for i in ["help"]:
key = "Check-Archive::Options::%s" % i
if key not in cnf:
cnf[key] = ""
......
......@@ -124,7 +124,7 @@ SELECT b.package
JOIN suite ON ba.suite = suite.id
JOIN files_archive_map af ON b.file = af.file_id AND suite.archive_id = af.archive_id
WHERE b.type = :otype AND ba.suite IN (%s) AND af.component_id = :component_id
""" % (",".join([str(i) for i in affected_suites ])), {'otype': otype, 'component_id': component_id})
""" % (",".join([str(i) for i in affected_suites])), {'otype': otype, 'component_id': component_id})
for i in q.fetchall():
packages[i[0]] = 0
......@@ -326,7 +326,7 @@ def main():
Arguments = [('h',"help","Check-Overrides::Options::Help"),
('n',"no-action", "Check-Overrides::Options::No-Action")]
for i in ["help", "no-action" ]:
for i in ["help", "no-action"]:
key = "Check-Overrides::Options::%s" % i
if key not in cnf:
cnf[key] = ""
......
......@@ -207,7 +207,7 @@ def main():
cnf = Config()
for i in ["Help", "Incoming", "No-Action", "Verbose" ]:
for i in ["Help", "Incoming", "No-Action", "Verbose"]:
key = "Clean-Queues::Options::%s" % i
if key not in cnf:
cnf[key] = ""
......
......@@ -282,7 +282,7 @@ def clean(now_date, archives, max_delete, session):
Logger.log(["Limiting removals to %d" % max_delete])
if archives is not None:
archive_ids = [a.archive_id for a in archives ]
archive_ids = [a.archive_id for a in archives]
old_files = old_files.filter(ArchiveFile.archive_id.in_(archive_ids))
for af in old_files:
......@@ -482,7 +482,7 @@ def main():
cnf = Config()
for i in ["Help", "No-Action", "Maximum" ]:
for i in ["Help", "No-Action", "Maximum"]:
key = "Clean-Suites::Options::%s" % i
if key not in cnf:
cnf[key] = ""
......
......@@ -315,7 +315,7 @@ def main():
('t', "type", "Control-Overrides::Options::Type", "HasArg")]
# Default arguments
for i in ["add", "help", "list", "quiet", "set", "change", "no-action" ]:
for i in ["add", "help", "list", "quiet", "set", "change", "no-action"]:
key = "Control-Overrides::Options::%s" % i
if key not in cnf:
cnf[key] = ""
......@@ -334,7 +334,7 @@ def main():
session = DBConn().session()
mode = None
for i in ["add", "list", "set", "change" ]:
for i in ["add", "list", "set", "change"]:
if cnf["Control-Overrides::Options::%s" % (i)]:
if mode:
utils.fubar("Can not perform more than one action at once.")
......
......@@ -164,8 +164,8 @@ def version_checks(package, architecture, target_suite, new_version, session, fo
else:
suite_version_list = get_suite_version_by_package(package, architecture, session)
must_be_newer_than = [vc.reference.suite_name for vc in get_version_checks(target_suite, "MustBeNewerThan") ]
must_be_older_than = [vc.reference.suite_name for vc in get_version_checks(target_suite, "MustBeOlderThan") ]
must_be_newer_than = [vc.reference.suite_name for vc in get_version_checks(target_suite, "MustBeNewerThan")]
must_be_older_than = [vc.reference.suite_name for vc in get_version_checks(target_suite, "MustBeOlderThan")]
# Must be newer than an existing version in target_suite
if target_suite not in must_be_newer_than:
......@@ -407,7 +407,7 @@ def main():
('r',"remove", "Control-Suite::Options::Remove", "HasArg"),
('s',"set", "Control-Suite::Options::Set", "HasArg")]
for i in ["add", "britney", "help", "list", "remove", "set", "version" ]:
for i in ["add", "britney", "help", "list", "remove", "set", "version"]:
key = "Control-Suite::Options::%s" % i
if key not in cnf:
cnf[key] = ""
......
......@@ -48,7 +48,7 @@ def main():
('d', "destination", "Copy-Installer::Options::Destination", "HasArg"),
('n', "no-action", "Copy-Installer::Options::No-Action"),
]
for option in ["help", "source", "destination", "no-action" ]:
for option in ["help", "source", "destination", "no-action"]:
key = "Copy-Installer::Options::%s" % option
if key not in cnf:
cnf[key] = ""
......@@ -60,7 +60,7 @@ def main():
if len(extra_arguments) != 1:
usage(1)
initializer = {"version": extra_arguments[0] }
initializer = {"version": extra_arguments[0]}
if Options["Source"] != "":
initializer["source"] = Options["Source"]
if Options["Destination"] != "":
......
......@@ -257,7 +257,7 @@ select bab1.package, bab1.version as oldver,
join suite s on bab1.suite = s.id
where s.suite_name = :suite_name
group by bab1.package, oldver, bab1.suite, newver"""
return session.execute(query, {'suite_name': suite_name })
return session.execute(query, {'suite_name': suite_name})
def reportNewerAll(suite_name, session):
......@@ -360,7 +360,7 @@ SELECT ss.src, ss.source, ss.version,
WHERE s.suite_name = :suite_name AND bab.id IS NULL
AND now() - ss.install_date > '1 day'::interval
ORDER BY install_date"""
args = {'suite_name': suite_name }
args = {'suite_name': suite_name}
return session.execute(query, args)
......@@ -375,7 +375,7 @@ SELECT b.package
WHERE sas.source = :source
GROUP BY b.package
ORDER BY b.package"""
args = {'source': source }
args = {'source': source}
return session.execute(query, args)
......@@ -391,7 +391,7 @@ SELECT sas.source, MAX(sas.version) AS srcver
WHERE s.suite_name = :suite_name AND bab.package = :package
GROUP BY sas.source, bab.package
ORDER BY sas.source, bab.package"""
args = {'suite_name': suite_name, 'package': package }
args = {'suite_name': suite_name, 'package': package}
return session.execute(query, args)
......@@ -525,7 +525,7 @@ def main():
('R',"rdep-check", "Cruft-Report::Options::Rdep-Check"),
('s',"suite","Cruft-Report::Options::Suite","HasArg"),
('w',"wanna-build-dump","Cruft-Report::Options::Wanna-Build-Dump","HasArg")]
for i in ["help", "Rdep-Check" ]:
for i in ["help", "Rdep-Check"]:
key = "Cruft-Report::Options::%s" % i
if key not in cnf:
cnf[key] = ""
......@@ -551,11 +551,11 @@ def main():
# Set up checks based on mode
if Options["Mode"] == "daily":
checks = ["nbs", "nviu", "nvit", "obsolete source", "outdated non-free", "nfu" ]
checks = ["nbs", "nviu", "nvit", "obsolete source", "outdated non-free", "nfu"]
elif Options["Mode"] == "full":
checks = ["nbs", "nviu", "nvit", "obsolete source", "outdated non-free", "nfu", "dubious nbs", "bnb", "bms", "anais" ]
checks = ["nbs", "nviu", "nvit", "obsolete source", "outdated non-free", "nfu", "dubious nbs", "bnb", "bms", "anais"]
elif Options["Mode"] == "bdo":
checks = ["nbs", "obsolete source" ]
checks = ["nbs", "obsolete source"]
else:
utils.warn("%s is not a recognised mode - only 'full', 'daily' or 'bdo' are understood." % (Options["Mode"]))
usage(1)
......@@ -605,7 +605,7 @@ def main():
source_version = Sources.section.find('Version')
architecture = Sources.section.find('Architecture')
binaries = Sources.section.find('Binary')
binaries_list = [i.strip() for i in binaries.split(',') ]
binaries_list = [i.strip() for i in binaries.split(',')]
if "bnb" in checks:
# Check for binaries not built on any architecture.
......@@ -633,7 +633,7 @@ def main():
for component in check_components:
architectures = [a.arch_string for a in get_suite_architectures(suite_name,
skipsrc=True, skipall=True,
session=session) ]
session=session)]
for architecture in architectures:
if component == 'main/debian-installer' and re.match("kfreebsd", architecture):
continue
......
......@@ -187,7 +187,7 @@ def main():
logger = None
functionality = init()
modules = [command for (command, _) in functionality ]
modules = [command for (command, _) in functionality]
if len(sys.argv) == 0:
daklib.utils.fubar("err, argc == 0? how is that possible?")
......
......@@ -204,9 +204,9 @@ def foldable_output(title, elementnameprefix, content, norow=False):
def get_depends_parts(depend) :
v_match = re_version.match(depend)
if v_match:
d_parts = {'name' : v_match.group(1), 'version' : v_match.group(2) }
d_parts = {'name' : v_match.group(1), 'version' : v_match.group(2)}
else :
d_parts = {'name' : depend , 'version' : '' }
d_parts = {'name' : depend , 'version' : ''}
return d_parts
......@@ -388,7 +388,7 @@ def create_depends_string(suite, depends_tree, session=None):
result += ", "
or_count = 1
for d in l:
if (or_count >= 2 ):
if (or_count >= 2):
result += " | "
# doesn't do version lookup yet.
......@@ -652,7 +652,7 @@ def main():
Arguments = [('h',"help","Examine-Package::Options::Help"),
('H',"html-output","Examine-Package::Options::Html-Output"),
]
for i in ["Help", "Html-Output", "partial-html" ]:
for i in ["Help", "Html-Output", "partial-html"]:
key = "Examine-Package::Options::%s" % i
if key not in Cnf:
Cnf[key] = ""
......
......@@ -79,9 +79,9 @@ def main(argv=None):
sources = suite.sources
files = []
files.extend([b.poolfile for b in binaries ])
files.extend([b.poolfile for b in binaries])
for s in sources:
files.extend([ds.poolfile for ds in s.srcfiles ])
files.extend([ds.poolfile for ds in s.srcfiles])
with FilesystemTransaction() as fs:
for f in files:
......
......@@ -122,7 +122,7 @@ def external_overrides_copy(from_suite_name, to_suite_name, force=False):
session.execute("""
INSERT INTO external_overrides (suite, component, package, key, value)
SELECT :to_suite, component, package, key, value FROM external_overrides WHERE suite = :from_suite
""", {'from_suite': from_suite.suite_id, 'to_suite': to_suite.suite_id })
""", {'from_suite': from_suite.suite_id, 'to_suite': to_suite.suite_id})
session.commit()
......
......@@ -389,7 +389,7 @@ def main():
if "PatchName" not in Options:
format = "%Y-%m-%d-%H%M.%S"
Options["PatchName"] = time.strftime(format )
Options["PatchName"] = time.strftime(format)
session = DBConn().session()
......@@ -398,7 +398,7 @@ def main():
if Options.get('Archive'):
archives = [a.strip() for a in Options['Archive'].split(',')]
query = query.join(Suite.archive).filter(Archive.archive_name.in_(archives))
suites = [s.suite_name for s in query ]
suites = [s.suite_name for s in query]
for suitename in suites:
print "Processing: " + suitename
......@@ -413,7 +413,7 @@ def main():
continue
architectures = get_suite_architectures(suite, skipall=True, session=session)
components = [c.component_name for c in session.query(Component.component_name) ]
components = [c.component_name for c in session.query(Component.component_name)]
suite_suffix = Cnf.find("Dinstall::SuiteSuffix")
if components and suite_suffix:
......
......@@ -422,7 +422,7 @@ def main():
session.execute("LOCK TABLE bin_associations IN SHARE MODE")
for s in suites:
component_ids = [c.component_id for c in s.components ]
component_ids = [c.component_id for c in s.components]
if s.untouchable and not force:
import daklib.utils
daklib.utils.fubar("Refusing to touch %s (untouchable and not forced)" % s.suite_name)
......
......@@ -293,7 +293,7 @@ class ReleaseWriter(object):
subattribs = (('Archive', 'suite_name'),
('Origin', 'origin'),
('Label', 'label'),
('Version', 'version') )
('Version', 'version'))
# Boolean stuff. If we find it true in database, write out "yes" into the release file
boolattrs = (('NotAutomatic', 'notautomatic'),
......@@ -331,7 +331,7 @@ class ReleaseWriter(object):
out.write("Architectures: %s\n" % (" ".join([a.arch_string for a in architectures])))
components = [c.component_name for c in suite.components ]
components = [c.component_name for c in suite.components]
out.write("Components: %s\n" % (" ".join(components)))
......
......@@ -87,7 +87,7 @@ changes
--lower-limit
0
-E
""" % (name.upper(), title) ).strip().split("\n")
""" % (name.upper(), title)).strip().split("\n")
if year_lines:
rrd_args += ["--x-grid", "MONTH:1:YEAR:1:YEAR:1:31536000:%Y"]
......@@ -131,7 +131,7 @@ packages
--lower-limit
0
-E
""" % (name.upper(), title) ).strip().split("\n")
""" % (name.upper(), title)).strip().split("\n")
if year_lines:
rrd_args += ["--x-grid", "MONTH:1:YEAR:1:YEAR:1:31536000:%Y"]
......@@ -177,7 +177,7 @@ def main():
('r',"rrd","Graph::Options::Rrd", "HasArg"),
('i',"images","Graph::Options::Images", "HasArg"),
('n',"names","Graph::Options::Names", "HasArg")]
for i in ["help" ]:
for i in ["help"]:
key = "Graph::Options::%s" % i
if key not in Cnf:
Cnf[key] = ""
......
......@@ -222,7 +222,7 @@ def main(argv=None):
suite = session.query(Suite).filter_by(suite_name=suite_name).one()
component = session.query(Component).filter_by(component_name=component_name).one()
keyrings = session.query(Keyring).filter_by(active=True).order_by(Keyring.priority)
keyring_files = [k.keyring_name for k in keyrings ]
keyring_files = [k.keyring_name for k in keyrings]
dump = options.find('Dump') or None
if options.find_b('Export'):
......
......@@ -96,7 +96,7 @@ def main():
]
for i in ["help", "report-changes", "generate-users",
"import-ldap-users", "list-uids", "no-action" ]:
"import-ldap-users", "list-uids", "no-action"]:
key = "Import-Keyring::Options::%s" % i
if key not in cnf:
cnf[key] = ""
......
......@@ -62,7 +62,7 @@ def main():
('q', "quiet", "Import-Users-From-Passwd::Options::Quiet"),
('v', "verbose", "Import-Users-From-Passwd::Options::Verbose"),
('h', "help", "Import-Users-From-Passwd::Options::Help")]
for i in ["no-action", "quiet", "verbose", "help" ]:
for i in ["no-action", "quiet", "verbose", "help"]:
key = "Import-Users-From-Passwd::Options::%s" % i
if key not in cnf:
cnf[key] = ""
......
......@@ -132,10 +132,10 @@ def create_directories():
do_dir(os.path.join(queue.path, "COMMENTS"), '%s queue comments' % queue.queue_name)
for config_name in ["Rm::LogFile",
"Import-Archive::ExportDir" ]:
"Import-Archive::ExportDir"]:
process_file(Cnf, config_name)
for subdir in ["Clean-Queues", "Clean-Suites" ]:
for subdir in ["Clean-Queues", "Clean-Suites"]:
process_morguesubdir(subdir)
suite_suffix = "%s" % (Cnf.find("Dinstall::SuiteSuffix"))
......@@ -184,7 +184,7 @@ def main():
Cnf = utils.get_conf()
arguments = [('h', "help", "Init-Dirs::Options::Help")]
for i in ["help" ]:
for i in ["help"]:
key = "Init-Dirs::Options::%s" % i
if key not in Cnf:
Cnf[key] = ""
......
......@@ -80,7 +80,7 @@ def main():
('h', "help", "Ls::Options::Help")]
for i in ["architecture", "binarytype", "component", "format",
"greaterorequal", "greaterthan", "regex", "suite",
"source-and-binary", "help" ]:
"source-and-binary", "help"]:
key = "Ls::Options::%s" % i
if key not in cnf:
cnf[key] = ""
......
......@@ -73,7 +73,7 @@ def main():
('a',"archive","Make-Maintainers::Options::Archive",'HasArg'),
('s',"source","Make-Maintainers::Options::Source"),
('p',"print","Make-Maintainers::Options::Print")]
for i in ["Help", "Source", "Print" ]:
for i in ["Help", "Source", "Print"]:
key = "Make-Maintainers::Options::%s" % i
if key not in cnf:
cnf[key] = ""
......
......@@ -104,7 +104,7 @@ def do_list(output_file, suite, component, otype, session):
def main():
cnf = Config()
Arguments = [('h',"help","Make-Overrides::Options::Help")]
for i in ["help" ]:
for i in ["help"]:
key = "Make-Overrides::Options::%s" % i
if key not in cnf:
cnf[key] = ""
......
......@@ -94,7 +94,7 @@ def do_Approve(): sudo("A", _do_Approve, True)
def _do_Approve():
print "Locking unchecked"
with os.fdopen(os.open('/srv/security-master.debian.org/lock/unchecked.lock', os.O_CREAT | os.O_RDWR ), 'r') as lock_fd:
with os.fdopen(os.open('/srv/security-master.debian.org/lock/unchecked.lock', os.O_CREAT | os.O_RDWR), 'r') as lock_fd:
while True:
try:
fcntl.flock(lock_fd, fcntl.LOCK_EX | fcntl.LOCK_NB)
......
......@@ -60,7 +60,7 @@ def main(argv=None):
rejectdir = cnf['Dir::Reject']
if len(filenames) == 0:
filenames = [fn for fn in os.listdir(options['Directory']) if fn.endswith('.dak-commands') ]
filenames = [fn for fn in os.listdir(options['Directory']) if fn.endswith('.dak-commands')]
for fn in filenames:
basename = os.path.basename(fn)
......
......@@ -212,7 +212,7 @@ def edit_new(overrides, upload, session):
temp_file.close()
os.unlink(temp_filename)
overrides_map = dict([((o['type'], o['package']), o) for o in overrides ])
overrides_map = dict([((o['type'], o['package']), o) for o in overrides])
new_overrides = []
# Parse the new data
for line in lines:
......@@ -401,7 +401,7 @@ def check_pkg(upload, upload_copy, session):
def do_bxa_notification(new, upload, session):
cnf = Config()
new = set([o['package'] for o in new if o['type'] == 'deb' ])
new = set([o['package'] for o in new if o['type'] == 'deb'])
if len(new) == 0:
return
......@@ -581,7 +581,7 @@ def do_new(upload, upload_copy, handler, session):
answer = m.group(1)
answer = answer[:1].upper()
if answer in ('A', 'E', 'M', 'O', 'R' ) and Options["Trainee"]:
if answer in ('A', 'E', 'M', 'O', 'R') and Options["Trainee"]:
utils.warn("Trainees can't do that")
continue
......@@ -734,7 +734,7 @@ def do_pkg(upload, session):
def show_new_comments(uploads, session):
sources = [upload.changes.source for upload in uploads ]
sources = [upload.changes.source for upload in uploads]
if len(sources) == 0:
return
......
......@@ -64,7 +64,7 @@ Logger = None
def do_comments(dir, srcqueue, opref, npref, line, fn, transaction):
session = transaction.session
actions = []
for comm in [x for x in os.listdir(dir) if x.startswith(opref) ]:
for comm in [x for x in os.listdir(dir) if x.startswith(opref)]:
lines = open(os.path.join(dir, comm)).readlines()
if len(lines) == 0 or lines[0] != line + "\n":
continue
......@@ -242,7 +242,7 @@ def comment_accept(upload, srcqueue, comments, transaction):
if copydir is not None:
mode = upload.target_suite.archive.mode
if upload.source is not None:
for f in [df.poolfile for df in upload.source.srcfiles ]:
for f in [df.poolfile for df in upload.source.srcfiles]:
dst = os.path.join(copydir, f.basename)
if not os.path.exists(dst):
fs.copy(f.fullpath, dst, mode=mode)
......@@ -317,7 +317,7 @@ def real_comment_reject(upload, srcqueue, comments, transaction, notify=True, ma
files = [af.path for af in session.query(ArchiveFile) \
.filter_by(archive=upload.policy_queue.suite.archive) \
.join(ArchiveFile.file) \
.filter(PoolFile.file_id.in_([f.file_id for f in poolfiles ])) ]
.filter(PoolFile.file_id.in_([f.file_id for f in poolfiles]))]
for byhand in upload.byhand:
path = os.path.join(queuedir, byhand.filename)
if os.path.exists(path):
......@@ -404,8 +404,8 @@ def get_processed_upload(upload):
pu.changed_by = upload.changes.changedby
pu.fingerprint = upload.changes.fingerprint
pu.suites = [upload.target_suite ]
pu.from_policy_suites = [upload.target_suite ]
pu.suites = [upload.target_suite]
pu.from_policy_suites = [upload.target_suite]
changes_path = os.path.join(upload.policy_queue.path, upload.changes.changesname)
pu.changes = open(changes_path, 'r').read()
......
......@@ -332,7 +332,7 @@ def real_reject(directory, upload, reason=None, notify=True):
fs = upload.transaction.fs
rejectdir = cnf['Dir::Reject']
files = [f.filename for f in upload.changes.files.itervalues() ]
files = [f.filename for f in upload.changes.files.itervalues()]
files.append(upload.changes.filename)
for fn in files:
......@@ -488,7 +488,7 @@ def process_it(directory, changes, keyrings):
def process_changes(changes_filenames):
session = DBConn().session()
keyrings = session.query(Keyring).filter_by(active=True).order_by(Keyring.priority)
keyring_files = [k.keyring_name for k in keyrings ]
keyring_files = [k.keyring_name for k in keyrings]
session.close()
changes = []
......
......@@ -454,7 +454,7 @@ def process_queue(queue, log, rrd_dir):
if len(source) > max_source_len:
max_source_len = len(source)
binary_list = i[1]["list"][0].binaries
binary = ', '.join([b.package for b in binary_list ])
binary = ', '.join([b.package for b in binary_list])
arches = set()
versions = set()
for j in i[1]["list"]:
......@@ -638,7 +638,7 @@ def main():
('a',"age","Queue-Report::Options::Age", "HasArg"),
('r',"rrd","Queue-Report::Options::Rrd", "HasArg"),
('d',"directories","Queue-Report::Options::Directories", "HasArg")]
for i in ["help" ]:
for i in ["help"]:
key = "Queue-Report::Options::%s" % i
if key not in Cnf:
Cnf[key] = ""
......@@ -660,7 +660,7 @@ def main():
elif "Queue-Report::Directories" in Cnf:
queue_names = Cnf.value_list("Queue-Report::Directories")
else:
queue_names = ["byhand", "new" ]
queue_names = ["byhand", "new"]
if "Queue-Report::Options::Rrd" in Cnf:
rrd_dir = Cnf["Queue-Report::Options::Rrd"]
......
......@@ -143,7 +143,7 @@ def main():
for i in ['NoArchAllRdeps',
"architecture", "binary", "binary-only", "carbon-copy", "component",
"done", "help", "no-action", "partial", "rdep-check", "reason",
"source-only", "Do-Close" ]:
"source-only", "Do-Close"]:
key = "Rm::Options::%s" % (i)
if key not in cnf:
cnf[key] = ""
......@@ -189,7 +189,7 @@ def main():
field = "b.package"
else:
field = "s.source"
con_packages = "AND %s IN (%s)" % (field, ", ".join([repr(i) for i in arguments ]))
con_packages = "AND %s IN (%s)" % (field, ", ".join([repr(i) for i in arguments]))
(con_suites, con_architectures, con_components, check_source) = \
utils.parse_args(Options)
......
......@@ -178,7 +178,7 @@ def do_pkg(upload_id):
with open(htmlfile, 'w') as outfile, \
policy.UploadCopy(upload, group=group) as upload_copy:
handler = policy.PolicyQueueUploadHandler(upload, session)
missing = [(o['type'], o['package']) for o in handler.missing_overrides() ]
missing = [(o['type'], o['package']) for o in handler.missing_overrides()]
distribution = changes.distribution
print >>outfile, html_header(changes.source, missing)
......@@ -251,7 +251,7 @@ def main():
pool = DakProcessPool(processes=5)
session = DBConn().session()
upload_ids = [u.id for u in init(session) ]