community-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1696564 - in /comdev/reporter.apache.org/trunk: data/parsepmcs.py mailglomper.py parseversions.py readjira.py site/addrelease.py site/chi.py site/getjson.py site/jiraversions.py
Date Wed, 19 Aug 2015 11:44:18 GMT
Author: sebb
Date: Wed Aug 19 11:44:17 2015
New Revision: 1696564

URL: http://svn.apache.org/r1696564
Log:
Make output files easier to read for debugging

Modified:
    comdev/reporter.apache.org/trunk/data/parsepmcs.py
    comdev/reporter.apache.org/trunk/mailglomper.py
    comdev/reporter.apache.org/trunk/parseversions.py
    comdev/reporter.apache.org/trunk/readjira.py
    comdev/reporter.apache.org/trunk/site/addrelease.py
    comdev/reporter.apache.org/trunk/site/chi.py
    comdev/reporter.apache.org/trunk/site/getjson.py
    comdev/reporter.apache.org/trunk/site/jiraversions.py

Modified: comdev/reporter.apache.org/trunk/data/parsepmcs.py
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/data/parsepmcs.py?rev=1696564&r1=1696563&r2=1696564&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/data/parsepmcs.py (original)
+++ comdev/reporter.apache.org/trunk/data/parsepmcs.py Wed Aug 19 11:44:17 2015
@@ -84,12 +84,12 @@ for project in pmcs:
     
 print("Writing pmcs.json")
 with open("pmcs.json", "w") as f:
-    f.write(json.dumps(pmcs))
+    f.write(json.dumps(pmcs, indent=1))
     f.close()
 
 print("Writing projects.json")
 with open("projects.json", "w") as f:
-    f.write(json.dumps(projects))
+    f.write(json.dumps(projects, indent=1))
     f.close()
     
     

Modified: comdev/reporter.apache.org/trunk/mailglomper.py
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/mailglomper.py?rev=1696564&r1=1696563&r2=1696564&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/mailglomper.py (original)
+++ comdev/reporter.apache.org/trunk/mailglomper.py Wed Aug 19 11:44:17 2015
@@ -71,7 +71,7 @@ for mlist in re.finditer(r"<a href='([-a
         if y == 50:
                 y = 0
                 with open("data/maildata_extended.json",'w+') as f:
-                        f.write(json.dumps(mls))
+                        f.write(json.dumps(mls, indent=1))
 with open("data/maildata_extended.json",'w+') as f:
         f.write(json.dumps(mls, indent=1))
 print("Dumped JSON")

Modified: comdev/reporter.apache.org/trunk/parseversions.py
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/parseversions.py?rev=1696564&r1=1696563&r2=1696564&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/parseversions.py (original)
+++ comdev/reporter.apache.org/trunk/parseversions.py Wed Aug 19 11:44:17 2015
@@ -37,5 +37,5 @@ for project in projects:
            print(err)
        
        with open("/var/www/reporter.apache.org/data/releases/%s.json" % project, "w") as
f:
-              f.write(json.dumps(rdata))
+              f.write(json.dumps(rdata, indent=1))
               f.close()
\ No newline at end of file

Modified: comdev/reporter.apache.org/trunk/readjira.py
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/readjira.py?rev=1696564&r1=1696563&r2=1696564&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/readjira.py (original)
+++ comdev/reporter.apache.org/trunk/readjira.py Wed Aug 19 11:44:17 2015
@@ -25,12 +25,12 @@ def getJIRAS(project):
             req.add_header("Authorization", "Basic %s" % base64string)
             rdata = json.loads(urllib2.urlopen(req).read())
             with open("/var/www/reporter.apache.org/data/JIRA/%s.json" % project, "w") as
f:
-                f.write(json.dumps([cdata['total'], rdata['total'], project]))
+                f.write(json.dumps([cdata['total'], rdata['total'], project], indent=1))
                 f.close()
             return cdata['total'], rdata['total'], project
         except Exception as err:
             with open("/var/www/reporter.apache.org/data/JIRA/%s.json" % project, "w") as
f:
-                f.write(json.dumps([0,0,None]))
+                f.write(json.dumps([0,0,None], indent=1))
                 f.close()
             return 0,0, None
 

Modified: comdev/reporter.apache.org/trunk/site/addrelease.py
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/site/addrelease.py?rev=1696564&r1=1696563&r2=1696564&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/site/addrelease.py (original)
+++ comdev/reporter.apache.org/trunk/site/addrelease.py Wed Aug 19 11:44:17 2015
@@ -50,12 +50,12 @@ if date != None and version and committe
             if version in rdata:
                 del rdata[version]
         with open("/var/www/reporter.apache.org/data/releases/%s.json" % committee, "w")
as f:
-            f.write(json.dumps(rdata))
+            f.write(json.dumps(rdata, indent=1))
             f.close()
             saved = True
             if dojson:
                 print("Content-Type: application/json\r\n\r\n")
-                print(json.dumps({'versions': rdata}))
+                print(json.dumps({'versions': rdata}, indent=1))
             else:
                 print("Content-Type: text/html\r\n\r\n<h3>Data submitted!</h3>You
may see the updated committee data at: <a href='https://reporter.apache.org/?%s'>https://reporter.apache.org/?%s</a>."
% (committee, committee))
 

Modified: comdev/reporter.apache.org/trunk/site/chi.py
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/site/chi.py?rev=1696564&r1=1696563&r2=1696564&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/site/chi.py (original)
+++ comdev/reporter.apache.org/trunk/site/chi.py Wed Aug 19 11:44:17 2015
@@ -291,7 +291,7 @@ if m:
                 'cscore': s
             })
         with open("/var/www/reporter.apache.org/data/health.json", "w") as f:
-            f.write(json.dumps(notes))
+            f.write(json.dumps(notes, indent=1))
             f.close()
             
         print ("Content-Type: text/html\r\n\r\n<h1><img src='/img/chi.png' style='vertical-align:
middle;'/> Community Health Issues</h1><p>This is a quantitative guideline
only. There may be niche cases where the summaries below to not apply. <br/>Scores range
from -10.00 (worst possible score) to +10.00 (best possible score), harmonized by <img
src='/img/equation.png' style='vertical-align: middle;'/></p>")

Modified: comdev/reporter.apache.org/trunk/site/getjson.py
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/site/getjson.py?rev=1696564&r1=1696563&r2=1696564&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/site/getjson.py (original)
+++ comdev/reporter.apache.org/trunk/site/getjson.py Wed Aug 19 11:44:17 2015
@@ -79,7 +79,7 @@ def getJIRAProjects(project):
                 req.add_header("Authorization", "Basic %s" % base64string)
                 x = json.loads(urllib2.urlopen(req).read())
                 with open("/var/www/reporter.apache.org/data/JIRA/projects.json", "w") as
f:
-                    f.write(json.dumps(x))
+                    f.write(json.dumps(x, indent=1))
                     f.close()
             except:
                 pass
@@ -118,12 +118,12 @@ def getJIRAS(project):
             req.add_header("Authorization", "Basic %s" % base64string)
             rdata = json.loads(urllib2.urlopen(req).read())
             with open("/var/www/reporter.apache.org/data/JIRA/%s.json" % project, "w") as
f:
-                f.write(json.dumps([cdata['total'], rdata['total'], project]))
+                f.write(json.dumps([cdata['total'], rdata['total'], project], indent=1))
                 f.close()
             return cdata['total'], rdata['total'], project
         except Exception as err:
             with open("/var/www/reporter.apache.org/data/JIRA/%s.json" % project, "w") as
f:
-                f.write(json.dumps([0,0,None]))
+                f.write(json.dumps([0,0,None], indent=1))
                 f.close()
             return 0,0, None
 
@@ -313,7 +313,7 @@ if m:
         'keys': keys,
         'health': health
     }
-    dump = json.dumps(output)
+    dump = json.dumps(output, indent=1)
     print ("Content-Type: application/json\r\nContent-Length: %u\r\n\r\n" % (len(dump)+1))
     print(dump)
 else:

Modified: comdev/reporter.apache.org/trunk/site/jiraversions.py
URL: http://svn.apache.org/viewvc/comdev/reporter.apache.org/trunk/site/jiraversions.py?rev=1696564&r1=1696563&r2=1696564&view=diff
==============================================================================
--- comdev/reporter.apache.org/trunk/site/jiraversions.py (original)
+++ comdev/reporter.apache.org/trunk/site/jiraversions.py Wed Aug 19 11:44:17 2015
@@ -63,11 +63,11 @@ if (isMember(user) or project in groups)
        except Exception as err:
            pass
        with open("/var/www/reporter.apache.org/data/releases/%s.json" % project, "w") as
f:
-              f.write(json.dumps(rdata))
+              f.write(json.dumps(rdata, indent=1))
               f.close()
               
        print("Content-Type: application/json\r\n\r\n")
-       print(json.dumps({'status': 'Fetched', 'versions': rdata}))
+       print(json.dumps({'status': 'Fetched', 'versions': rdata}, indent=1))
     
 else:
        print("Content-Type: application/json\r\n\r\n{\"status\": \"Data missing\"}\r\n")



Mime
View raw message