incubator-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cross...@apache.org
Subject svn commit: r1400367 - /incubator/public/trunk/clutch.py
Date Sat, 20 Oct 2012 04:54:24 GMT
Author: crossley
Date: Sat Oct 20 04:54:24 2012
New Revision: 1400367

URL: http://svn.apache.org/viewvc?rev=1400367&view=rev
Log:
Also handle the new style of incubator mail list set-up.

Modified:
    incubator/public/trunk/clutch.py

Modified: incubator/public/trunk/clutch.py
URL: http://svn.apache.org/viewvc/incubator/public/trunk/clutch.py?rev=1400367&r1=1400366&r2=1400367&view=diff
==============================================================================
--- incubator/public/trunk/clutch.py (original)
+++ incubator/public/trunk/clutch.py Sat Oct 20 04:54:24 2012
@@ -108,7 +108,7 @@ import argparse
 # constants for external data ---
 
 COMMITTERS_BY_PROJECT = "http://people.apache.org/committers-by-project.html"
-MAIL_LIST_URL = "http://incubator.apache.org/mail/"
+MAIL_LIST_URL = "http://mail-archives.apache.org/mod_mbox/"
 INCUBATOR_KEYS = 'http://people.apache.org/~crossley/incubator-keys.txt'
 INCUBATOR_RELEASES = 'http://people.apache.org/~crossley/incubator-releases.txt'
 INCUBATOR_RELEASES_BAD_NAME = 'http://people.apache.org/~crossley/incubator-releases-bad-filename.txt'
@@ -451,30 +451,41 @@ class IncubatorMailListNamesParser(HTMLP
   def __init__(self):
     self.strict = True
     self.names = []
+    self.newStyle = []
     self.reset()
 
   def handle_starttag(self, tag, attrs):
+    # Get the newStyle projects
+    if tag == "option":
+      for key, value in attrs:
+        if (key == "value" and ".incubator" in value):
+          value = value.replace('.incubator', '')
+          self.newStyle.append(value)
+
+    # Get all Incubator lists
     if tag == "a":
       for key, value in attrs:
-        if key == "href":
+        if (key == "href" and "incubator" in value):
+          value = value.replace('incubator-', '')
+          value = value.replace('/', '')
           self.names.append(value)
           break
 
 mailLists = IncubatorMailListNamesParser()
 mailLists.feed(getUrl(MAIL_LIST_URL).read().decode('utf-8'))
 mailLists.close()
-#pprint.pprint(mailLists.names)
-del mailLists.names[0:5] # the first 5 are page navigation
+if optionVerbose:
+  pprint.pprint(mailLists.names)
+  pprint.pprint(mailLists.newStyle)
+
 projectMailLists = {}
-mailListNamesRE = re.compile("(.*)-([^-]+)/")
-mailListNamesUsualRE = re.compile("commits|cvs|dev|issues|user|spec")
+mailListNamesRE = re.compile("(.*)-([^-]+)")
+mailListNamesUsualRE = re.compile("announce|commits|cvs|dev|issues|notifications|user|users|spec")
 for listName in mailLists.names:
-  if listName in ["announce/", "cvs/", "general/", "projects/"]:
+  if listName in ["announce", "cvs", "general", "projects"]:
     continue
   if optionVerbose:
     print("DEBUG: listName=" + listName)
-  if listName.find("/") == -1:
-    continue
   if ('-' in listName):
     matchList = re.search(mailListNamesRE, listName)
     try:
@@ -485,6 +496,8 @@ for listName in mailLists.names:
     projectMailLists[matchList.group(1)][matchList.group(2)] = listName
     if optionVerbose:
       print("DEBUG: Found list: {0} {1}".format(matchList.group(1), matchList.group(2)))
+      if (matchList.group(1) not in mailLists.newStyle):
+        print("DEBUG: Uses oldStyle list set-up")
     # FIXME: We assume that mail lists are always named like this
     # with "-dev" or "-commits" etc.
     matchListUsual = re.search(mailListNamesUsualRE, matchList.group(2))
@@ -836,7 +849,8 @@ for k in sorted(projectNames, key=str.lo
               print("DEBUG: {0}: No incubator group mail lists using '{1}'".format(k, projectName))
             break
           if listType in projectMailLists[projectName]:
-            projects[k][mailListKey] = "http://mail-archives.apache.org/mod_mbox/incubator-{0}/".format(projectMailLists[projectName][listType])
+            leader = 'incubator-' if (k not in mailLists.newStyle) else ''
+            projects[k][mailListKey] = MAIL_LIST_URL + "{0}{1}/".format(leader, projectMailLists[projectName][listType])
             if optionVerbose:
               print("DEBUG: Successful Incubator mail url: " + projects[k][mailListKey])
             foundMailLists = True



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


Mime
View raw message