incubator-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From cross...@apache.org
Subject svn commit: r743979 - /incubator/public/trunk/clutch.py
Date Fri, 13 Feb 2009 04:34:27 GMT
Author: crossley
Date: Fri Feb 13 04:34:27 2009
New Revision: 743979

URL: http://svn.apache.org/viewvc?rev=743979&view=rev
Log:
Handle the case where project exists in incubation table, but has broken link to missing status
file.

Modified:
    incubator/public/trunk/clutch.py

Modified: incubator/public/trunk/clutch.py
URL: http://svn.apache.org/viewvc/incubator/public/trunk/clutch.py?rev=743979&r1=743978&r2=743979&view=diff
==============================================================================
--- incubator/public/trunk/clutch.py (original)
+++ incubator/public/trunk/clutch.py Fri Feb 13 04:34:27 2009
@@ -260,57 +260,59 @@
     print "WARN: Name '%(a)s' differs from reporting schedule name '%(b)s'" % \
         {'a': projects[k]['name'], 'b': projectsTable[k]['name']}
   statusFile = "site-author/projects/%s.xml" % projectsTable[k]['statusFileName']
-  dom = xml.dom.minidom.parse(statusFile)
-  # get the project info hints
-  table = dom.getElementsByTagName("table")[0]
-  for row in table.getElementsByTagName("tr")[1:]:
-    cell = row.getElementsByTagName("td")[2]
-    if cell.attributes.has_key('id'):
-      values = [getText(item.childNodes) for item in cell.childNodes]
-      value = " ".join(values).strip()
-      #print "%(a)s=%(b)s" % {'a': cell.getAttribute('id'), 'b': value}
-      value = value.replace('https:', 'http:')
-      if cell.getAttribute('id') == "mail-dev":
-        value = value.replace('  at  ', '@')
-        value = value.replace('  Subscribe  Unsubscribe', '')
-        value = value.replace('  Archive', '')
-        value = value.replace(' ', '@', 1)
-        value = value.replace(' ', '')
-        value = value.replace('@@', '@')
-        matchMail = re.search(mailListRE, value)
-        if matchMail:
-          projects[k]['hasMailListDev'] = "%(a)s-%(b)s" % \
-              {'a': matchMail.group(2), 'b': matchMail.group(1)}
-        continue
-      if cell.getAttribute('id') == "mail-commits":
-        value = value.replace('  at  ', '@')
-        value = value.replace('  Subscribe  Unsubscribe', '')
-        value = value.replace('  Archive', '')
-        value = value.replace(' ', '@', 1)
-        value = value.replace(' ', '')
-        value = value.replace('@@', '@')
-        matchMail = re.search(mailListRE, value)
-        if matchMail:
-          projects[k]['hasMailListCommits'] = "%(a)s-%(b)s" % \
-              {'a': matchMail.group(2), 'b': matchMail.group(1)}
-        continue
-      if cell.getAttribute('id') == "svn" and value.find('http:') == 0:
-        projects[k]['urlSvn'] = value
-        continue
-      if cell.getAttribute('id') == "tracker" and value.find('http:') == 0:
-        projects[k]['urlTracker'] = value
-        continue
-      if cell.getAttribute('id') == "www" and value.find('http:') == 0:
-        projects[k]['urlWww'] = value
-        continue
-  # Scan the project News section and count new commiters.
-  for section in dom.getElementsByTagName("section"):
-    if section.attributes.has_key('id') and section.getAttribute('id') == "News":
-      for line in section.toxml().splitlines():
-        matchNewCommitter = re.search(newCommitterRE, line)
-        if matchNewCommitter:
-          projects[k]['numberCommittersNew'] += 1
-  dom.unlink()
+  if os.path.exists(statusFile):
+    dom = xml.dom.minidom.parse(statusFile)
+    # get the project info hints
+    table = dom.getElementsByTagName("table")[0]
+    for row in table.getElementsByTagName("tr")[1:]:
+      cell = row.getElementsByTagName("td")[2]
+      if cell.attributes.has_key('id'):
+        values = [getText(item.childNodes) for item in cell.childNodes]
+        value = " ".join(values).strip()
+        #print "%(a)s=%(b)s" % {'a': cell.getAttribute('id'), 'b': value}
+        value = value.replace('https:', 'http:')
+        if cell.getAttribute('id') == "mail-dev":
+          value = value.replace('  at  ', '@')
+          value = value.replace('  Subscribe  Unsubscribe', '')
+          value = value.replace('  Archive', '')
+          value = value.replace(' ', '@', 1)
+          value = value.replace(' ', '')
+          value = value.replace('@@', '@')
+          matchMail = re.search(mailListRE, value)
+          if matchMail:
+            projects[k]['hasMailListDev'] = "%(a)s-%(b)s" % \
+                {'a': matchMail.group(2), 'b': matchMail.group(1)}
+          continue
+        if cell.getAttribute('id') == "mail-commits":
+          value = value.replace('  at  ', '@')
+          value = value.replace('  Subscribe  Unsubscribe', '')
+          value = value.replace('  Archive', '')
+          value = value.replace(' ', '@', 1)
+          value = value.replace(' ', '')
+          value = value.replace('@@', '@')
+          matchMail = re.search(mailListRE, value)
+          if matchMail:
+            projects[k]['hasMailListCommits'] = "%(a)s-%(b)s" % \
+                {'a': matchMail.group(2), 'b': matchMail.group(1)}
+          continue
+        if cell.getAttribute('id') == "svn" and value.find('http:') == 0:
+          projects[k]['urlSvn'] = value
+          continue
+        if cell.getAttribute('id') == "tracker" and value.find('http:') == 0:
+          projects[k]['urlTracker'] = value
+          continue
+        if cell.getAttribute('id') == "www" and value.find('http:') == 0:
+          projects[k]['urlWww'] = value
+          continue
+    # Scan the project News section and count new commiters.
+    for section in dom.getElementsByTagName("section"):
+      if section.attributes.has_key('id') and section.getAttribute('id') == "News":
+        for line in section.toxml().splitlines():
+          matchNewCommitter = re.search(newCommitterRE, line)
+          if matchNewCommitter:
+            projects[k]['numberCommittersNew'] += 1
+    dom.unlink()
+  # end of if status file exists
 
 # end of processing incubation table data
 
@@ -449,6 +451,13 @@
   projects[k]['sponsor'] = projectsTable[k]['sponsor']
   projects[k]['mentors'] = projectsTable[k]['mentors']
   projects[k]['startDate'] = projectsTable[k]['startDate']
+
+  statusFile = "site-author/projects/%s.xml" % projectsTable[k]['statusFileName']
+  if not os.path.exists(statusFile):
+    print 'ERROR: %s: Missing status file' % k
+    projects[k]['hasStatusEntry'] = False
+    continue
+
   projects[k]['statusFileName'] = projectsTable[k]['statusFileName']
 
   startDate = projects[k]['startDate']



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


Mime
View raw message