community-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hbout...@apache.org
Subject svn commit: r1678533 - /comdev/projects.apache.org/scripts/import/parsecommittees.py
Date Sun, 10 May 2015 02:08:12 GMT
Author: hboutemy
Date: Sun May 10 02:08:11 2015
New Revision: 1678533

URL: http://svn.apache.org/r1678533
Log:
first implementation of tlps.json output

Modified:
    comdev/projects.apache.org/scripts/import/parsecommittees.py

Modified: comdev/projects.apache.org/scripts/import/parsecommittees.py
URL: http://svn.apache.org/viewvc/comdev/projects.apache.org/scripts/import/parsecommittees.py?rev=1678533&r1=1678532&r2=1678533&view=diff
==============================================================================
--- comdev/projects.apache.org/scripts/import/parsecommittees.py (original)
+++ comdev/projects.apache.org/scripts/import/parsecommittees.py Sun May 10 02:08:11 2015
@@ -12,6 +12,23 @@ renamesChairs2Json = {
     'Apache Logging Services': 'Apache Logging',
     'Apache Perl': 'Apache mod_perl'
 }
+# TLP ids not matching committee name in lowercase
+tlp_ids = {
+    'Community Development': 'comdev',
+    'HTTP Server': 'httpd',
+    'Lucene.Net': 'lucenenet',
+    'Open Climate Workbench': 'climate'
+}
+# homepages not matching http://<tlp>.apache.org/
+homepages = {
+    'comdev': 'http://community.apache.org/',
+    'httpcomponents': 'http://hc.apache.org/',
+    'webservices': 'http://ws.apache.org/'
+}
+# LDAP group ids not matching tlp
+gids = {
+    'webservices': 'ws'
+}
 
 with open("../../site/json/foundation/tlps-evolution.json", "r") as f:
     tlpsEvolution = json.loads(f.read())
@@ -28,6 +45,7 @@ except:
     sys.exit(1)
 
 tlpCount = 0
+tlps = []
 addedTlps = []
 c = {}
 
@@ -40,19 +58,44 @@ for pmc in re.findall(r"\* .+?\s+\(est\.
         month = m.group(2)
         year = m.group(3)
         if not re.search(r"Committee", pmc):
+            if project in tlp_ids:
+                tlp_id = tlp_ids[project]
+            else:
+                tlp_id = project.lower().replace(' ', '').replace('.', '')
             # Classical TLP
             project = "Apache %s" % project
             if project in renamesCommittee2Json:
                 project = renamesCommittee2Json[project]
             #print(project)
             tlpCount += 1
+
+            # add TLP to tlpsEvolution if necessary
             key = "%s-%s" % (year, month)
             if not key in tlpsEvolution:
-                tlpsEvolution[key] = []
+                tlpsEvolution[key] = [] # add new year-month
             if not project in tlpsEvolution[key]:
+                # add TLP to tlpsEvolution
                 tlpsEvolution[key].append(project)
                 tlpsEvolution[key].sort()
                 addedTlps.append("%s: %s" % (key, project))
+
+            # add TLP to tlps
+            tlp = {}
+            tlp['id'] = tlp_id
+            if tlp_id in gids:
+                tlp['gid'] = gids[tlp_id]
+            tlp['name'] = project
+            tlp['established'] = key
+            if tlp_id in homepages:
+                tlp['homepage'] = homepages[tlp_id]
+            # TODO
+            # tlp['chair'] = uid
+            # tlp['pmcs'] = { 'uid': 'full name' }
+            # tlp['committers'] = { 'uid': 'full name' }
+            # tlp['reporting'] = 'j'/'f'/'m'
+            # tlp['charter']
+            # tlp['retired']
+            tlps.append(tlp)
         else:
             # Special Committee (Officer's, President's or Board)
             print("INFO: %s ignored %s" % (project, pmc[pmc.rfind('('):]))
@@ -67,6 +110,10 @@ addedTlps.sort()
 for added in addedTlps:
     print("- %s" % added)
 
+with open("../../site/json/foundation/tlps.json", "w") as f:
+    f.write(json.dumps(tlps, sort_keys=True, indent=0))
+    f.close()
+
 # compare with chairs, for consistency checking
 chairs = json.load(open("../../site/json/foundation/chairs.json"))
 for chair in chairs:



Mime
View raw message