community-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1704026 - in /comdev/projects.apache.org/scripts/cronjobs: countaccounts.py parsereleases.py podlings.py
Date Sat, 19 Sep 2015 13:37:03 GMT
Author: sebb
Date: Sat Sep 19 13:37:03 2015
New Revision: 1704026

URL: http://svn.apache.org/viewvc?rev=1704026&view=rev
Log:
Write json direct to file instead of converting to string first

Modified:
    comdev/projects.apache.org/scripts/cronjobs/countaccounts.py
    comdev/projects.apache.org/scripts/cronjobs/parsereleases.py
    comdev/projects.apache.org/scripts/cronjobs/podlings.py

Modified: comdev/projects.apache.org/scripts/cronjobs/countaccounts.py
URL: http://svn.apache.org/viewvc/comdev/projects.apache.org/scripts/cronjobs/countaccounts.py?rev=1704026&r1=1704025&r2=1704026&view=diff
==============================================================================
--- comdev/projects.apache.org/scripts/cronjobs/countaccounts.py (original)
+++ comdev/projects.apache.org/scripts/cronjobs/countaccounts.py Sat Sep 19 13:37:03 2015
@@ -100,7 +100,7 @@ while True:
                 js[ym1] += 1
 
 with open("../../site/json/foundation/accounts-evolution.json", "w") as f:
-    f.write(json.dumps(js, sort_keys=True, indent=0))
+    json.dump(js, f, sort_keys=True, indent=0)
     f.close()
 
 print("Done, found %u entries for this month" % js[ym])

Modified: comdev/projects.apache.org/scripts/cronjobs/parsereleases.py
URL: http://svn.apache.org/viewvc/comdev/projects.apache.org/scripts/cronjobs/parsereleases.py?rev=1704026&r1=1704025&r2=1704026&view=diff
==============================================================================
--- comdev/projects.apache.org/scripts/cronjobs/parsereleases.py (original)
+++ comdev/projects.apache.org/scripts/cronjobs/parsereleases.py Sat Sep 19 13:37:03 2015
@@ -11,6 +11,7 @@ Creates:
 
 TODO: it would probably be more efficient to parse the output of
 svn ls -R https://dist.apache.org/repos/dist/release/
+Could cache the output based on the last changed date
 
 """
 
@@ -95,10 +96,10 @@ for committeeId, d, xdir in getDirList(m
 
 print("Writing releases.json")
 with open("../../site/json/foundation/releases.json", "w") as f:
-    f.write(json.dumps(releases, sort_keys=True, indent=0))
+    json.dump(releases, f, sort_keys=True, indent=0)
     f.close()
 with open("../../site/json/foundation/releases-files.json", "w") as f:
-    f.write(json.dumps(files, sort_keys=True, indent=0))
+    json.dump(files, f, sort_keys=True, indent=0)
     f.close()
 
 print("All done!")
\ No newline at end of file

Modified: comdev/projects.apache.org/scripts/cronjobs/podlings.py
URL: http://svn.apache.org/viewvc/comdev/projects.apache.org/scripts/cronjobs/podlings.py?rev=1704026&r1=1704025&r2=1704026&view=diff
==============================================================================
--- comdev/projects.apache.org/scripts/cronjobs/podlings.py (original)
+++ comdev/projects.apache.org/scripts/cronjobs/podlings.py Sat Sep 19 13:37:03 2015
@@ -112,12 +112,12 @@ for i in js:
     
 print("Writing podlings.json")
 with open('../../site/json/foundation/podlings.json', 'w') as f:
-    f.write(json.dumps(cpods, sort_keys=True, indent=0))
+    json.dump(cpods, f, sort_keys=True, indent=0)
     f.close()
 
 print("Writing podlings-history.json")
 with open('../../site/json/foundation/podlings-history.json', 'w') as f:
-    f.write(json.dumps(cpodsHistory, sort_keys=True, indent=0))
+    json.dump(cpodsHistory, f, sort_keys=True, indent=0)
     f.close()
 
 print("All done!")



Mime
View raw message