[Qa-jenkins-scm] [jenkins.debian.net] 04/05: reproducible: html_indexes: also support a header_query keyword, to format the header line

Holger Levsen holger at moszumanska.debian.org
Thu Apr 16 14:45:24 UTC 2015


This is an automated email from the git hooks/post-receive script.

holger pushed a commit to branch master
in repository jenkins.debian.net.

commit bb66d9459d8e74f5fb0f0526af644a73f99b6d0d
Author: Mattia Rizzolo <mattia at mapreri.org>
Date:   Mon Apr 13 03:42:56 2015 +0200

    reproducible: html_indexes: also support a header_query keyword, to format the header line
---
 bin/reproducible_html_indexes.py | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/bin/reproducible_html_indexes.py b/bin/reproducible_html_indexes.py
index 700d6f0..5636906 100755
--- a/bin/reproducible_html_indexes.py
+++ b/bin/reproducible_html_indexes.py
@@ -20,6 +20,8 @@ Reference doc for the folowing lists:
   element is a page. Every page has:
   + `title`: The page title
   + `header`: (optional) sane html to be printed on top of the page
+  + `header_query`: (optional): the output of this query is put inside "tot" of
+    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())
@@ -341,7 +343,11 @@ def build_page(page, suite=None, arch=None):
     html = ''
     footnote = False
     if pages[page].get('header'):
-        html += pages[page].get('header')
+        if pages[page].get('header_query'):
+            html += pages[page]['header'].format(
+                tot=query_db(pages[page]['header_query'])[0][0])
+        else:
+            html += pages[page].get('header')
     for section in page_sections:
         if gpage:
             if section.get('nosuite') and section['nosuite']:  # only defaults

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/qa/jenkins.debian.net.git



More information about the Qa-jenkins-scm mailing list