[Piuparts-commits] rev 348 - in trunk: . debian

Holger Levsen holger at alioth.debian.org
Fri Apr 17 20:46:57 UTC 2009


Author: holger
Date: 2009-04-17 20:46:57 +0000 (Fri, 17 Apr 2009)
New Revision: 348

Modified:
   trunk/debian/changelog
   trunk/piuparts-report.py
Log:
-    - provide links to source packages pages from state pages.
+    - provide links to source packages pages from state pages and back.



Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog	2009-04-17 19:52:51 UTC (rev 347)
+++ trunk/debian/changelog	2009-04-17 20:46:57 UTC (rev 348)
@@ -32,12 +32,9 @@
   * Re-add piuparts-reports.py which got removed/lost between 0.14 and 0.20 
     without changelog entry.
   * piuparts-reports.py: 
-    - print "unknown-package" bold in state reports.
     - support sections in configuration file. 
     - support looping trough multiple sections in report.conf via new config
       value "sections". 
-    - provide links to logfiles in statistics page.
-    - improve layout, generate navigation for all pages.
     - generate counts.txt (per section) with raw numbers of packages per state,
       include these stats in the debug output (so it gets included in the mails
       send by cron.)
@@ -45,7 +42,9 @@
     - generate sources.txt (per section) with a summary status per source
       package (for the PTS to display a source packages piuparts state)
     - generate html status pages for all source packages (to link from the PTS)
-    - provide links to source status pages from state pages.
+    - provide links to logfiles in statistics page.
+    - provide links to source packages pages from state pages and back.
+    - improve layout, generate navigation for all pages.
   * Break backwards compatibility of the configuration files for master-slave-
     mode. Merge those three into one: /etc/piuparts/piuparts/piuparts.conf.
     Introduce a new global section in piuparts.conf which is shared among the

Modified: trunk/piuparts-report.py
===================================================================
--- trunk/piuparts-report.py	2009-04-17 19:52:51 UTC (rev 347)
+++ trunk/piuparts-report.py	2009-04-17 20:46:57 UTC (rev 348)
@@ -606,12 +606,19 @@
                                 desc_by_dir[dir], list)
 
 
-    def link_to_source_summary(self,_source_package):
+    def link_to_source_summary(self, package_name):
         link = "<a href=\"/source/%s\">%s</a>" % (
-                source_subdir(_source_package)+"/"+_source_package+".html",
-                html_protect(_source_package))
+                source_subdir(package_name)+"/"+package_name+".html",
+                html_protect(package_name))
         return link
 
+    def link_to_state_page(self, section, package_name, state):
+        link = "<a href=\"/%s/%s\">%s</a>" % (
+                section,
+                state+".html"+"#"+package_name,
+                state)
+        return link
+
     def generate_html_output(self):
         logging.debug("Finding log files")
         dirs = ["pass", "fail", "bugged", "fixed", "reserved", "untestable"]
@@ -656,7 +663,8 @@
             logging.debug("Writing page for %s" % state)
             list = "<ul>\n"
             for package in self._binary_db.get_packages_in_state(state):
-                list += "<li>%s (%s)" % (
+                list += "<li id=\"%s\">%s (%s)" % (
+                                         package["Package"]),
                                          self.link_to_source_summary(self._binary_db.get_source_package(package["Package"])),
                                          html_protect(package["Maintainer"]))
                 if package.dependencies():
@@ -733,7 +741,7 @@
             binaryrows = "<tr class=\"titlerow\"><td class=\"titlecell\" colspan=\"3\">Binary package(s) in "+self._config.section+"</td></tr>"
             for binary in binaries.split(", "):
               state = self._binary_db.state_by_name(binary)
-              binaryrows += "<tr class=\"normalrow\"><td class=\"contentcell2\">%s</td><td class=\"contentcell2\">%s</td><td class=\"contentcell2\">%s</td></tr>" % (binary, state, version)
+              binaryrows += "<tr class=\"normalrow\"><td class=\"contentcell2\">%s</td><td class=\"contentcell2\">%s</td><td class=\"contentcell2\">%s</td></tr>" % (binary, link_to_state_page(self._config.section,source,state), version)
               if state != "successfully-tested":
                 success = False
               if state == "failed-testing":




More information about the Piuparts-commits mailing list