incubator-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cross...@apache.org
Subject svn commit: r1101331 - /incubator/public/trunk/clutch.py
Date Tue, 10 May 2011 06:30:40 GMT
Author: crossley
Date: Tue May 10 06:30:40 2011
New Revision: 1101331

URL: http://svn.apache.org/viewvc?rev=1101331&view=rev
Log:
Modify the detection of KEYS files for incubating projects.
Was using HTMLParser of p.a.o/~henkp/checker/md5.html now using ~crossley cron job.

Modified:
    incubator/public/trunk/clutch.py

Modified: incubator/public/trunk/clutch.py
URL: http://svn.apache.org/viewvc/incubator/public/trunk/clutch.py?rev=1101331&r1=1101330&r2=1101331&view=diff
==============================================================================
--- incubator/public/trunk/clutch.py (original)
+++ incubator/public/trunk/clutch.py Tue May 10 06:30:40 2011
@@ -497,31 +497,19 @@ for listName in mailLists.names:
         {'a': listName, 'b': projectMailLists[listName]["dev"]}
 
 print "Gather incubator PGP keys data ..."
-keysNamesRE = re.compile("/dist/incubator/([^/]+)/(.*)KEYS")
-class KeysNamesParser(HTMLParser.HTMLParser):
-
-  def __init__(self):
-    self.names = {}
-    self.reset()
-
-  def handle_starttag(self, tag, attrs):
-    if tag == "a":
-      for key, value in attrs:
-        if key == "href":
-          matchKey = re.search(keysNamesRE, value)
-          if matchKey:
-            self.names[matchKey.group(1)] = {}
-            self.names[matchKey.group(1)]['urlKeys'] = "%(a)s/%(b)s/%(c)sKEYS" % \
-                {'a': "http://www.apache.org/dist/incubator",
-                 'b': matchKey.group(1),
-                 'c': matchKey.group(2)
-                }
-          break
-
-keysListUrl = "http://people.apache.org/~henkp/checker/md5.html"
-keysList = KeysNamesParser()
-keysList.feed(urllib2.urlopen(keysListUrl).read())
-keysList.close()
+keysNamesRE = re.compile("/dist/incubator/([^/]+)/(.*)")
+keysList = {}
+req = urllib2.Request(
+    url='http://people.apache.org/~crossley/incubator-keys.txt')
+lines = urllib2.urlopen(req).readlines()
+for line in lines:
+  matchKey = re.search(keysNamesRE, line)
+  if matchKey:
+    keysList[matchKey.group(1)] = "%(a)s/%(b)s/%(c)s" % \
+      {'a': "http://www.apache.org/dist/incubator",
+       'b': matchKey.group(1),
+       'c': matchKey.group(2)
+      }
 
 print "Gather data about releases ..."
 releases = {}
@@ -764,11 +752,11 @@ for k in projectNames:
   # Detect if they have a PGP KEYS file
   if projects[k]['urlDist']:
     try:
-      keysList.names[projects[k]['resourceName']]
+      keysList[projects[k]['resourceName']]
     except KeyError:
       print 'INFO: %s: Does not yet have a PGP KEYS file' % k
     else:
-      projects[k]['urlKeys'] = keysList.names[projects[k]['resourceName']]['urlKeys']
+      projects[k]['urlKeys'] = keysList[projects[k]['resourceName']]
 
   # Detect mail lists established
   # First, try the list names from their status page



---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@incubator.apache.org
For additional commands, e-mail: cvs-help@incubator.apache.org


Mime
View raw message