Compare commits
2 Commits
81bca8ccae
...
eff10e0cda
Author | SHA1 | Date | |
---|---|---|---|
eff10e0cda | |||
5d5c9d3e7c |
@ -104,10 +104,12 @@ def extract(cnt, dest=None):
|
|||||||
with tempfile.TemporaryDirectory() as temp:
|
with tempfile.TemporaryDirectory() as temp:
|
||||||
cmdline = ["tar", "--no-same-owner", "--no-same-permissions"]
|
cmdline = ["tar", "--no-same-owner", "--no-same-permissions"]
|
||||||
if dest is not None:
|
if dest is not None:
|
||||||
cmdline.append("-xvC")
|
cmdline.append("-xC")
|
||||||
cmdline.append(temp)
|
cmdline.append(temp)
|
||||||
else:
|
else:
|
||||||
cmdline.append("-t")
|
cmdline.append("-t")
|
||||||
|
if len(data) < 3145728:
|
||||||
|
cmdline.append("-v")
|
||||||
if type in ["application/gzip", "application/x-gzip"]:
|
if type in ["application/gzip", "application/x-gzip"]:
|
||||||
cmdline.append("-z")
|
cmdline.append("-z")
|
||||||
elif type in ["application/xz", "application/x-xz"]:
|
elif type in ["application/xz", "application/x-xz"]:
|
||||||
|
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