You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@community.apache.org by hu...@apache.org on 2015/01/22 10:45:03 UTC

svn commit: r1653792 - /comdev/projects.apache.org/scripts/import/addpmc.py

Author: humbedooh
Date: Thu Jan 22 09:45:03 2015
New Revision: 1653792

URL: http://svn.apache.org/r1653792
Log:
Also allow for adding info to committee list.

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

Modified: comdev/projects.apache.org/scripts/import/addpmc.py
URL: http://svn.apache.org/viewvc/comdev/projects.apache.org/scripts/import/addpmc.py?rev=1653792&r1=1653791&r2=1653792&view=diff
==============================================================================
--- comdev/projects.apache.org/scripts/import/addpmc.py (original)
+++ comdev/projects.apache.org/scripts/import/addpmc.py Thu Jan 22 09:45:03 2015
@@ -5,9 +5,9 @@ import json;
 import re
 import sys
 
-if len(sys.argv) != 3:
-    print("Usage: addpmc.py pmcuid pmcname")
-    print("Example: addpmc.py drill 'Apache Drill'")
+if len(sys.argv) != 4:
+    print("Usage: addpmc.py pmcuid pmcname founded-date")
+    print("Example: addpmc.py drill 'Apache Drill' '2015-01'")
     sys.exit(1)
     
 js = {}
@@ -15,21 +15,37 @@ with open("../../site/json/foundation/pm
     js = json.loads(f.read())
     f.close()
     
+cjs = {}
+with open("../../site/json/foundation/committees.json") as f:
+    cjs = json.loads(f.read())
+    f.close()
 uid = sys.argv[1]
 name = sys.argv[2]
+founded = sys.argv[3]
 
 if uid in js:
-    print("Updating %s" % uid)
+    print("Updating %s in PMC list" % uid)
 else:
-    print("Adding %s" % uid)
+    print("Adding %s to PMC list" % uid)
     
 js[uid] = {
         'homepage': "http://%s.apache.org" % uid,
         'name': name
     }
 
+if founded in cjs:
+    print("Updating %s in committee info" % founded)
+    cjs[founded].append(name)
+else:
+    print("Adding %s to committee info under %s" % (name, founded))
+    cjs[founded] = [name]
+
 with open("../../site/json/foundation/pmcs.json", "w") as f:
     f.write(json.dumps(js))
     f.close()
     
+with open("../../site/json/foundation/committees.json", "w") as f:
+    f.write(json.dumps(cjs))
+    f.close()
+    
 print("Done!")
\ No newline at end of file