incubator-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject svn commit: r1552206 - /incubator/public/trunk/clutch2report.py
Date Thu, 19 Dec 2013 02:11:54 GMT
Author: marvin
Date: Thu Dec 19 02:11:54 2013
New Revision: 1552206

URL: http://svn.apache.org/r1552206
Log:
Fix year-related bugs.

Modified:
    incubator/public/trunk/clutch2report.py

Modified: incubator/public/trunk/clutch2report.py
URL: http://svn.apache.org/viewvc/incubator/public/trunk/clutch2report.py?rev=1552206&r1=1552205&r2=1552206&view=diff
==============================================================================
--- incubator/public/trunk/clutch2report.py (original)
+++ incubator/public/trunk/clutch2report.py Thu Dec 19 02:11:54 2013
@@ -25,7 +25,7 @@ months2groups = [ 'group-1', 'group-2', 
                   'group-1', 'group-2', 'group-3']
 
 boilerplate = """
-= Incubator PMC report for {month} 2013 =
+= Incubator PMC report for {month} {year} =
 
 === Timeline ===
 {timeline}
@@ -35,7 +35,7 @@ boilerplate = """
 
 === Report content ===
 {{{{{{
-Incubator PMC report for {month} 2013
+Incubator PMC report for {month} {year}
 
 The Apache Incubator is the entry path into the ASF for projects and codebases
 wishing to become part of the Foundation's efforts.
@@ -161,6 +161,7 @@ Shepherd/Mentor notes:
 """
 
 def push(pagename, reportFile):
+    print("Publishing " + pagename)
     name = input("Username for wiki.apache.org/incubator: ")
     password = getpass.getpass("Password for wiki.apache.org/incubator: ")
     report = open(reportFile, 'r')
@@ -180,10 +181,9 @@ def cliargs():
     parser.add_argument('--month', type=int, help='the month to report for, defaults to current
month.', default=0)
     return parser.parse_args()  # note that this exits on errors.
 
-def gen_shepherd_assignments(projects, month):
+def gen_shepherd_assignments(projects, month, year):
     # Load the shepherd assignments data for this month's report.
     now = datetime.datetime.now()
-    year = now.year if month >= now.month else now.year + 1
     date = "{0:04d}-{1:02d}".format(year, month)
     assignments_path = os.path.join("content", "shepherd_assignments.json")
     with open(assignments_path, "r") as f:
@@ -213,18 +213,19 @@ def gen_shepherd_assignments(projects, m
 
 def main():
     options = cliargs()
+    now = datetime.datetime.now()
     if options.month == 0:
-        now = datetime.datetime.now()
         month = (now.month % 12) + 1
     else:
         month = options.month
+    year = now.year if month >= now.month else now.year + 1
     curGroup = months2groups[month - 1]
     inputFile = open('clutch.pkl', 'rb')
     projects = pickle.load(inputFile)
     inputFile.close()
 
     timeline  = Timeline(month).to_moin()
-    shepherds = gen_shepherd_assignments(projects, month)
+    shepherds = gen_shepherd_assignments(projects, month, year)
 
     output = open('report.txt', 'w')
 
@@ -235,7 +236,7 @@ def main():
             toc = toc + projects[project]['fullName'] + "\n"
          
     output.write(boilerplate.format(month=calendar.month_name[month],
-                                    toc=toc, shepherds=shepherds,
+                                    year=year, toc=toc, shepherds=shepherds,
                                     timeline=timeline))
     
     ptemplate = Template(perproject)
@@ -261,7 +262,7 @@ def main():
 
     output.close()
     if options.upload:
-        push("{0}2013".format(calendar.month_name[month]), 'report.txt')
+        push("{0}{1}".format(calendar.month_name[month], year), 'report.txt')
     
 if __name__ == "__main__":
     main()



---------------------------------------------------------------------
To unsubscribe, e-mail: cvs-unsubscribe@incubator.apache.org
For additional commands, e-mail: cvs-help@incubator.apache.org


Mime
View raw message