community-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1707348 - /comdev/reporter.apache.org/trunk/data/mailinglists.py
Date Wed, 07 Oct 2015 17:58:59 GMT
Author: sebb
Date: Wed Oct  7 17:58:59 2015
New Revision: 1707348

URL: http://svn.apache.org/viewvc?rev=1707348&view=rev
Log:
Get mailing list subscription details in pretty json format

Added:
    comdev/reporter.apache.org/trunk/data/mailinglists.py   (with props)

Added: comdev/reporter.apache.org/trunk/data/mailinglists.py
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/data/mailinglists.py?rev=1707348&view=auto
==============================================================================
--- comdev/reporter.apache.org/trunk/data/mailinglists.py (added)
+++ comdev/reporter.apache.org/trunk/data/mailinglists.py Wed Oct  7 17:58:59 2015
@@ -0,0 +1,24 @@
+import sys
+if sys.hexversion < 0x030000F0:
+    raise RuntimeError("This script requires Python3")
+"""
+   This script creates mailinglists.json
+"""
+import json
+import urllib.request
+import os
+
+mailurl = ""
+with open("%s/.mailurl" % os.environ['HOME'], "r") as f:
+    mailurl = f.read().strip()
+    f.close()
+
+print("Reading mail subscription details")
+
+data = urllib.request.urlopen(mailurl).read().decode('utf-8')
+maildata = json.loads(data, encoding='utf-8')
+
+print("Writing mailinglists.json")
+with open("mailinglists.json", "w", encoding='utf-8') as f:
+    json.dump(maildata, f, sort_keys=True, indent=1, ensure_ascii=False)
+    f.close()

Propchange: comdev/reporter.apache.org/trunk/data/mailinglists.py
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message