[Libreoffice-commits] dev-tools.git: esc-reporting/esc-analyze.py esc-reporting/esc-automate.py

jan Iversen jani at libreoffice.org
Tue May 9 16:18:11 UTC 2017


 esc-reporting/esc-analyze.py  |    2 +-
 esc-reporting/esc-automate.py |   25 +++++++++++++++++++++++--
 2 files changed, 24 insertions(+), 3 deletions(-)

New commits:
commit bbaeab07825aeedf3b2334f3b56e326d9ae86cbc
Author: jan Iversen <jani at libreoffice.org>
Date:   Tue May 9 18:17:49 2017 +0200

    esc-report, add automate to config.json

diff --git a/esc-reporting/esc-analyze.py b/esc-reporting/esc-analyze.py
index 1aa6c61..2dc178e 100755
--- a/esc-reporting/esc-analyze.py
+++ b/esc-reporting/esc-analyze.py
@@ -571,7 +571,7 @@ def analyze_reports():
     global cfg, statList, openhubData, bugzillaData, gerritData, gitData
 
     print("reports: analyze", flush=True)
-    mailedDate = datetime.datetime.strptime(cfg['git']['last-mail-run'], '%Y-%m-%d') - datetime.timedelta(days=90)
+    mailedDate = datetime.datetime.strptime(cfg['automate']['last-mail-run'], '%Y-%m-%d') - datetime.timedelta(days=90)
     zeroDate = datetime.datetime(year=2001, month=1, day=1)
     statList['reportList'] = {'award_1st_email': [],
                               'pending_license': [],
diff --git a/esc-reporting/esc-automate.py b/esc-reporting/esc-automate.py
index ca6dfce..e1ee553 100755
--- a/esc-reporting/esc-automate.py
+++ b/esc-reporting/esc-automate.py
@@ -86,12 +86,29 @@ def handle_bugzilla_cc(id, email):
 
 
 def handle_mail_pdf(name, email):
-    return
+    global mail_pdf_index
+
+    mail_pdf_index += 1
+    return {'title': 'x', 'mail': 'mentoring at documentfoundation.org', 'attach': 'x', 'file' : '/tmp/x'}
 
 
 
 def handle_mail_miss_you(name, email):
-    return
+    global mail_miss_you
+
+    mail_miss_you += 1
+    fileName = '/tmp/esc_pdf_' + str(mail_miss_you)
+    fp = fopen(fileName, 'w')
+    print('Hi\n' \
+          'We have noticed you have not submitted patches to LibreOffice in a while. ' \
+          'LibreOffice depend on volunteers like you to keep the software growing.\n' \
+          'Volunteering is something most of us does in our spare time, so it is normal to have periods where you ' \
+          'want to concentrate on other items, we basically just wanted to say "we miss you".\n' \
+          'If you have problems or want to comment on issues, please do not hesitate to contact our development mentor.\n\n' \
+          'Thanks in advance\n' \
+          'the LibreOffice Development Team\n', file=fp)
+    fclose(fp)
+    return {'title': 'LibreOffice calling for help', 'mail': 'mentoring at documentfoundation.org', 'file': fileName }
 
 
 
@@ -120,6 +137,8 @@ def runCfg(platform):
 
 def runAutomate():
     global cfg, autoList
+    global mail_pdf_index, mail_miss_you
+
 
     autoList = util_load_data_file(cfg['homedir'] + 'stats.json')['automateList']
 
@@ -180,6 +199,8 @@ def runAutomate():
       pass
 
     xMail = []
+    mail_pdf_index = 0
+    mail_miss_you = 0
     try:
       for row in autoList['mail']['award_1st_email']:
         x = handle_mail_pdf(row['name'], row['email'])


More information about the Libreoffice-commits mailing list