[Cdd-commits] r1199 - in cdd/trunk/webtools: . templates

CDD Subversion Commit noreply at alioth.debian.org
Sun Nov 2 18:39:06 UTC 2008


Author: tille
Date: Sun Nov  2 18:39:06 2008
New Revision: 1199

Modified:
   cdd/trunk/webtools/bugs.py
   cdd/trunk/webtools/templates/bugs.xhtml
Log:
Better stats and display of tags


Modified: cdd/trunk/webtools/bugs.py
==============================================================================
--- cdd/trunk/webtools/bugs.py	(original)
+++ cdd/trunk/webtools/bugs.py	Sun Nov  2 18:39:06 2008
@@ -93,8 +93,12 @@
 			bugdict = {'bug':      bug.getBug(),
                                    'summary':  bug.getSummary(),
 				   'severity': bug.getSeverity(),
-				   'tags':     bug.getTags()
+				   'tags':     '' 
                                   }
+			komma = ''
+			for t in bug.getTags():
+				bugdict['tags'] += komma + t
+				komma = ', '
 			if bug.getStatus() == 'done':
 				if self.done.pkgname == None:
 					self.done.pkgname = pkgname
@@ -218,7 +222,8 @@
 ndone           = {}
 buglist         = {}
 severitysummary = {}
-weightedsev     = {}
+weightedsev     = {} # Accumulate weighted bugs for whole task
+severitystat    = {} # Count bugs with different severities per task
 for task in packages.keys():
 	pkgbugs       = []
 	nbugs[task]   = 0
@@ -248,12 +253,14 @@
 
 	severitysummary[task] = {}
 	wsev = 0  # sumarise weighted severities
+	severitystat[task] = {}
 	for cat in BUGLISTCAT:
 		curbuglist = buglist[task][cat]
 		if len(curbuglist.pkgbugs) > 0:
 			# sort lists of PkgBug objects inside the three categories
 			curbuglist.pkgbugs.sort()
 		severitysummary[task][cat] = ''
+		severitystat[task][cat] = {}
 		if cat != DONE:
 			sevsum = ''
 			komma  = ''
@@ -264,6 +271,7 @@
 				if curbuglist.severities[s] > 0:
 					sevsum += komma + str(curbuglist.severities[s]) + ' ' + s
 					komma   = ', '
+				severitystat[task][cat][s] = curbuglist.severities[s]
 				# calculate weighted severity for whole metapackage
 				wsev += fac * weight[s] * curbuglist.severities[s]
 			severitysummary[task][cat] = sevsum
@@ -300,11 +308,14 @@
 data['buglistcat']      = BUGLISTCAT
 data['severities']      = SEVERITIES
 data['weight']          = weight
+data['DEPENDENT']       = DEPENDENT
+data['SUGGESTED']       = SUGGESTED
 
 for task in packages.keys():
 	data['buglist']         = buglist[task]
 	data['severitysummary'] = severitysummary[task]
 	data['weightedsev']     = weightedsev[task]
+	data['severitystat']    = severitystat[task]
 
 	template = loader.load('bugs.xhtml')
 	f = open(outputdir + '/' + task + '.html', 'w')

Modified: cdd/trunk/webtools/templates/bugs.xhtml
==============================================================================
--- cdd/trunk/webtools/templates/bugs.xhtml	(original)
+++ cdd/trunk/webtools/templates/bugs.xhtml	Sun Nov  2 18:39:06 2008
@@ -63,8 +63,13 @@
 		  <div class="sectionTop"/>
 		  <div class="row">
 		    <table>
+		      <tr><th>Severity</th><th>Dependent</th><th>Suggested</th></tr>
                       <py:for each="s in severities">
-                        <tr><td class="severity ${s}">${s}</td></tr>
+                        <tr>
+			  <td class="severity ${s}">${s}</td>
+			  <td class="bugid ${s}">${severitystat[DEPENDENT][s]}</td>
+			  <td class="bugid ${s}">${severitystat[SUGGESTED][s]}</td>
+			</tr>
                       </py:for>
 		    </table>
                   </div>
@@ -97,7 +102,7 @@
 		  <tr>
 		    <td class="bugid ${bug['severity']}"><a href="http://bugs.debian.org/${bug['bug']}">${bug['bug']}</a></td>
 		    <td class="summary ${bug['severity']}">${bug['summary']}</td>
-		    <td class="severity ${bug['severity']}">${bug['severity']}</td>
+		    <td class="severity ${bug['severity']}">${bug['tags']}</td>
 		  </tr>
 		</py:for>
 	      </span>
@@ -119,7 +124,7 @@
   <br />
   <table class="footnotecontent">
     <py:for each="s in severities">
-      <tr><td>${s}</td><td>${weight[s]}</td></tr>
+      <tr><td class="footnotecontent">${s}</td><td class="footnotecontent">${weight[s]}</td></tr>
     </py:for>
   </table>
 </div>



More information about the Cdd-commits mailing list