From ee75142772ff7ad5a147bd4cc6aecdf6f0f13a1c Mon Sep 17 00:00:00 2001 From: Valerie R Young Date: Sat, 25 Jun 2016 06:47:18 -0400 Subject: reproducible debian: add template for default footer [ Mattia Rizzolo ] wrap and indent lines in default_page_footer.mustache Signed-off-by: Mattia Rizzolo Signed-off-by: Holger Levsen --- bin/reproducible_common.py | 29 +++++++++++------------------ bin/reproducible_common.sh | 1 + bin/templates/default_page_footer.mustache | 16 ++++++++++++++++ 3 files changed, 28 insertions(+), 18 deletions(-) create mode 100644 bin/templates/default_page_footer.mustache (limited to 'bin') diff --git a/bin/reproducible_common.py b/bin/reproducible_common.py index 8738a501..c3ea23fd 100755 --- a/bin/reproducible_common.py +++ b/bin/reproducible_common.py @@ -143,6 +143,9 @@ tab = ' ' renderer = pystache.Renderer(); status_icon_link_template = renderer.load_template( TEMPLATE_PATH + '/status_icon_link') +default_page_footer_template = renderer.load_template( + TEMPLATE_PATH + '/default_page_footer') + html_header = Template(""" @@ -165,23 +168,12 @@ else: JOB_FOOTER += JOB_NAME+' which is configured via this ' JOB_FOOTER += 'git repo.' -html_footer = Template(""" -

-""" % (JOB_FOOTER, JENKINS_URL)) +def create_default_page_footer(date): + return renderer.render(default_page_footer_template, { + 'date': date, + 'job_footer': JOB_FOOTER, + 'jenkins_url': JENKINS_URL, + }) html_head_page = Template((tab*2).join(("""
@@ -391,7 +383,8 @@ def write_html_page(title, body, destfile, suite=defaultsuite, arch=defaultarch, if style_note: html += html_foot_page_style_note.substitute() if not noendpage: - html += html_footer.substitute(date=now) + html += create_default_page_footer(now) + html += '\n' else: html += '\n' try: diff --git a/bin/reproducible_common.sh b/bin/reproducible_common.sh index 8b382c23..9a6b8656 100755 --- a/bin/reproducible_common.sh +++ b/bin/reproducible_common.sh @@ -367,6 +367,7 @@ write_page_intro() { fi } +# See the python equivelent of this function: reproducible_common.py's create_default_page_footer write_page_footer() { write_page "

" if [ -n "$JOB_URL" ] ; then diff --git a/bin/templates/default_page_footer.mustache b/bin/templates/default_page_footer.mustache new file mode 100644 index 00000000..1a8c46c5 --- /dev/null +++ b/bin/templates/default_page_footer.mustache @@ -0,0 +1,16 @@ + +

+

+

-- cgit v1.2.3-70-g09d2