[Piuparts-commits] rev 644 - trunk

Holger Levsen holger at alioth.debian.org
Tue Feb 23 01:17:56 UTC 2010


Author: holger
Date: 2010-02-23 01:17:55 +0000 (Tue, 23 Feb 2010)
New Revision: 644

Modified:
   trunk/piuparts-report.py
Log:
provide links to maintainers page in other distributions

Modified: trunk/piuparts-report.py
===================================================================
--- trunk/piuparts-report.py	2010-02-22 19:54:18 UTC (rev 643)
+++ trunk/piuparts-report.py	2010-02-23 01:17:55 UTC (rev 644)
@@ -268,6 +268,19 @@
    </table>
 """
 
+MAINTAINER_BODY_TEMPLATE = """
+   <table class="righttable">
+    <tr class="titlerow">
+     <td class="titlecell" colspan="6">
+      $maintainer
+     </td>
+    </tr>
+    $distrolinks
+    $rows
+   </table>
+"""
+
+
 SOURCE_PACKAGE_BODY_TEMPLATE = """
    <table class="righttable">
     $rows
@@ -705,12 +718,22 @@
                      rows += file.read(f)
                      f.close()
                      os.unlink(filename)
-     
-            htmlpage = string.Template(HTML_HEADER + SOURCE_PACKAGE_BODY_TEMPLATE + HTML_FOOTER)
+
+            maintainer = os.path.basename(maint_tpl[:-len("_tpl")])
+
+            distrolinks = "<tr class=\"normalrow\"><td class=\"labelcell\">other distributions: </td><td class=\"contentcell2\" colspan=\"5\">"
+            for section in self._section_names:
+              if section != self._config.section:
+                distrolinks += "<a href=\"/"+section+"/maintainer/"+maintainer_subdir(maintainer)+"/"+maintainer+".html\">"+html_protect(section)+"</a> "
+            distrolinks += "</td></tr>"
+
+            htmlpage = string.Template(HTML_HEADER + MAINTAINER_BODY_TEMPLATE + HTML_FOOTER)
             filename = template_path+".html"
             f = file(filename, "w")
             f.write(htmlpage.safe_substitute( {
-               "page_title": html_protect("Status of "+os.path.basename(maint_tpl[:-len("_tpl")])+" packages in "+self._config.section),               
+               "page_title": html_protect("Status of "+maintainer+" packages in "+self._config.section),
+               "maintainer": html_protect(maintainer+" in "+self._config.section),
+               "distrolinks": distrolinks,
                "section_navigation": create_section_navigation(self._section_names,self._config.section),
                "time": time.strftime("%Y-%m-%d %H:%M %Z"),
                "rows": rows,




More information about the Piuparts-commits mailing list