community-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From hbout...@apache.org
Subject svn commit: r1671704 - in /comdev/projects.apache.org/scripts/cronjobs: countaccounts.py parsecommitters.py parsereleases.py podlings.py
Date Mon, 06 Apr 2015 22:25:50 GMT
Author: hboutemy
Date: Mon Apr  6 22:25:50 2015
New Revision: 1671704

URL: http://svn.apache.org/r1671704
Log:
minimal formatting for generated json files

Modified:
    comdev/projects.apache.org/scripts/cronjobs/countaccounts.py
    comdev/projects.apache.org/scripts/cronjobs/parsecommitters.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=1671704&r1=1671703&r2=1671704&view=diff
==============================================================================
--- comdev/projects.apache.org/scripts/cronjobs/countaccounts.py (original)
+++ comdev/projects.apache.org/scripts/cronjobs/countaccounts.py Mon Apr  6 22:25:50 2015
@@ -33,7 +33,7 @@ while True:
 
 
 with open("../../site/json/foundation/accounts.json", "w") as f:
-    f.write(json.dumps(js))
+    f.write(json.dumps(js, sort_keys=True, indent=0))
     f.close()
-    
+
 print("Done, found %u entries for this month" % js[ym])
\ No newline at end of file

Modified: comdev/projects.apache.org/scripts/cronjobs/parsecommitters.py
URL: http://svn.apache.org/viewvc/comdev/projects.apache.org/scripts/cronjobs/parsecommitters.py?rev=1671704&r1=1671703&r2=1671704&view=diff
==============================================================================
--- comdev/projects.apache.org/scripts/cronjobs/parsecommitters.py (original)
+++ comdev/projects.apache.org/scripts/cronjobs/parsecommitters.py Mon Apr  6 22:25:50 2015
@@ -30,16 +30,16 @@ for committer in re.findall(r"<tr>([\S\s
             'member': isMember,
             'projects': projects
         }
-        
+
 
 print("Writing people.json")
 with open("../../site/json/foundation/people.json", "w") as f:
-    f.write(json.dumps(people))
+    f.write(json.dumps(people, sort_keys=True, indent=0))
     f.close()
-    
+
 print("Writing committers.json")
 with open("../../site/json/foundation/committers.json", "w") as f:
-    f.write(json.dumps(pmcs))
+    f.write(json.dumps(pmcs, sort_keys=True, indent=0))
     f.close()
-    
+
 print("All done!")
\ No newline at end of file

Modified: comdev/projects.apache.org/scripts/cronjobs/parsereleases.py
URL: http://svn.apache.org/viewvc/comdev/projects.apache.org/scripts/cronjobs/parsereleases.py?rev=1671704&r1=1671703&r2=1671704&view=diff
==============================================================================
--- comdev/projects.apache.org/scripts/cronjobs/parsereleases.py (original)
+++ comdev/projects.apache.org/scripts/cronjobs/parsereleases.py Mon Apr  6 22:25:50 2015
@@ -34,7 +34,7 @@ def parseDir(project, path):
                     filename = match.group(1)
                     filename = re.sub(r"[-_.]*([Aa]pache|%s|src|bin|deps)[-_.]*" % project,
"", filename, count=10, flags=re.IGNORECASE|re.UNICODE)
                     releases[project][filename] = d
-        
+
 
 for project, d, xdir in getDirList(mainurl):
     if project != "incubator":
@@ -48,12 +48,12 @@ for project, d, xdir in getDirList(mainu
             releases[project] = releases[project] if project in releases else {}
             parseDir(project, "incubator/%s" % podling)
     with open("../../site/json/foundation/releases.json", "w") as f:
-        f.write(json.dumps(releases))
+        f.write(json.dumps(releases, sort_keys=True, indent=0))
         f.close()
-    
+
 print("Writing releases.json")
 with open("../../site/json/foundation/releases.json", "w") as f:
-    f.write(json.dumps(releases))
+    f.write(json.dumps(releases, 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=1671704&r1=1671703&r2=1671704&view=diff
==============================================================================
--- comdev/projects.apache.org/scripts/cronjobs/podlings.py (original)
+++ comdev/projects.apache.org/scripts/cronjobs/podlings.py Mon Apr  6 22:25:50 2015
@@ -21,7 +21,7 @@ for year in range(2003,2016):
         grads[m] = 0
         new[m] = 0
         ret[m] = 0
-        
+
 for s in itemlist :
         name = s.attributes['name'].value
         uname = s.attributes['resource'].value
@@ -38,7 +38,7 @@ for s in itemlist :
             sd = re.match(r"(\d{4}-\d+)", sd).group(1)
         if ed and re.match(r"(\d{4}-\d+)", ed):
             ed = re.match(r"(\d{4}-\d+)", ed).group(1)
-        
+
         new[sd] += 1
         if status == "graduated":
             if not ed:
@@ -60,7 +60,7 @@ for s in itemlist :
                 'homepage': "http://%s.incubator.apache.org/" % uname,
                 'podling': True
             }
-    
+
 currentMonth = datetime.now().month
 currentYear = datetime.now().year
 
@@ -77,7 +77,7 @@ for year in range(2003,2016):
         }
         if currentYear > year or (currentYear == year and currentMonth >= month):
             js.append(mjs)
-        
+
 js.reverse()
 
 for i in js:
@@ -88,13 +88,12 @@ for i in js:
     
 print("Writing evolution.json")
 with open('../../site/json/foundation/evolution.json', 'w') as f:
-    f.write(json.dumps(js))
+    f.write(json.dumps(js, indent=0))
     f.close()
-    
+
 print("Writing podlings.json")
 with open('../../site/json/foundation/podlings.json', 'w') as f:
-    f.write(json.dumps(cpods))
+    f.write(json.dumps(cpods, sort_keys=True, indent=0))
     f.close()
-    
+
 print("All done!")
-    
\ No newline at end of file



Mime
View raw message