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

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


The following commit has been merged in the master branch:
commit 332e2b6e0d08f9cb67a51e6a57065741be98c815
Author: Andreas Tille <tille at debian.org>
Date:   Thu Jul 18 11:35:47 2013 +0200

    Add sopme comments

diff --git a/webtools/bugs_udd.py b/webtools/bugs_udd.py
index c8c7269..72e1a64 100755
--- a/webtools/bugs_udd.py
+++ b/webtools/bugs_udd.py
@@ -65,6 +65,7 @@ def main():
     blendname = argv[1]
     config = ReadConfig(blendname)
 
+    # Metadata of packages that might have bugs
     query = """PREPARE query_bug_packages (text) AS
       SELECT distinct sources.source, tasks.tasks, CASE WHEN dependency = 'd' AND component = 'main' THEN 'depends' ELSE 'suggests' END AS status, homepage, vcs_browser, maintainer
         FROM (
@@ -92,6 +93,7 @@ def main():
     """
     _execute_udd_query(query)
 
+    # Actual bugs in packages of Blends dependencies
     query = """PREPARE query_bugs (text) AS
       SELECT source, bu.id, title, severity, status, done_by, tags FROM (
         SELECT distinct bu.source, bu.id, bu.title, bu.severity, bu.status, bu.done AS done_by
@@ -107,16 +109,17 @@ def main():
     """
     _execute_udd_query(query)
     
+    # What tasks are involved
     query = """PREPARE query_get_tasks (text) AS
       SELECT task FROM blends_tasks WHERE blend = $1 ORDER BY task;
     """
     _execute_udd_query(query)
 
-    _execute_udd_query( "EXECUTE query_get_tasks('%s')" % blendname)
-
     STATES = ('depends', 'suggests', 'done')
     SEVERITIES = ('critical', 'grave', 'serious', 'important', 'normal', 'minor', 'wishlist')
 
+    # 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():
@@ -128,8 +131,8 @@ def main():
         print >>stderr, "No tasks metadata received for Blend", blendname
         exit(1)
 
+    # Fetch bugs of all Blends dependencies and store them in a dictionary
     _execute_udd_query( "EXECUTE query_bugs('%s')" % blendname)
-
     bugs = {}
     if curs.rowcount > 0:
         for bug in RowDictionaries(curs):
@@ -158,6 +161,7 @@ def main():
         print >>stderr, "No bug data received for Blend", blendname
         exit(1)
 
+    # Merge metadata of packages and bugs together in bugs_data dictionary, also do statistics about bugs
     _execute_udd_query( "EXECUTE query_bug_packages('%s')" % blendname)
     if curs.rowcount > 0:
         for pkg in RowDictionaries(curs):
@@ -196,7 +200,7 @@ def main():
         print >>stderr, "No information about buggy packages received for Blend", blendname
         exit(1)
 
-
+    # Debuging output in JSON file
     f = open(blendname+'_bugs.json', 'w')
     for task in bugs_data:
         print >>f, "*** %s ***" % task
@@ -206,6 +210,7 @@ def main():
                 print >>f, json.dumps(bugs_data[task][status])
         print >>f
     f.close()
+
     exit(1)
     # Define directories used
     current_dir  = os.path.dirname(__file__)

-- 
Static and dynamic websites for Debian Pure Blends



More information about the Blends-commit mailing list