community-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1727055 - /comdev/projects.apache.org/scripts/cronjobs/parsecommitters.py
Date Wed, 27 Jan 2016 13:56:56 GMT
Author: sebb
Date: Wed Jan 27 13:56:56 2016
New Revision: 1727055

URL: http://svn.apache.org/viewvc?rev=1727055&view=rev
Log:
Allow for the old style nonldap groups

Modified:
    comdev/projects.apache.org/scripts/cronjobs/parsecommitters.py

Modified: comdev/projects.apache.org/scripts/cronjobs/parsecommitters.py
URL: http://svn.apache.org/viewvc/comdev/projects.apache.org/scripts/cronjobs/parsecommitters.py?rev=1727055&r1=1727054&r2=1727055&view=diff
==============================================================================
--- comdev/projects.apache.org/scripts/cronjobs/parsecommitters.py (original)
+++ comdev/projects.apache.org/scripts/cronjobs/parsecommitters.py Wed Jan 27 13:56:56 2016
@@ -24,12 +24,13 @@ Creates:
 
 import io
 import json
-from urllib.request import urlopen, Request
-from urllib.error import HTTPError
+from urlutils import UrlCache
+
+uc = UrlCache(interval=0)
 
 def loadJson(url):
     print("Reading " +url)
-    resp = io.TextIOWrapper(urlopen(url), encoding='utf-8', errors=None)
+    resp = uc.get(url, name=None, encoding='utf-8', errors=None)
     j = json.load(resp)
     resp.close()
     return j
@@ -61,7 +62,11 @@ nonldapgroups = loadJson('https://whimsy
 
 for g in nonldapgroups:
     groups[g] = nonldapgroups[g]
-    for p in nonldapgroups[g]['roster']:
+    try:
+        roster = nonldapgroups[g]['roster']
+    except:
+        roster = nonldapgroups[g] # old style        
+    for p in roster:
         addPersonGroup(p).append(g)
 
 for g in ldapgroups:



Mime
View raw message