You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@community.apache.org by se...@apache.org on 2015/10/07 19:58:59 UTC

svn commit: r1707348 - /comdev/reporter.apache.org/trunk/data/mailinglists.py

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