incubator-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mar...@apache.org
Subject svn commit: r1537794 - /incubator/public/trunk/clutch2report.py
Date Fri, 01 Nov 2013 01:04:03 GMT
Author: marvin
Date: Fri Nov  1 01:04:03 2013
New Revision: 1537794

URL: http://svn.apache.org/r1537794
Log:
Replace `push` option with `upload`.

Replace the `push` option, which took a username and password on the
command line, with `upload` which is only a flag.  Acquire the username
and password interactively.

Modified:
    incubator/public/trunk/clutch2report.py

Modified: incubator/public/trunk/clutch2report.py
URL: http://svn.apache.org/viewvc/incubator/public/trunk/clutch2report.py?rev=1537794&r1=1537793&r2=1537794&view=diff
==============================================================================
--- incubator/public/trunk/clutch2report.py (original)
+++ incubator/public/trunk/clutch2report.py Fri Nov  1 01:04:03 2013
@@ -3,6 +3,7 @@ import pickle
 import pprint
 from string import Template
 import datetime
+import getpass
 import argparse
 import textwrap
 import calendar
@@ -149,7 +150,9 @@ Shepherd notes:
 
 """
 
-def push(name, password, pagename, reportFile):
+def push(pagename, reportFile):
+    name = input("Username for wiki.apache.org/incubator: ")
+    password = getpass.getpass("Password for wiki.apache.org/incubator: ")
     report = open(reportFile, 'r')
     reportcontent = report.read(-1)
     report.close()
@@ -162,7 +165,8 @@ def push(name, password, pagename, repor
 
 def cliargs():
     parser = argparse.ArgumentParser(description='Create (and optionally push) a template
for an incubator report.')
-    parser.add_argument('--push', nargs=2, help='whether to push the report template.', metavar=('username',
'password'))
+    parser.add_argument('--upload', action='store_true',
+                        help='whether to upload the report template.')
     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.
 
@@ -244,9 +248,8 @@ def main():
     output.write("\n}}}\n")
 
     output.close()
-    pushdata = options.push
-    if pushdata != None:
-        push(pushdata[0], pushdata[1], "{0}2013".format(calendar.month_name[month]), 'report.txt')
+    if options.upload:
+        push("{0}2013".format(calendar.month_name[month]), '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