[Reproducible-commits] [misc] 02/06: Please no more string concatentation !

Chris Lamb lamby at moszumanska.debian.org
Fri Sep 11 21:13:53 UTC 2015


This is an automated email from the git hooks/post-receive script.

lamby pushed a commit to branch master
in repository misc.

commit 4ee7a917f3bc94fb0bbb4bd47fa752e3672affe3
Author: Chris Lamb <lamby at debian.org>
Date:   Fri Sep 11 22:10:17 2015 +0100

    Please no more string concatentation !
---
 clean-notes | 26 ++++++++++++++------------
 1 file changed, 14 insertions(+), 12 deletions(-)

diff --git a/clean-notes b/clean-notes
index a2b78cc..ae0a2c0 100755
--- a/clean-notes
+++ b/clean-notes
@@ -269,7 +269,7 @@ def check_bugs(notes):
     bugs_package = {x[1]: x[0] for x in bugs}
     ids = 'id='
     for bug in bugs_list[:-1]:
-        ids += str(bug) + ' OR id='
+        ids += '%s OR id=' % bug
     ids += str(bugs_list[-1])
     rows = query_udd("""SELECT id FROM bugs_usertags WHERE
                      email='reproducible-builds at lists.alioth.debian.org' AND (
@@ -278,8 +278,8 @@ def check_bugs(notes):
         # the results from SELECT are a list of one-element tuples, so we have
         # have to look up 1-tuples with the bug number in the list
         if (bug,) not in rows:
-            log.info("https://bugs.debian.org/" + str(bug) + " in package " +
-                     bugs_package[bug] + " is not usertagged")
+            log.info("https://bugs.debian.org/%s in package %s"
+                "is not usertagged", bug, bugs_package[bug])
 
 
 def find_old_notes(testedpkgs, notes):
@@ -374,17 +374,17 @@ def parse_bugs(bugs):
     OR = ''
     for bug in bugs_list[:-1]:
         if not [i for i in bugs[bug] if i in ignored_tags]:
-            ids += OR + 'b.id=' + str(bug)
+            ids += '%sb.id=%s' % (OR, bug)
             OR = ' OR '
     if not [i for i in bugs[bugs_list[-1]] if i in ignored_tags]:
-        ids += OR + 'b.id=' + str(bugs_list[-1])
+        ids += OR + 'b.id=%s' % bugs_list[-1]
     # the join avoid picking virtual packages
     query = "SELECT DISTINCT b.id, b.source, b.done "
     query += "FROM bugs AS b JOIN sources AS s ON b.source=s.source "
     query += "WHERE %s""" % ids
     log.debug(query)
     rows = query_udd(query)
-    log.info(str(len(rows)) + ' bugs found')
+    log.info('%d bugs found', len(rows))
     for item in rows:
         if item[2]:  # do not consider closed bugs
             continue
@@ -413,17 +413,19 @@ def join_notes_bugs(notes, bugs):
             try:
                 if 'bugs' in notes[package]:
                     if bug not in notes[package]['bugs']:
-                        log.info("https://bugs.debian.org/" + str(bug) +
-                                 " in package " + str(package) +
-                                 " is not listed in notes.git.")
+                        log.info("https://bugs.debian.org/%s"
+                                 " in package %s"
+                                 " is not listed in notes.git.",
+                                 bug, package)
                         notes[package]['bugs'].append(bug)
                 else:
                     log.info("https://bugs.debian.org/%s in %s is not listed "
-                             "in notes.git.", str(bug), str(package))
+                             "in notes.git.", bug, package)
                     notes[package]['bugs'] = [bug]
             except KeyError:
-                log.info("https://bugs.debian.org/" + str(bug) + " in " +
-                         str(package) + " is not listed in notes.git.")
+                log.info("https://bugs.debian.org/%s in "
+                         "%s is not listed in notes.git.",
+                         bug, package)
                 notes[package] = {}
                 notes[package]['bugs'] = [bug]
                 # just try guessing the version (prefers unstable)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/misc.git



More information about the Reproducible-commits mailing list