Hi John,

Please find attached a diff that migrates report_reminders.py to Python 3.
I didn't want to commit it in SVN without review :-)

Martin

On Thu, Apr 28, 2022 at 4:30 PM John D. Ament <johndam...@apache.org> wrote:

> Hi all
>
> Wondering if those more familiar with python may be able to help me.  I ran
> into a couple of issues using the report runbook and related scripts.
>
> 1. report_reminders.py requires python2.7.  It seems that Apple is removing
> this as they upgrade to latest OS's and wondering how hard this would be to
> port to python3? [1]. It would likewise be good if everything was on
> python3 as a minimum.
>
> 2. A lot of the processes error'd out, assuming they're one time runs.
> Because the entire year's worth of reports were pre-made, it doesn't work
> right.  Some of what I noticed:
>
> - I can't rerun shepherd assignments (I had to delete the entry in the json
> file)
> - The Confluence template outputs a diff, doesn't tell you the new report
> is staged somewhere to be read from.
> - Even though I cleared a lot of info, fixed reporting groups etc, Yunikorn
> who graduated still was added to the confluence page.  I'm baffled why, I'm
> guessing it's a clutch issue.
>
> 3. There's a few scripts in the root directory [2] that I'm wondering if
> they were intended to be added to the runbook (other report_*.py files).
> Can someone cross check?
>
> 4. Report Reminders use shepherd assignment, would be good if they could
> use clutch data instead (I may have introduced that originally as a cheap
> hack).
>
> Thanks,
>
> John
>
> [1]:
> https://svn.apache.org/repos/asf/incubator/public/trunk/report_reminders.py
> [2]: https://svn.apache.org/repos/asf/incubator/public/trunk/
>
Index: report_reminders.py
===================================================================
--- report_reminders.py	(revision 1900547)
+++ report_reminders.py	(working copy)
@@ -32,7 +32,7 @@
         days_ahead += (weeks - 1) * 7 #we're on or after wednesday, give less time
     return d + datetime.timedelta(days_ahead)
 
-fp = open('email_reminder_template.txt', 'rb')
+fp = open('email_reminder_template.txt', 'r')
 messageBody = fp.read()
 fp.close()
 
@@ -40,8 +40,8 @@
     data = json.load(data_file)
 
 
-month = raw_input('Enter month, in the format of YYYY-MM: ')
-username = raw_input('Enter your ASF Username: ')
+month = input('Enter month, in the format of YYYY-MM: ')
+username = input('Enter your ASF Username: ')
 password = getpass.getpass('Enter your ASF pw: ')
 
 podlingsToReport = data[month].keys()
@@ -72,14 +72,14 @@
 dueDateFormat = podlingReportsDue.strftime("%a, %B %d")
 boardMeetingFormat = boardMeeting.strftime("%a, %d %B %Y")
 
-print dueDateFormat
-print boardMeetingFormat
+print(dueDateFormat)
+print(boardMeetingFormat)
 
 emailBodyString = messageBody.format(boardMeetingFormat, dueDateFormat, wikiPage)
 
 s = SMTP('mail-relay.apache.org')
 s.login(username, password)
-print "connected"
+print("connected")
 for podling in podlingsToReport:
     if podling in overrides:
         emailTo = overrides[podling]
---------------------------------------------------------------------
To unsubscribe, e-mail: general-unsubscr...@incubator.apache.org
For additional commands, e-mail: general-h...@incubator.apache.org

Reply via email to