[Qa-jenkins-scm] [jenkins.debian.net] 02/02: reproducible: rename join_status_icon() to get_status_icon() and drop unused code

Holger Levsen holger at moszumanska.debian.org
Sat Oct 3 22:56:31 UTC 2015


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

holger pushed a commit to branch master
in repository jenkins.debian.net.

commit 51090d60544ec7336c7e0250ff6eab43ad154605
Author: Holger Levsen <holger at layer-acht.org>
Date:   Sun Oct 4 00:55:21 2015 +0200

    reproducible: rename join_status_icon() to get_status_icon() and drop unused code
---
 bin/reproducible_common.py        | 7 ++-----
 bin/reproducible_html_indexes.py  | 4 ++--
 bin/reproducible_html_notes.py    | 2 +-
 bin/reproducible_html_packages.py | 4 ++--
 4 files changed, 7 insertions(+), 10 deletions(-)

diff --git a/bin/reproducible_common.py b/bin/reproducible_common.py
index f325155..f621bea 100755
--- a/bin/reproducible_common.py
+++ b/bin/reproducible_common.py
@@ -426,7 +426,7 @@ def link_packages(packages, suite, arch):
     return html
 
 
-def join_status_icon(status, package=None, version=None):
+def get_status_icon(status):
     table = {'reproducible' : 'weather-clear.png',
              'FTBFS': 'weather-storm.png',
              'FTBR' : 'weather-showers-scattered.png',
@@ -440,13 +440,10 @@ def join_status_icon(status, package=None, version=None):
             status = 'FTBR'
     elif status == 'not for us':
             status = 'not_for_us'
-    log.debug('Linking status ⇔ icon. package: ' + str(package) + ' @ ' +
-              str(version) + ' status: ' + status)
     try:
         return (status, table[status])
     except KeyError:
-        log.error('Status of package ' + package + ' (' + status +
-                  ') not recognized')
+        log.error('Status ' + status + ' not recognized')
         return (status, '')
 
 def strip_epoch(version):
diff --git a/bin/reproducible_html_indexes.py b/bin/reproducible_html_indexes.py
index c8d1689..cbd1889 100755
--- a/bin/reproducible_html_indexes.py
+++ b/bin/reproducible_html_indexes.py
@@ -24,7 +24,7 @@ Reference doc for the folowing lists:
     the string above
   + `body`: a list of dicts containing every section that made up the page.
     Every section has:
-    - `icon_status`: the name of a icon (see join_status_icon())
+    - `icon_status`: the name of a icon (see get_status_icon())
     - `icon_link`: a link to hide below the icon
     - `query`: query to perform against the reproducible db to get the list of
       packages to show
@@ -423,7 +423,7 @@ def build_leading_text_section(section, rows, suite, arch):
         no_icon_link = True  # to avoid closing the </a> tag below
     if section.get('icon_status'):
         html += '<img src="/static/'
-        html += join_status_icon(section['icon_status'])[1]
+        html += get_status_icon(section['icon_status'])[1]
         html += '" alt="reproducible icon" />'
     if not no_icon_link:
         html += '</a>'
diff --git a/bin/reproducible_html_notes.py b/bin/reproducible_html_notes.py
index 1e9b02e..ad55d0a 100755
--- a/bin/reproducible_html_notes.py
+++ b/bin/reproducible_html_notes.py
@@ -276,7 +276,7 @@ def gen_html_issue(issue, suite):
             if not pkgs:
                 continue
             affected += tab*4 + '<p>\n'
-            affected += tab*5 + '<img src="/static/' + join_status_icon(status)[1] + '"'
+            affected += tab*5 + '<img src="/static/' + get_status_icon(status)[1] + '"'
             affected += ' alt="' + status + ' icon" />\n'
             affected += tab*5 + str(len(pkgs)) + ' ' + status + ' packages in ' + suite + '/' + arch +':\n'
             affected += tab*5 + '<code>\n'
diff --git a/bin/reproducible_html_packages.py b/bin/reproducible_html_packages.py
index a693227..a5875b7 100755
--- a/bin/reproducible_html_packages.py
+++ b/bin/reproducible_html_packages.py
@@ -199,7 +199,7 @@ def gen_suites_links(package, current_suite, current_arch):
                 prefix = ''
                 suffix = '\n'
             icon = prefix + '<img src="/static/{icon}" alt="{status}" title="{status}"/>' + suffix
-            html += icon.format(icon=join_status_icon(status)[1], status=status)
+            html += icon.format(icon=get_status_icon(status)[1], status=status)
             html += (tab*2 + ' <a href="{}/{}/{}/{}.html" target="_parent"' + \
                      ' title="{}: {}{}">{}</a> in <a href="/{}/{}/" target="_parent">{}</a>\n').format(RB_PKG_URI,
                      s, a, package.name, status, version, build_date, version, s, a, s)
@@ -238,7 +238,7 @@ def gen_packages_html(packages, no_clean=False):
                 links, default_view = gen_extra_links(
                     pkg, version, suite, arch, status)
                 suites_links = gen_suites_links(package, suite, arch)
-                status, icon = join_status_icon(status, pkg, version)
+                status, icon = get_status_icon(status)
                 status = gen_status_link_icon(status, icon, suite, arch)
 
                 html = html_package_page.substitute(

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/qa/jenkins.debian.net.git



More information about the Qa-jenkins-scm mailing list