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

Andreas Tille tille at debian.org
Wed Jul 17 20:33:33 UTC 2013


The following commit has been merged in the master branch:
commit d153b09ff3eeea8817e71eda4222cc996bf425b4
Author: Andreas Tille <tille at debian.org>
Date:   Wed Jul 17 22:29:16 2013 +0200

    Also fetch severity

diff --git a/webtools/bugs_udd.py b/webtools/bugs_udd.py
index b47dfb9..83c78ea 100755
--- a/webtools/bugs_udd.py
+++ b/webtools/bugs_udd.py
@@ -93,7 +93,7 @@ def main():
     _execute_udd_query(query)
 
     query = """PREPARE query_bugs (text) AS
-      SELECT distinct bu.source, bu.id, bu.title, bu.status, bu.done
+      SELECT distinct bu.source, bu.id, bu.title, bu.severity, bu.status, bu.done
         FROM blends_dependencies b
         JOIN packages p ON p.package = b.package
         JOIN bugs bu    ON bu.source = p.source
@@ -109,14 +109,14 @@ def main():
 
     _execute_udd_query( "EXECUTE query_get_tasks('%s')" % blendname)
 
-
-    states = ('depends', 'suggests', 'done')
+    STATES = ('depends', 'suggests', 'done')
+    SEVERITIES = ('critical', 'grave', 'serious', 'important', 'normal', 'minor', 'wishlist')
 
     bugs_data = {}
     if curs.rowcount > 0:
         for task in curs.fetchall():
             bugs_data[task[0]] = {}
-            for status in states:
+            for status in STATES:
                bugs_data[task[0]][status + '_l']  = [] # enable sorting
                bugs_data[task[0]][status]         = {}
     else:
@@ -130,6 +130,11 @@ def main():
         for bug in RowDictionaries(curs):
             if not bugs.has_key(bug['source']):
                 bugs[bug['source']] = {}
+                bugs[bug['source']]['severities'] = {}
+                for s in SEVERITIES:
+                    bugs[bug['source']]['severities'][s] = 0
+                bugs[bug['source']]['nopenbugs'] = 0
+                bugs[bug['source']]['ndonebugs'] = 0
                 bugs[bug['source']]['open'] = []
                 bugs[bug['source']]['done'] = []
             b = {}
@@ -139,8 +144,11 @@ def main():
                 b[k] = bug[k]
             if bug['status'] == 'done':
                 bugs[bug['source']]['done'].append(b)
+                bugs[bug['source']]['ndonebugs'] += 1
             else:
                 bugs[bug['source']]['open'].append(b)
+                bugs[bug['source']]['nopenbugs'] += 1
+                bugs[bug['source']]['severities'][bug['severity']] += 1
     else:
         print >>stderr, "No bug data received for Blend", blendname
         exit(1)
@@ -149,6 +157,11 @@ def main():
     if curs.rowcount > 0:
         for pkg in RowDictionaries(curs):
             for task in pkg['tasks']:
+                bugs_data[task]['severities'] = {}
+                for s in SEVERITIES:
+                    bugs_data[task]['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']
@@ -176,7 +189,7 @@ def main():
     f = open(blendname+'_bugs.json', 'w')
     for task in bugs_data:
         print >>f, task
-        for status in states:
+        for status in STATES:
             if bugs_data[task].has_key(status):
                 print >>f, status
                 print >>f, json.dumps(bugs_data[task][status])

-- 
Static and dynamic websites for Debian Pure Blends



More information about the Blends-commit mailing list