diff options
author | Valerie R Young <spectranaut@riseup.net> | 2016-08-02 18:36:51 -0400 |
---|---|---|
committer | Holger Levsen <holger@layer-acht.org> | 2016-08-03 00:40:24 +0200 |
commit | b8bc3d3d2bd2b730871f537b8d78a6dae937249a (patch) | |
tree | b51b0b70cd7cf61bd009d66b91c77293f54d9b52 | |
parent | e6d345ae0845d12d5ec07e8fb3a7c7f19e3e5ed1 (diff) | |
download | jenkins.debian.net-b8bc3d3d2bd2b730871f537b8d78a6dae937249a.tar.xz |
reproducible debian: add cross suite/arch nav for scheduled and maintainers
Signed-off-by: Holger Levsen <holger@layer-acht.org>
-rwxr-xr-x | bin/reproducible_common.py | 34 | ||||
-rwxr-xr-x | bin/reproducible_html_dd_list.py | 4 | ||||
-rwxr-xr-x | bin/reproducible_html_live_status.py | 5 |
3 files changed, 29 insertions, 14 deletions
diff --git a/bin/reproducible_common.py b/bin/reproducible_common.py index 0a027b0b..a149c85e 100755 --- a/bin/reproducible_common.py +++ b/bin/reproducible_common.py @@ -256,11 +256,16 @@ def convert_into_hms_string(duration): def gen_suite_arch_nav_context(suite, arch, suite_arch_nav_template=None, - ignore_experimental=False): - # if a template is not passed in to navigate between suite and archs - # for the current page, we use the suite/arch summary view - if not suite_arch_nav_template: - suite_arch_nav_template = '/debian/{{suite}}/index_suite_{{arch}}_stats.html' + ignore_experimental=False, no_suite=None, + no_arch=None): + # if a template is not passed in to navigate between suite and archs the + # current page, we use the "default" suite/arch summary view. + # OR if there is not suite equivalent for this page, use the default + # for suite links. + default_nav_template = '/debian/{{suite}}/index_suite_{{arch}}_stats.html' + uri_template = suite_arch_nav_template + if not uri_template or no_suite: + uri_template = default_nav_template suite_list = [] for s in SUITES: include_suite = True @@ -268,17 +273,23 @@ def gen_suite_arch_nav_context(suite, arch, suite_arch_nav_template=None, include_suite = False suite_list.append({ 's': s, - 'class': 'current' if s == suite else '', - 'uri': renderer.render(suite_arch_nav_template, + 'class': 'current' if s == suite and not no_suite else '', + 'uri': renderer.render(uri_template, {'suite': s, 'arch': arch}) if include_suite else '', }) + + # if there is no arch equivalents for this page, use the default + # for arch links. + uri_template = suite_arch_nav_template + if not uri_template or no_arch: + uri_template = default_nav_template arch_list = [] for a in ARCHS: arch_list.append({ 'a': a, - 'class': 'current' if a == arch else '', - 'uri': renderer.render(suite_arch_nav_template, + 'class': 'current' if a == arch and not no_arch else '', + 'uri': renderer.render(uri_template, {'suite': suite, 'arch': a}), }) return (suite_list, arch_list) @@ -286,9 +297,10 @@ def gen_suite_arch_nav_context(suite, arch, suite_arch_nav_template=None, # See bash equivelent: reproducible_common.sh's "write_page_header()" def create_main_navigation(suite=defaultsuite, arch=defaultarch, displayed_page=None, suite_arch_nav_template=None, - ignore_experimental=False): + ignore_experimental=False, no_suite=None, + no_arch=None): suite_list, arch_list = gen_suite_arch_nav_context(suite, arch, - suite_arch_nav_template, ignore_experimental) + suite_arch_nav_template, ignore_experimental, no_suite, no_arch) context = { 'suite': suite, 'arch': arch, diff --git a/bin/reproducible_html_dd_list.py b/bin/reproducible_html_dd_list.py index a0d56bc7..24d71307 100755 --- a/bin/reproducible_html_dd_list.py +++ b/bin/reproducible_html_dd_list.py @@ -73,8 +73,10 @@ for suite in SUITES: html += '</pre></p>' title = 'Maintainers of unreproducible packages in ' + suite destfile = DEBIAN_BASE + '/' + suite + '/index_dd-list.html' + suite_arch_nav_template = DEBIAN_URI + '/{{suite}}/index_dd-list.html' left_nav_html = create_main_navigation(suite=suite, arch=arch, - displayed_page='dd_list') + displayed_page='dd_list', no_arch=True, + suite_arch_nav_template=suite_arch_nav_template) write_html_page(title, html, destfile, style_note=True, left_nav_html=left_nav_html) log.info('%s/%s/index_dd-list.html published', DEBIAN_URL, suite) diff --git a/bin/reproducible_html_live_status.py b/bin/reproducible_html_live_status.py index f10c2151..6db9aa7d 100755 --- a/bin/reproducible_html_live_status.py +++ b/bin/reproducible_html_live_status.py @@ -52,8 +52,9 @@ def generate_schedule(arch): html += '</table></p>\n' destfile = DEBIAN_BASE + '/index_' + arch + '_scheduled.html' desturl = DEBIAN_URL + '/index_' + arch + '_scheduled.html' - left_nav_html = create_main_navigation(arch=arch, - displayed_page='scheduled') + suite_arch_nav_template = DEBIAN_URI + '/index_{{arch}}_scheduled.html' + left_nav_html = create_main_navigation(arch=arch, no_suite=True, + displayed_page='scheduled', suite_arch_nav_template=suite_arch_nav_template) write_html_page(title=title, body=html, destfile=destfile, style_note=True, refresh_every=60, left_nav_html=left_nav_html) log.info("Page generated at " + desturl) |