diff options
author | Valerie R Young <spectranaut@riseup.net> | 2016-07-11 17:32:58 -0400 |
---|---|---|
committer | Holger Levsen <holger@layer-acht.org> | 2016-07-24 11:46:02 -0400 |
commit | 1f6e833815c011e56ab77a258b4eee94a8acaf43 (patch) | |
tree | 8df6e0678eb99b6110ff9506e2f7c0115cd5f2cc /bin/reproducible_html_pkg_sets.py | |
parent | 0b4d9e94923280e5e836105a8b82e9b01f1714d0 (diff) | |
download | jenkins.debian.net-1f6e833815c011e56ab77a258b4eee94a8acaf43.tar.xz |
reproducible debian: move html from code into basic_page template
Signed-off-by: Holger Levsen <holger@layer-acht.org>
Diffstat (limited to 'bin/reproducible_html_pkg_sets.py')
-rwxr-xr-x | bin/reproducible_html_pkg_sets.py | 33 |
1 files changed, 8 insertions, 25 deletions
diff --git a/bin/reproducible_html_pkg_sets.py b/bin/reproducible_html_pkg_sets.py index 89652aa5..f5dc9fab 100755 --- a/bin/reproducible_html_pkg_sets.py +++ b/bin/reproducible_html_pkg_sets.py @@ -24,8 +24,6 @@ pkgset_navigation_template = renderer.load_template( os.path.join(TEMPLATE_PATH, 'pkgset_navigation')) pkgset_details_template = renderer.load_template( os.path.join(TEMPLATE_PATH, 'pkgset_details')) -basic_page_template = renderer.load_template( - os.path.join(TEMPLATE_PATH, 'basic_page')) pkg_legend_template = renderer.load_template( os.path.join(TEMPLATE_PATH, 'pkg_symbol_legend')) @@ -140,20 +138,13 @@ def create_pkgset_navigation(suite, arch, view=None): def create_index_page(suite, arch): title = 'Package sets in %s/%s for Reproducible Builds' % (suite, arch) - now = datetime.utcnow().strftime('%Y-%m-%d %H:%M UTC') - page_context = { - 'main_html': create_pkgset_navigation(suite, arch) + - create_default_page_footer(now), - 'main_navigation_html': create_main_navigation(title, suite, arch, - 'pkg_set'), - } - body = renderer.render(basic_page_template, page_context) + body = create_pkgset_navigation(suite, arch) destfile = os.path.join(DEBIAN_BASE, suite, arch, "index_pkg_sets.html") log.info("Creating pkgset index page for %s/%s.", suite, arch) - write_html_page(title=title, body=body, destfile=destfile, - noheader=True, noendpage=True) + write_html_page(title=title, body=body, destfile=destfile, suite=suite, + arch=arch, displayed_page='pkg_set') def gen_other_arch_context(archs, suite, pkgset_name): @@ -184,8 +175,8 @@ def stats_thumb_file_href(suite, arch, pkgset_name): def create_pkgset_page_and_graphs(suite, arch, stats, pkgset_name): - html = "" - html += create_pkgset_navigation(suite, arch, pkgset_name) + html_body = "" + html_body += create_pkgset_navigation(suite, arch, pkgset_name) pkgset_context = ({ 'pkgset_name': pkgset_name, 'suite': suite, @@ -241,23 +232,15 @@ def create_pkgset_page_and_graphs(suite, arch, stats, pkgset_name): stats["count_" + cutename] != 0): pkgset_context['status_details'].append(details_context) - html += renderer.render(pkgset_details_template, pkgset_context) - now = datetime.utcnow().strftime('%Y-%m-%d %H:%M UTC') - html += create_default_page_footer(now) + html_body += renderer.render(pkgset_details_template, pkgset_context) title = 'Reproducible Builds %s package set for %s/%s for' % \ (pkgset_name, suite, arch) - - body = renderer.render(basic_page_template, { - 'main_html': html, - 'main_navigation_html': create_main_navigation(title, suite, arch, - 'pkg_set'), - }) page = "pkg_set_" + pkgset_name + ".html" destfile = os.path.join(DEBIAN_BASE, suite, arch, page) log.info("Creating meta pkgset page for %s in %s/%s.", pkgset_name, suite, arch) - write_html_page(title=title, body=body, destfile=destfile, - noheader=True, noendpage=True) + write_html_page(title=title, body=html_body, destfile=destfile, suite=suite, + arch=arch, displayed_page='pkg_set') def create_pkgset_graph(png_file, suite, arch, pkgset_name): |