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

Holger Levsen holger at alioth.debian.org
Sun Mar 15 17:32:18 UTC 2009


Author: holger
Date: 2009-03-15 17:32:18 +0000 (Sun, 15 Mar 2009)
New Revision: 241

Modified:
   trunk/debian/changelog
   trunk/piuparts-report.py
Log:
provide links to logfiles in statistics page.

Modified: trunk/debian/changelog
===================================================================
--- trunk/debian/changelog	2009-03-15 16:45:53 UTC (rev 240)
+++ trunk/debian/changelog	2009-03-15 17:32:18 UTC (rev 241)
@@ -24,7 +24,7 @@
   * piuparts-reports.py: 
     - print "unknown-package" bold in state reports.
     - support sections in configuration file. 
-    - TODO: different input dirs 
+    - provide links to logfiles in statistics page.
   * control: depend on python (>>2.4) at least. 
 
  -- Holger Levsen <holger at debian.org>  Tue, 10 Mar 2009 15:23:59 +0100

Modified: trunk/piuparts-report.py
===================================================================
--- trunk/piuparts-report.py	2009-03-15 16:45:53 UTC (rev 240)
+++ trunk/piuparts-report.py	2009-03-15 17:32:18 UTC (rev 241)
@@ -130,7 +130,16 @@
                   "piuparts at the current time.",
 }
 
+state_by_dir = {
+    "pass": "successfully-tested",
+    "fail": "failed-testing",
+    "bugged": "failed-testing",
+    "fixed": "fix-not-yet-tested",
+    "reserved": "waiting-to-be-tested",
+    "untestable": "dependency-cannot-be-tested",
+}
 
+
 class Config(piupartslib.conf.Config):
 
     def __init__(self, section="report"):
@@ -305,10 +314,16 @@
     logging.debug("Writing package statistics page")    
     table = "<table>\n"
     for state in st.get_states():
+        dirlink = "<td>"
+        for dir in dirs:
+          if state_by_dir[dir] == state:
+            dirlink += "<a href='%s.html'>%s</a> logs<br>" % (dir, html_protect(dir))
+        dirlink += "</td>"
         table += ("<tr><td><a href='state-%s.html'>%s</a></td>" +
-                  "<td>%d</td></tr>\n") % \
+                  "<td>%d</td>%s</tr>\n") % \
                     (html_protect(state), html_protect(state),
-                     len(st.get_packages_in_state(state)))
+                     len(st.get_packages_in_state(state)),
+                     dirlink)
     table += "<tr> <th>Total</th> <th>%d</th></tr>\n" % \
                 st.get_total_packages()
     table += "</table>\n"




More information about the Piuparts-commits mailing list