community-commits mailing list archives

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

URL: http://svn.apache.org/r1678644
Log:
extract reporting cycles from committee-info.txt

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=1678644&r1=1678643&r2=1678644&view=diff
==============================================================================
--- comdev/projects.apache.org/scripts/import/parsecommittees.py (original)
+++ comdev/projects.apache.org/scripts/import/parsecommittees.py Sun May 10 21:07:07 2015
@@ -1,6 +1,7 @@
 import re
 import json
 import sys
+import io
 
 # Committee names from committees-info.txt that do not match tlps-evolution.json
 renamesCommittee2Json = {
@@ -47,6 +48,19 @@ except:
     print("  svn export https://svn.apache.org/repos/private/committers/board/committee-info.txt")
     print("(requires authentication with committer karma)")
     sys.exit(1)
+reports = data[data.index("January, April, July, October"):data.index('Next month')]
+buf = io.StringIO(reports)
+cycles = { 'Incubator': 0 }
+current = 1
+newCycle = True
+for p in buf.readlines():
+    if p.startswith('  '):
+        cycles[p.strip()] = current
+        newCycle = False
+    elif len(p.strip()) == 0:
+        if not newCycle:
+            newCycle = True
+            current += 1
 
 tlpCount = 0
 tlps = []
@@ -67,9 +81,9 @@ for pmc in re.findall(r"\* .+?\s+\(est\.
             else:
                 tlp_id = project.lower().replace(' ', '').replace('.', '')
             # Classical TLP
-            project = "Apache %s" % project
-            if project in renamesCommittee2Json:
-                project = renamesCommittee2Json[project]
+            committee = "Apache %s" % project
+            if committee in renamesCommittee2Json:
+                committee = renamesCommittee2Json[committee]
             #print(project)
             tlpCount += 1
 
@@ -77,11 +91,11 @@ for pmc in re.findall(r"\* .+?\s+\(est\.
             key = "%s-%s" % (year, month)
             if not key in tlpsEvolution:
                 tlpsEvolution[key] = [] # add new year-month
-            if not project in tlpsEvolution[key]:
+            if not committee in tlpsEvolution[key]:
                 # add TLP to tlpsEvolution
-                tlpsEvolution[key].append(project)
+                tlpsEvolution[key].append(committee)
                 tlpsEvolution[key].sort()
-                addedTlps.append("%s: %s" % (key, project))
+                addedTlps.append("%s: %s" % (key, committee))
 
             # add TLP to tlps
             tlp = {}
@@ -90,7 +104,7 @@ for pmc in re.findall(r"\* .+?\s+\(est\.
             if tlp_id in gids:
                 gid = gids[tlp_id]
                 tlp['gid'] = gid
-            tlp['name'] = project
+            tlp['name'] = committee
             tlp['established'] = key
             if tlp_id in homepages:
                 tlp['homepage'] = homepages[tlp_id]
@@ -111,17 +125,20 @@ for pmc in re.findall(r"\* .+?\s+\(est\.
             tlp['pmcs'] = pmc
             tlp['committers'] = committers
             if len(pmc) == 0:
-                print('WARN: %s (%s established in %s) has no PMC members (PMC group id=%s)'
% (tlp_id, project, key, pmcgid))
+                print('WARN: %s (%s established in %s) has no PMC members LDAP group (id=%s)'
% (tlp_id, committee, key, pmcgid))
             # TODO
             # tlp['chair'] = uid
-            # tlp['reporting'] = 'j'/'f'/'m'
+            if project in cycles:
+                tlp['reporting'] = cycles[project]
+            else:
+                print('WARN: %s not found in reporting cycles' % project)
             # 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('('):]))
-        c[project] = True
+        c[committee] = True
 
 with open("../../site/json/foundation/tlps-evolution.json", "w") as f:
     f.write(json.dumps(tlpsEvolution, sort_keys=True, indent=0))



Mime
View raw message