[Blends-commit] r2739 - /blends/trunk/team_analysis_tools/maintain_bad_names.py

tille at users.alioth.debian.org tille at users.alioth.debian.org
Wed Apr 6 21:21:25 UTC 2011


Author: tille
Date: Wed Apr  6 21:21:10 2011
New Revision: 2739

URL: http://svn.debian.org/wsvn/blends/?sc=1&rev=2739
Log:
Recreate carnivore_names_prefered table, added more black/whitelist names according to further research

Modified:
    blends/trunk/team_analysis_tools/maintain_bad_names.py

Modified: blends/trunk/team_analysis_tools/maintain_bad_names.py
URL: http://svn.debian.org/wsvn/blends/blends/trunk/team_analysis_tools/maintain_bad_names.py?rev=2739&op=diff
==============================================================================
--- blends/trunk/team_analysis_tools/maintain_bad_names.py (original)
+++ blends/trunk/team_analysis_tools/maintain_bad_names.py Wed Apr  6 21:21:10 2011
@@ -28,7 +28,9 @@
              'System V',
              'root',
              'Inc.',
-             'q'
+             'q',
+             'IV',
+             'Boriel',
             )
 
 WHITELIST = ('Ramakrishnan Muthukrishnan',
@@ -92,6 +94,13 @@
              'Bruno Kleinert',
              'Simon Horman',
              'Picca Frédéric-Emmanuel',
+             'John Francesco Ferlito',
+             'Recai OktaÅŸ',
+             'Maia Kozheva',
+             'Abou Al Montacir',
+             'Mikael Sennerholm',
+             'A Lee',
+             'Joel Aelwyn',
             )
 
 has_quotes_re = re.compile('".*"')
@@ -153,6 +162,24 @@
 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;
+CREATE TABLE carnivore_names_prefered (
+  id   int,
+  name text,
+ PRIMARY KEY (id),
+ FOREIGN KEY (id, name) REFERENCES carnivore_names DEFERRABLE);
+GRANT SELECT ON carnivore_names_prefered TO PUBLIC;
+
+-- Insert those names which are unique
+INSERT INTO carnivore_names_prefered
+   SELECT * FROM carnivore_names
+       WHERE id in (SELECT id FROM carnivore_names
+                 GROUP BY id HAVING COUNT(*) = 1);
+"""
 curs.execute(query)
 
 query = """SELECT name, id from carnivore_names cn
@@ -175,7 +202,8 @@
                 curs.execute(query)
                 usednames = curs.fetchall()
                 if len(usednames) == 0:
-                    print >>stderr, "Names %s are not used in sources at all" % str(name)
+                    if debug:
+                        print "Names %s are not used in sources at all" % str(name)
                     for n in name:
                         usednames.append((n,0))
                 if len(usednames) == 1:




More information about the Blends-commit mailing list