From 51090d60544ec7336c7e0250ff6eab43ad154605 Mon Sep 17 00:00:00 2001 From: Holger Levsen Date: Sun, 4 Oct 2015 00:55:21 +0200 Subject: 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(-) (limited to 'bin') diff --git a/bin/reproducible_common.py b/bin/reproducible_common.py index f3251553..f621beaa 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 c8d1689b..cbd18897 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 tag below if section.get('icon_status'): html += 'reproducible icon' if not no_icon_link: html += '' diff --git a/bin/reproducible_html_notes.py b/bin/reproducible_html_notes.py index 1e9b02e8..ad55d0a7 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 + '

\n' - affected += tab*5 + '\n' affected += tab*5 + str(len(pkgs)) + ' ' + status + ' packages in ' + suite + '/' + arch +':\n' affected += tab*5 + '\n' diff --git a/bin/reproducible_html_packages.py b/bin/reproducible_html_packages.py index a693227b..a5875b75 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 + '{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 + ' {} in {}\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( -- cgit v1.2.3-70-g09d2