community-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From humbed...@apache.org
Subject svn commit: r1653792 - /comdev/projects.apache.org/scripts/import/addpmc.py
Date Thu, 22 Jan 2015 09:45:03 GMT
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



Mime
View raw message