[Piuparts-commits] [SCM] piuparts git repository branch, develop, updated. 0.42-38-geb6a96f
Holger Levsen
holger at layer-acht.org
Sat Jan 21 18:13:56 UTC 2012
The following commit has been merged in the develop branch:
commit eb6a96fef91f612f5d3c562f78746180ea30c893
Author: Holger Levsen <holger at layer-acht.org>
Date: Sat Jan 21 11:59:35 2012 +0100
piuparts-reports: improve handling of static pages with templates. create bug_howto.tpl and link to the html page from navigation area
diff --git a/piuparts-report.py b/piuparts-report.py
index a90befa..ca3cc05 100644
--- a/piuparts-report.py
+++ b/piuparts-report.py
@@ -1,7 +1,7 @@
#!/usr/bin/python
#
# Copyright 2005 Lars Wirzenius (liw at iki.fi)
-# Copyright 2009-2010 Holger Levsen (holger at layer-acht.org)
+# Copyright 2009-2012 Holger Levsen (holger at layer-acht.org)
#
# This program is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
@@ -123,6 +123,11 @@ HTML_HEADER = """
</tr>
<tr class="normalrow">
<td class="contentcell">
+ <a href="/bug_howto.html">How to file bugs</a>
+ </td>
+ </tr>
+ <tr class="normalrow">
+ <td class="contentcell">
<a href="http://www.debian.org/doc/debian-policy/" target="_blank">Debian policy</a>
</td>
</tr>
@@ -299,6 +304,7 @@ ANALYSIS_BODY_TEMPLATE = """
"""
# this template is normally replaced with from $htdocs
+# FIXME: once piatti.git is merged, drop this template here and always use that from $htdocs
INDEX_BODY_TEMPLATE = """
<table class="righttable">
<tr class="titlerow">
@@ -1111,18 +1117,21 @@ def main():
section.generate_output(master_directory=master_directory,output_directory=output_directory,section_names=section_names)
sections.append(section)
- # main page
- logging.debug("Writing index page")
- # FIXME: I'm sure the next 3 lines can be written more elegant..
+ # static pages
+ logging.debug("Writing static pages")
+ # FIXME: simplify code once piatti.git is merged
INDEX_BODY = INDEX_BODY_TEMPLATE
- if os.path.isfile(os.path.join(output_directory,"index.tpl")):
- INDEX_BODY = "".join(read_file(os.path.join(output_directory,"index.tpl")))
- htmlpage = string.Template(HTML_HEADER + INDEX_BODY + HTML_FOOTER)
- write_file(os.path.join(output_directory,"index.html"), htmlpage.safe_substitute( {
+ for page in ("index", "bug_howto"):
+ tpl = os.path.join(output_directory,page+".tpl")
+ if os.path.isfile(tpl):
+ INDEX_BODY = "".join(read_file(tpl))
+ htmlpage = string.Template(HTML_HEADER + INDEX_BODY + HTML_FOOTER)
+ write_file(os.path.join(output_directory,page+".html"), htmlpage.safe_substitute( {
"page_title": "About piuparts.d.o and News",
"section_navigation": create_section_navigation(section_names),
"time": time.strftime("%Y-%m-%d %H:%M %Z"),
}))
+
# daily report
# FIXME:
#generate_daily_report();
--
piuparts git repository
More information about the Piuparts-commits
mailing list