[Blends-commit] r2747 - /blends/trunk/team_analysis_tools/maintain_names_prefered.py

tille at users.alioth.debian.org tille at users.alioth.debian.org
Sun Apr 10 06:54:31 UTC 2011


Author: tille
Date: Sun Apr 10 06:54:30 2011
New Revision: 2747

URL: http://svn.debian.org/wsvn/blends/?sc=1&rev=2747
Log:
make sure carnivore_names_prefered will really exist

Modified:
    blends/trunk/team_analysis_tools/maintain_names_prefered.py

Modified: blends/trunk/team_analysis_tools/maintain_names_prefered.py
URL: http://svn.debian.org/wsvn/blends/blends/trunk/team_analysis_tools/maintain_names_prefered.py?rev=2747&op=diff
==============================================================================
--- blends/trunk/team_analysis_tools/maintain_names_prefered.py (original)
+++ blends/trunk/team_analysis_tools/maintain_names_prefered.py Sun Apr 10 06:54:30 2011
@@ -141,32 +141,6 @@
 	exit(-1)
 curs = conn.cursor()
 
-# Check what name is used how often
-query = """PREPARE name_usage (text[]) AS
-        SELECT name, count(*) FROM (
-            SELECT maintainer_name AS name FROM all_sources    WHERE maintainer_name = ANY($1)
-            UNION ALL
-            SELECT submitter_name  AS name FROM all_bugs       WHERE submitter_name  = ANY($1)
-            UNION ALL
-            SELECT owner_name      AS name FROM all_bugs       WHERE owner_name      = ANY($1)
-            UNION ALL
-            SELECT done_name       AS name FROM all_bugs       WHERE done_name       = ANY($1)
-            UNION ALL
-            SELECT name            AS name FROM uploaders      WHERE name            = ANY($1)
-            UNION ALL
-            SELECT changed_by_name AS name FROM upload_history WHERE changed_by_name = ANY($1)
-            UNION ALL
-            SELECT maintainer_name AS name FROM upload_history WHERE maintainer_name = ANY($1)
-            UNION ALL
-            SELECT signed_by_name  AS name FROM upload_history WHERE signed_by_name  = ANY($1)
-        ) AS names
-        GROUP BY name
-        ORDER BY count DESC;"""
-curs.execute(query)
-
-query = "PREPARE insert_prefered_name AS INSERT INTO carnivore_names_prefered (id, name)  VALUES ($1, $2)"
-curs.execute(query)
-
 ## Initialise carnivore_names_prefered table
 query = """
 DROP TABLE IF EXISTS carnivore_names_prefered;
@@ -183,6 +157,32 @@
        WHERE id in (SELECT id FROM carnivore_names
                  GROUP BY id HAVING COUNT(*) = 1);
 """
+curs.execute(query)
+
+# Check what name is used how often
+query = """PREPARE name_usage (text[]) AS
+        SELECT name, count(*) FROM (
+            SELECT maintainer_name AS name FROM all_sources    WHERE maintainer_name = ANY($1)
+            UNION ALL
+            SELECT submitter_name  AS name FROM all_bugs       WHERE submitter_name  = ANY($1)
+            UNION ALL
+            SELECT owner_name      AS name FROM all_bugs       WHERE owner_name      = ANY($1)
+            UNION ALL
+            SELECT done_name       AS name FROM all_bugs       WHERE done_name       = ANY($1)
+            UNION ALL
+            SELECT name            AS name FROM uploaders      WHERE name            = ANY($1)
+            UNION ALL
+            SELECT changed_by_name AS name FROM upload_history WHERE changed_by_name = ANY($1)
+            UNION ALL
+            SELECT maintainer_name AS name FROM upload_history WHERE maintainer_name = ANY($1)
+            UNION ALL
+            SELECT signed_by_name  AS name FROM upload_history WHERE signed_by_name  = ANY($1)
+        ) AS names
+        GROUP BY name
+        ORDER BY count DESC;"""
+curs.execute(query)
+
+query = "PREPARE insert_prefered_name AS INSERT INTO carnivore_names_prefered (id, name)  VALUES ($1, $2)"
 curs.execute(query)
 
 query = """SELECT name, id from carnivore_names cn




More information about the Blends-commit mailing list