Can include post-scriptum
This commit is contained in:
parent
81bca8ccae
commit
5d5c9d3e7c
10
check.py
10
check.py
@ -104,7 +104,7 @@ running for nemunaire@nemunai.re""")
|
|||||||
smtp.send_message(msg, to_addrs=["peret-report@nemunai.re" if initial_to is None else initial_to + "-report@nemunai.re"])
|
smtp.send_message(msg, to_addrs=["peret-report@nemunai.re" if initial_to is None else initial_to + "-report@nemunai.re"])
|
||||||
|
|
||||||
|
|
||||||
def respondmail(to, subject, ref, checks, initial_to=None):
|
def respondmail(to, subject, ref, checks, initial_to=None, ps=""):
|
||||||
from email.message import EmailMessage
|
from email.message import EmailMessage
|
||||||
|
|
||||||
if not isinstance(checks, list):
|
if not isinstance(checks, list):
|
||||||
@ -157,6 +157,9 @@ def respondmail(to, subject, ref, checks, initial_to=None):
|
|||||||
else:
|
else:
|
||||||
fmt += '\nAfter analyzing your e-mail, I\'ve decided to ' + final_decision + ' it.'
|
fmt += '\nAfter analyzing your e-mail, I\'ve decided to ' + final_decision + ' it.'
|
||||||
|
|
||||||
|
if ps is not None and len(ps) > 0 and final_decision == "ACCEPT":
|
||||||
|
fmt += '\n\n' + ps
|
||||||
|
|
||||||
msg.set_content("""Hi!
|
msg.set_content("""Hi!
|
||||||
|
|
||||||
This is the automatic e-mail analyzer in charge of checking your work.
|
This is the automatic e-mail analyzer in charge of checking your work.
|
||||||
@ -318,6 +321,9 @@ if __name__ == '__main__':
|
|||||||
parser.add_argument('-l', '--students-list', nargs='*',
|
parser.add_argument('-l', '--students-list', nargs='*',
|
||||||
help="students list(s) to use for the check")
|
help="students list(s) to use for the check")
|
||||||
|
|
||||||
|
parser.add_argument('-ps', '--ps',
|
||||||
|
help="Include a PostScriptum info when valid")
|
||||||
|
|
||||||
args = parser.parse_args()
|
args = parser.parse_args()
|
||||||
|
|
||||||
if args.refresh_keys:
|
if args.refresh_keys:
|
||||||
@ -342,4 +348,4 @@ if __name__ == '__main__':
|
|||||||
if args.issue_thunderbird91:
|
if args.issue_thunderbird91:
|
||||||
respondissueemail(frm, subject, ref, initial_to=to)
|
respondissueemail(frm, subject, ref, initial_to=to)
|
||||||
else:
|
else:
|
||||||
respondmail(frm, subject, ref, [c for c in check_mail(gpgmail, cnt, submissions_dir=args.submissions, check_content=not args.sign, check_submission_hash=args.expected_submission_hash, skip_public_key=args.skip_public_key)], initial_to=to)
|
respondmail(frm, subject, ref, [c for c in check_mail(gpgmail, cnt, submissions_dir=args.submissions, check_content=not args.sign, check_submission_hash=args.expected_submission_hash, skip_public_key=args.skip_public_key)], initial_to=to, ps=args.ps)
|
||||||
|
Reference in New Issue
Block a user