community-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From humbed...@apache.org
Subject svn commit: r1663873 - /comdev/reporter.apache.org/site/getjson.py
Date Wed, 04 Mar 2015 07:39:29 GMT
Author: humbedooh
Date: Wed Mar  4 07:39:29 2015
New Revision: 1663873

URL: http://svn.apache.org/r1663873
Log:
if we can't fetch a project json file, let's at least find them in the pmc file and work from
there

Modified:
    comdev/reporter.apache.org/site/getjson.py

Modified: comdev/reporter.apache.org/site/getjson.py
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/site/getjson.py?rev=1663873&r1=1663872&r2=1663873&view=diff
==============================================================================
--- comdev/reporter.apache.org/site/getjson.py (original)
+++ comdev/reporter.apache.org/site/getjson.py Wed Mar  4 07:39:29 2015
@@ -81,15 +81,36 @@ def getProjectData(project):
         with open("/var/www/projects.apache.org/site/json/projects/%s.json" % project, "r")
as f:
             x = json.loads(f.read())
             f.close()
+            with open("/var/www/projects.apache.org/site/json/foundation/pmcs.json", "r")
as f:
+                p = json.loads(f.read())
+                f.close()
+                for xproject in p:
+                    if xproject == project:
+                        x['name'] = p[project]['name']
             with open("/var/www/projects.apache.org/site/json/foundation/chairs.json", "r")
as f:
                 c = json.loads(f.read())
                 f.close()
-                for project in c:
-                    if project == x['name']:
-                        x['chair'] = c[project]
+                for xproject in c:
+                    if xproject == x['name']:
+                        x['chair'] = c[xproject]
+            
         return x;
     except:
-        return {}
+        x = {}
+        with open("/var/www/projects.apache.org/site/json/foundation/pmcs.json", "r") as
f:
+            p = json.loads(f.read())
+            f.close()
+            for xproject in p:
+                if xproject == project:
+                    x['name'] = p[project]['name']
+                    
+        with open("/var/www/projects.apache.org/site/json/foundation/chairs.json", "r") as
f:
+                c = json.loads(f.read())
+                f.close()
+                for xproject in c:
+                    if 'name' in x and xproject == x['name']:
+                        x['chair'] = c[xproject]
+        return x
     
 def getReleaseData(project):
     try:



Mime
View raw message