community-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From s...@apache.org
Subject svn commit: r1728071 - /comdev/projects.apache.org/scripts/cronjobs/podlings.py
Date Tue, 02 Feb 2016 10:33:34 GMT
Author: sebb
Date: Tue Feb  2 10:33:34 2016
New Revision: 1728071

URL: http://svn.apache.org/viewvc?rev=1728071&view=rev
Log:
Make sure code continues to work each year

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

Modified: comdev/projects.apache.org/scripts/cronjobs/podlings.py
URL: http://svn.apache.org/viewvc/comdev/projects.apache.org/scripts/cronjobs/podlings.py?rev=1728071&r1=1728070&r2=1728071&view=diff
==============================================================================
--- comdev/projects.apache.org/scripts/cronjobs/podlings.py (original)
+++ comdev/projects.apache.org/scripts/cronjobs/podlings.py Tue Feb  2 10:33:34 2016
@@ -23,8 +23,16 @@ current  = 0
 cpods = {}
 cpodsHistory = {}
 
+now = datetime.now()
+currentMonth = now.month
+currentYear  = now.year
+# years for the ranges
+nextYear = currentYear + 1
+startYear = 2003
+
+
 fieldnames = ['month', 'new', 'graduated', 'retired']
-for year in range(2003,2016):
+for year in range(startYear, nextYear):
     for month in range(1,13):
         m = "%u-%02u" % (year, month)
         grads[m] = 0
@@ -86,11 +94,8 @@ for s in itemlist :
                 'podling': True
             }
 
-currentMonth = datetime.now().month
-currentYear = datetime.now().year
-
 js = []
-for year in range(2003,2016):
+for year in range(startYear, nextYear):
     for month in range(1,13):
         m = "%u-%02u" % (year, month)
         mjs = {



Mime
View raw message