summaryrefslogtreecommitdiffstats
path: root/bin/reproducible_common.py
diff options
context:
space:
mode:
authorValerie R Young <spectranaut@riseup.net>2016-08-02 18:36:51 -0400
committerHolger Levsen <holger@layer-acht.org>2016-08-03 00:40:24 +0200
commitb8bc3d3d2bd2b730871f537b8d78a6dae937249a (patch)
treeb51b0b70cd7cf61bd009d66b91c77293f54d9b52 /bin/reproducible_common.py
parente6d345ae0845d12d5ec07e8fb3a7c7f19e3e5ed1 (diff)
downloadjenkins.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>
Diffstat (limited to 'bin/reproducible_common.py')
-rwxr-xr-xbin/reproducible_common.py34
1 files changed, 23 insertions, 11 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,