From 121da2bbe0d342cb7b911866aa281a7b22224e8e Mon Sep 17 00:00:00 2001 From: Pierre-Olivier Mercier Date: Thu, 31 Mar 2022 02:22:04 +0200 Subject: [PATCH] New arguments to pass students list --- check.py | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/check.py b/check.py index 7c497cc..852e885 100755 --- a/check.py +++ b/check.py @@ -17,7 +17,7 @@ SEND_TO_REALUSER = False REVIEW_BEFORE_SEND = False BETA = False ALTERNATE_RESOLUTIONS = False - +STUDENTS_LISTS = ["/home/nemunaire/workspace/peret/SRS2022.csv", "/home/nemunaire/workspace/peret/GISTRE2022.csv"] import archive import envelope @@ -48,7 +48,7 @@ def gen_checks(gpgmail, submissions_dir, check_content=False, check_submission_h else: yield (envelope.skip, [gpgmail]) - yield (login.check, ["/home/nemunaire/workspace/peret/SRS2022.csv", "/home/nemunaire/workspace/peret/GISTRE2022.csv"]) + yield (login.check, STUDENTS_LISTS) if check_content: if HARD_MAX_SUBMISSION is not None: yield (late.check, [HARD_MAX_SUBMISSION, SOFT_MAX_SUBMISSION]) @@ -315,6 +315,9 @@ if __name__ == '__main__': parser.add_argument('--alternate-resolutions', action="store_true", help="enable if you want to display alternate resolutions") + parser.add_argument('-l', '--students-list', nargs='*', + help="students list(s) to use for the check") + args = parser.parse_args() if args.refresh_keys: @@ -327,6 +330,9 @@ if __name__ == '__main__': with subprocess.Popen(["date", "-d", args.hard_max_submission, "-u", "-Iseconds"], stdout=subprocess.PIPE) as f: HARD_MAX_SUBMISSION = datetime.strptime(f.stdout.read().strip().decode().replace(":", ""), "%Y-%m-%dT%H%M%S%z") + if args.students_list is not None: + STUDENTS_LISTS = args.students_list + ALTERNATE_RESOLUTIONS = args.alternate_resolutions SEND_TO_REALUSER = args.real_send REVIEW_BEFORE_SEND = args.review_before_send