community-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From humbed...@apache.org
Subject svn commit: r1652037 - /comdev/projects.apache.org/scripts/import/addpmc.py
Date Thu, 15 Jan 2015 10:41:49 GMT
Author: humbedooh
Date: Thu Jan 15 10:41:49 2015
New Revision: 1652037

URL: http://svn.apache.org/r1652037
Log:
Add script for adding new PMCs

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

Added: comdev/projects.apache.org/scripts/import/addpmc.py
URL: http://svn.apache.org/viewvc/comdev/projects.apache.org/scripts/import/addpmc.py?rev=1652037&view=auto
==============================================================================
--- comdev/projects.apache.org/scripts/import/addpmc.py (added)
+++ comdev/projects.apache.org/scripts/import/addpmc.py Thu Jan 15 10:41:49 2015
@@ -0,0 +1,35 @@
+#!/usr/bin/env python
+
+import os
+import json;
+import re
+import sys
+
+if len(sys.argv) != 3:
+    print("Usage: addpmc.py pmcuid pmcname")
+    print("Example: addpmc.py drill 'Apache Drill'")
+    sys.exit(1)
+    
+js = {}
+with open("../../site/json/foundation/pmcs.json") as f:
+    js = json.loads(f.read())
+    f.close()
+    
+uid = sys.argv[1]
+name = sys.argv[2]
+
+if uid in js:
+    print("Updating %s" % uid)
+else:
+    print("Adding %s" % uid)
+    
+js[uid] = {
+        'homepage': "http://%s.apache.org" % uid,
+        'name': name
+    }
+
+with open("../../site/json/foundation/pmcs.json", "w") as f:
+    f.write(json.dumps(js))
+    f.close()
+    
+print("Done!")
\ No newline at end of file



Mime
View raw message