esc-reporting/esc-analyze.py | 2 +- esc-reporting/esc-automate.py | 36 +++++++++++++++++------------------- 2 files changed, 18 insertions(+), 20 deletions(-)
New commits: commit 60f2b14855a297f2e6a491f3dded6d73d20d6ad7 Author: jan Iversen <[email protected]> Date: Tue May 9 19:41:21 2017 +0200 esc-report, added config for automation diff --git a/esc-reporting/esc-analyze.py b/esc-reporting/esc-analyze.py index 2dc178e..5977a65 100755 --- a/esc-reporting/esc-analyze.py +++ b/esc-reporting/esc-analyze.py @@ -644,7 +644,7 @@ def analyze_reports(): tmpListToReview.append(entry['id']) for id in tmpListToReview: - reviewEmail = '<default>' + reviewEmail = cfg['automate']['gerritRewiewUserEmail'] txt = gerritData['patch'][id]['subject'] if txt.startswith('tdf#'): try: diff --git a/esc-reporting/esc-automate.py b/esc-reporting/esc-automate.py index e1ee553..f101d22 100755 --- a/esc-reporting/esc-automate.py +++ b/esc-reporting/esc-automate.py @@ -86,29 +86,27 @@ def handle_bugzilla_cc(id, email): def handle_mail_pdf(name, email): - global mail_pdf_index + global cfg, mail_pdf_index mail_pdf_index += 1 - return {'title': 'x', 'mail': '[email protected]', 'attach': 'x', 'file' : '/tmp/x'} + fileName = '/tmp/esc_pdf_' + str(mail_pdf_index) + fp = open(fileName, 'w') + print(cfg['automate']['1st award']['content'], file=fp) + fp.close() + return {'title': cfg['automate']['1st award']['subject'], 'mail': '[email protected]', 'attach': 'x', 'file' : fileName} def handle_mail_miss_you(name, email): - global mail_miss_you + global cfg, 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': '[email protected]', 'file': fileName } + fileName = '/tmp/esc_miss_' + str(mail_miss_you) + fp = open(fileName, 'w') + print(cfg['automate']['we miss you']['content'], file=fp) + fp.close() + return {'title': cfg['automate']['we miss you']['subject'], + 'mail': '[email protected]', 'file': fileName } @@ -144,13 +142,13 @@ def runAutomate(): try: for id in autoList['gerrit']['to_abandon_abandon']: - handle_gerrit_abandon(id, "Abandoning due to lack of work, be aware it can anytime be reopened if you want to continue working") + handle_gerrit_abandon(id, cfg['automate']['gerrit']['abandon']) except Exception as e: print('ERROR: handle_gerrit_abandon failed with ' + str(e)) pass try: for id in autoList['gerrit']['to_abandon_comment']: - handle_gerrit_comment(id, "A polite ping, still working on this patch") + handle_gerrit_comment(id, 'A polite ping, ' + cfg['automate']['gerrit']['comment']) except Exception as e: print('ERROR: handle_gerrit_comment failed with ' + str(e)) pass @@ -163,13 +161,13 @@ def runAutomate(): try: for id in autoList['bugzilla']['to_unassign_comment']: - handle_bugzilla_comment(id, "A polite ping, still working on this bug") + handle_bugzilla_comment(id, 'A polite ping, ' + cfg['automate']['bugzilla']['comment']) except Exception as e: print('ERROR: handle_bugzilla_comment failed with ' + str(e)) pass try: for id in autoList['bugzilla']['to_unassign_unassign']: - handle_bugzilla_unassign(id, "Unassigning due to lack of work, be aware it can anytime be assigned again if you want to continue working") + handle_bugzilla_unassign(id, cfg['automate']['bugzilla']['comment']) except Exception as e: print('ERROR: handle_bugzilla_unassign failed with ' + str(e)) pass _______________________________________________ Libreoffice-commits mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/libreoffice-commits
