community-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1791135 - /comdev/reporter.apache.org/trunk/scripts/parsepmcs.py
Date Wed, 12 Apr 2017 15:40:29 GMT
Author: sebb
Date: Wed Apr 12 15:40:28 2017
New Revision: 1791135

URL: http://svn.apache.org/viewvc?rev=1791135&view=rev
Log:
Use historic copy if working copy is missing

Modified:
    comdev/reporter.apache.org/trunk/scripts/parsepmcs.py

Modified: comdev/reporter.apache.org/trunk/scripts/parsepmcs.py
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/scripts/parsepmcs.py?rev=1791135&r1=1791134&r2=1791135&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/scripts/parsepmcs.py (original)
+++ comdev/reporter.apache.org/trunk/scripts/parsepmcs.py Wed Apr 12 15:40:28 2017
@@ -59,18 +59,30 @@ def loadJson(url):
     resp.close()
     return j
 
+def readJson(file):
+    print("Reading " + file)
+    with open(file, "r", encoding='utf-8') as f:
+        return json.loads(f.read())
+
 __HOME = '../data/'
 
 pmcs = {}
 
-print("Reading pmcs.json")
-with open(__HOME + "pmcs.json", "r", encoding='utf-8') as f:
-    pmcs = json.loads(f.read())
+print("Processing pmcs.json")
+try:
+    pmcs=readJson(__HOME + "pmcs.json")
+except Exception as e:
+    print(e," - using backup")
+    pmcs=readJson(__HOME + "history/pmcs.json")
 
 projects = {}
-print("Reading projects.json")
-with open(__HOME + "projects.json", "r", encoding='utf-8') as f:
-    projects = json.loads(f.read())
+
+print("Processing projects.json")
+try:
+    projects=readJson(__HOME + "projects.json")
+except Exception as e:
+    print(e," - using backup")
+    projects=readJson(__HOME + "history/projects.json")
 
 newgroups = []
 newpmcs = []



Mime
View raw message