From: Luca Falavigna Date: Sun, 1 Aug 2010 20:35:44 +0000 (+0000) Subject: Some code cleanups X-Git-Url: https://git.decadent.org.uk/gitweb/?a=commitdiff_plain;h=ecc3e4dbd56f9fff6e0d0a012aea3d00f1890591;p=dak.git Some code cleanups Signed-off-by: Luca Falavigna --- diff --git a/dak/rm.py b/dak/rm.py index 2d502e08..2bd96eec 100755 --- a/dak/rm.py +++ b/dak/rm.py @@ -520,19 +520,19 @@ def main (): if element[2].find("source") > 0: sources.append("%s_%s" % tuple(elem.strip(" ") for elem in element[:2])) element[2] = sub("source\s?,?", "", element[2]).strip(" ") - if len(element[2]): + if element[2]: binaries.append("%s_%s [%s]" % tuple(elem.strip(" ") for elem in element)) - if len(sources): + if sources: logfile822.write("Sources:\n") for source in sources: logfile822.write(" %s\n" % source) - if len(binaries): + if binaries: logfile822.write("Binaries:\n") for binary in binaries: logfile822.write(" %s\n" % binary) - logfile822.write("Reason: %s\n" % (Options["Reason"])) + logfile822.write("Reason: %s\n" % Options["Reason"]) if Options["Done"]: - logfile822.write("Bug: %s\n" % (Options["Done"])) + logfile822.write("Bug: %s\n" % Options["Done"]) logfile822.write("\n") logfile822.flush() logfile822.close() diff --git a/tools/rm822.py b/tools/rm822.py index 3fd91277..57a5060d 100755 --- a/tools/rm822.py +++ b/tools/rm822.py @@ -32,13 +32,13 @@ for removal in removals: if element[2].find('source') > 0: sources.append(' %s_%s' % tuple(elem.strip(' ') for elem in element[:2])) element[2] = re.sub('source\s?,?', '', element[2]).strip(' ') - if len(element[2]): + if element[2]: binaries.append(' %s_%s [%s]' % tuple(elem.strip(' ') for elem in element)) - if len(sources): + if sources: print 'Sources:' for source in sources: print source - if len(binaries): + if binaries: print 'Binaries:' for binary in binaries: print binary