New arguments to pass students list

This commit is contained in:
nemunaire 2022-03-31 02:22:04 +02:00
parent 408e007912
commit 121da2bbe0
1 changed files with 8 additions and 2 deletions

View File

@ -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