incubator-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1728134 - /incubator/public/trunk/clutch.py
Date Tue, 02 Feb 2016 14:36:05 GMT
Author: sebb
Date: Tue Feb  2 14:36:05 2016
New Revision: 1728134

URL: http://svn.apache.org/viewvc?rev=1728134&view=rev
Log:
Check status files for graduated/retired span entry

Modified:
    incubator/public/trunk/clutch.py

Modified: incubator/public/trunk/clutch.py
URL: http://svn.apache.org/viewvc/incubator/public/trunk/clutch.py?rev=1728134&r1=1728133&r2=1728134&view=diff
==============================================================================
--- incubator/public/trunk/clutch.py (original)
+++ incubator/public/trunk/clutch.py Tue Feb  2 14:36:05 2016
@@ -223,6 +223,21 @@ def normaliseSVNurl(url):
         rc = rc + '/'
     return rc
 
+def checkStatus(k, projectList, status):
+    statusFile = SITE_CONTENT_DIR + "projects/{0}.xml".format(k)
+    e = projectList[k]
+    if os.path.exists(statusFile):
+        try:
+            dom = xml.dom.minidom.parse(statusFile)
+            span = dom.getElementsByTagName("span")
+            if (len(span) < 1):
+                print("INFO: Missing from status file: "+statusFile)
+                print("      <p><span class='{2}'>The {0} project {2} on {1}</span></p>".format(e['name'],
e['enddate'], status))
+        except (Exception) as e:
+            print("Exception processing " + statusFile + " : " + str(e))
+            raise
+    else:
+        print("WARN: Cannot find {0}".format(statusFile))
 
 projects = {}  # internal data, derived from podlings.xml
 otherIssues = []
@@ -270,14 +285,15 @@ for row in dom.getElementsByTagName("pod
     id = name.lower()
     id = id.replace(' ', '')  # strip spaces from project ID
     startDate = row.getAttribute("startdate")
+    endDate = row.getAttribute("enddate")
 
     if row.getAttribute("status") == 'graduated':
         resource = row.getAttribute("resource")
-        graduatedProjects[resource.lower()] = True
+        graduatedProjects[resource.lower()] = {'name': name, 'enddate': endDate}
 
     if row.getAttribute("status") == 'retired':
         resource = row.getAttribute("resource")
-        retiredProjects[resource.lower()] = True
+        retiredProjects[resource.lower()] = {'name': name, 'enddate': endDate}
 
     if row.getAttribute("status") == 'current':
         #print("Name: " + name)
@@ -395,6 +411,11 @@ for row in dom.getElementsByTagName("pod
 
 dom.unlink()
 
+for k in sorted(graduatedProjects):
+    checkStatus(k, graduatedProjects, 'graduated')
+for k in sorted(retiredProjects):
+    checkStatus(k, retiredProjects, 'retired')
+
 # Process the incubation table data, detect some potential issues. ---
 
 print("Gather details from project status files ...")



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


Mime
View raw message