[Blends-commit] [SCM] website branch, master, updated. 93e635d223b6629eb17e059b3733b9ea2d75d3b0

Andreas Tille tille at debian.org
Fri Jul 19 20:56:13 UTC 2013


The following commit has been merged in the master branch:
commit 93e635d223b6629eb17e059b3733b9ea2d75d3b0
Author: Andreas Tille <tille at debian.org>
Date:   Fri Jul 19 22:51:25 2013 +0200

    Working into direction of creating bugs_udd pages (lost of errors to fix are left)

diff --git a/webtools/bugs_udd.py b/webtools/bugs_udd.py
index a2c24d0..d417f4f 100755
--- a/webtools/bugs_udd.py
+++ b/webtools/bugs_udd.py
@@ -118,12 +118,34 @@ def main():
     STATES = ['depends', 'suggests', 'done']
     SEVERITIES = ('critical', 'grave', 'serious', 'important', 'normal', 'minor', 'wishlist')
 
+    # Sense of weight: We want to find a measure how much care a metapackage needs.
+    # So we build the weighted sums of bugs and define limits for the status
+    # The weights below are used for suggested packages.  In case a package has
+    # a stronger dependency (Depends, Recommends) the weight is multiplied by 3
+    WEIGHT = { 'critical'  : 10,
+               'grave'     : 10,
+               'serious'   : 10,
+               'important' :  5,
+               'normal'    :  3,
+               'minor'     :  1,
+               'wishlist'  :  0
+             }
+    BAD          = 100 # if weighted bug sum >= BAD, the meta package is in a bad shape
+                       # Dependent packages might have 3 or more 5 RC bugs
+    PASS         =  70 # this deserves a look - potentially two RC bugs in dependent packages
+    SATISFACTORY =  50 # consider looking at this
+    GOOD         =  30 # at least no RC bug in a dependent package
+    VERYGOOD     =  10 # nothing burning
+    EXCELLENT    =   5 # There is no real need to look at this meta package
+
     # initialise bugs_data dictionary for all tasks
     _execute_udd_query( "EXECUTE query_get_tasks('%s')" % blendname)
     bugs_data = {}
     if curs.rowcount > 0:
         for task in curs.fetchall():
             bugs_data[task[0]] = {}
+            bugs_data[task[0]]['nopenbugs'] = 0
+            bugs_data[task[0]]['ndonebugs'] = 0
             for status in STATES:
                bugs_data[task[0]][status + '_l']  = [] # enable sorting
                bugs_data[task[0]][status]         = {}
@@ -171,8 +193,6 @@ def main():
                 for s in SEVERITIES:
                     bugs_data[task]['depends']['severities'][s] = 0
                     bugs_data[task]['suggests']['severities'][s] = 0
-                bugs_data[task]['nopenbugs'] = 0
-                bugs_data[task]['ndonebugs'] = 0
 		if not bugs_data[task][pkg['status']].has_key(pkg['source']):
                     bugs_data[task][pkg['status']][pkg['source']] = {}
                 bugs_data[task][pkg['status']][pkg['source']]['homepage']    = pkg['homepage']
@@ -191,6 +211,8 @@ def main():
                 else:
                     print >>stderr, "%s: Wrong status %s in task %s for source %s" % (blendname, pkg['status'], task, pkg['source'])
                     exit(1)
+                bugs_data[task]['nopenbugs'] += bugs[pkg['source']]['nopenbugs']
+                bugs_data[task]['ndonebugs'] += bugs[pkg['source']]['ndonebugs']
                 if bugs[pkg['source']]['done']:
 		    if not bugs_data[task]['done'].has_key(pkg['source']):
                         bugs_data[task]['done'][pkg['source']] = {}
@@ -209,6 +231,7 @@ def main():
                 print >>f, status
                 print >>f, json.dumps(bugs_data[task][status])
         print >>f
+    print >>f, json.dumps(bugs_data)
     f.close()
 
     # Define directories used
@@ -255,7 +278,7 @@ the right shows the tasks of %s.""" ) \
     data['taskslink']         = _("Tasks")
     data['bugslink']          = _("Tasks overview")
     data['legend']            = _("Legend")
-    data['bugsofpackage']     = _("Bugs of package")
+    data['bugsoftask']        = _("Bugs of task")
     data['totalbugs']         = _("Total bugs")
     data['openbugs']          = _("Open bugs")
     data['fixedbugs']         = _("Fixed bugs")
@@ -278,17 +301,6 @@ the right shows the tasks of %s.""" ) \
     to make real sense - this evaluation method is in testing phase.""")
     data['weightdetails']     = _("The severities of bugs are weighted as follows")
     
-    if data['advertising'] != None:
-    	# If data['advertising'] is enclosed in _() gettext tries to ask for translations of 'advertising'
-    	# which makes no sense.  That's why this is masked by an extra string variable
-    	advertising = data['advertising']
-    	##data['projectadvertising'] = _(advertising) # Hopefully translation will work this way ...
-    	# Genshi needs explicite information that it is dealing with an UTF-8 string which should not be changed
-    	advertising = _(advertising)
-    	data['projectadvertising'] = Markup(unicode(advertising))# , 'utf-8'))
-    else:
-    	data['projectadvertising'] = None
-    
     data['assessments']     = [ (EXCELLENT,    'excellent'),
                                 (VERYGOOD,     'verygood'),
                                 (GOOD,         'good'),
@@ -385,33 +397,33 @@ the right shows the tasks of %s.""" ) \
     	weightedsev[task] += ' (%i)' % wsev
     	weighttask[task]   = wsev
     
-    data['headings'] = {DEPENDENT : _('Open bugs in dependent packages'),
-                        SUGGESTED : _('Open bugs in suggested packages'),
-                        DONE      : _('Done bugs')
+    data['headings'] = {'dependent' : _('Open bugs in dependent packages'),
+                        'suggested' : _('Open bugs in suggested packages'),
+                        'done'      : _('Done bugs')
                        }
-    data['nobugs']   = {DEPENDENT : _('No open bugs in dependent packages'),
-                        SUGGESTED : _('No open bugs in suggested packages'),
-                        DONE      : _('No done bugs')
+    data['nobugs']   = {'dependent' : _('No open bugs in dependent packages'),
+                        'suggested' : _('No open bugs in suggested packages'),
+                        'done'      : _('No done bugs')
                        }
-    data['cssclass'] = {DEPENDENT : 'bugsdependent',
-                        SUGGESTED : 'bugssuggested',
-                        DONE      : 'bugsdone'
+    data['cssclass'] = {'dependent' : 'bugsdependent',
+                        'suggested' : 'bugssuggested',
+                        'done'      : 'bugsdone'
                        }
     
     data['nbugs']           = nbugs
     data['ndone']           = ndone
-    data['buglistcat']      = BUGLISTCAT
-    data['severities']      = SEVERITIES
-    data['weight']          = weight
-    data['DEPENDENT']       = DEPENDENT
-    data['SUGGESTED']       = SUGGESTED
+    data['weight']          = WEIGHT
     data['nohomepage']      = _('Homepage not available')
     data['novcsbrowser']    = _('Not maintained in Vcs')
     data['vcslocation']     = _('Vcs')
     
     data['weighttask']      = weighttask
     data['weightedclass']   = weightedclass
+
+    for key in ('css', 'homepage', 'projecturl', 'projectname', 'logourl', 'ubuntuhome', 'projectubuntu'):
+        data[key] = config[key]
     
+    print "DEBUG:", nbugs
     for task in bugs_data:
     	data['task']            = task
     	#data['buglist']         = buglist[task]
diff --git a/webtools/templates/bugs_idx.xhtml b/webtools/templates/bugs_idx_udd.xhtml
similarity index 100%
copy from webtools/templates/bugs_idx.xhtml
copy to webtools/templates/bugs_idx_udd.xhtml
diff --git a/webtools/templates/bugs.xhtml b/webtools/templates/bugs_udd.xhtml
similarity index 91%
copy from webtools/templates/bugs.xhtml
copy to webtools/templates/bugs_udd.xhtml
index dde95e2..4af4720 100644
--- a/webtools/templates/bugs.xhtml
+++ b/webtools/templates/bugs_udd.xhtml
@@ -4,9 +4,9 @@
 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="${lang}" lang="${lang}"
       xmlns:py="http://genshi.edgewall.org/">
 <head>
-<title>$projectname ${tasks[task].metapkg.PrintedName.capitalize()} bugs</title>
+<title>$projectname ${task.capitalize()} bugs</title>
 <meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8"/>
-<link href="$css" type="text/css" rel="stylesheet"/>
+<link href="${css}" type="text/css" rel="stylesheet"/>
 </head>
 <body>
 <div style="text-align: center;">
@@ -26,20 +26,20 @@
 		<div class="section">
 			<div class="sectionTop"/>
 			<div class="row">
-                            $bugsofpackage
-			    <strong>${tasks[task].metapkg.pkg}</strong>
+                            $bugsoftask
+			    <strong>${task}</strong>
                         </div>
 			<div class="row">
 			    $totalbugs:
-			    <strong>${nbugs[task]+ndone[task]}</strong>
+			    <strong>${bugs_data[task]['nopenbugs']+bugs_data[task]['ndonebugs']}</strong>
                         </div>
 			<div class="row">
 			    $openbugs:
-			    <strong>${nbugs[task]}</strong>
+			    <strong>${bugs_data[task]['nopenbugs']}</strong>
                         </div>
 			<div class="row">
 			    Fixed bugs:
-			    <strong>${ndone[task]}</strong>
+			    <strong>${bugs_data[task]['ndonebugs']}</strong>
                         </div>
 		</div>
 
@@ -48,10 +48,10 @@
 			<div class="sectionTop"/>
 			<div class="row">
                             <div class="link"><a href="index.html">${bugslink}</a></div>
-                          <py:for each="t in taskskeys">
+                          <py:for each="t in bugs_data.keys()">
                             <div py:choose="t">
                               <span py:when="task"
-                              class="curlink"><a href="${t}.html">${tasks[t].metapkg.PrintedName.capitalize()}</a> ${nbugs[t]} (${weighttask[t]})</span>
+                              class="curlink"><a href="${t}.html">${t.capitalize()}</a> ${bugs_data[t]['nopenbugs']} (${weighttask[t]})</span>
                               <span py:otherwise="" class="link ${weightedclass[t]}"><a href="${t}.html">${tasks[t].metapkg.PrintedName.capitalize()}</a> ${nbugs[t]} (${weighttask[t]})</span>
                             </div>
                           </py:for>

-- 
Static and dynamic websites for Debian Pure Blends



More information about the Blends-commit mailing list