From f9d92b31e4bea3037c75f7c7a508c1be09811fd0 Mon Sep 17 00:00:00 2001 From: kryptoish Date: Sat, 7 Dec 2024 22:12:43 -0800 Subject: Final Working Version --- trigger.py | 31 ------------------------------- 1 file changed, 31 deletions(-) delete mode 100644 trigger.py (limited to 'trigger.py') diff --git a/trigger.py b/trigger.py deleted file mode 100644 index 72ecf10..0000000 --- a/trigger.py +++ /dev/null @@ -1,31 +0,0 @@ -#!/usr/bin/python3 -# WARNING: Do not modify this file unless directed to do so by your instructor - -import requests -import os -import re - -def notify_autograder(lab,section,student): - API_ENDPOINT = "https://cpen211.ece.ubc.ca/autograder_build_request.php" - data = {'github_username':student, - 'lab':lab, - 'section':section} - r = requests.post(url=API_ENDPOINT, data=data, timeout=5) - if r.text == 'OK': - print('Queuing your submission for ranking. You will be emailed when results are available.') - else: - print('ERROR unable to queue your submission for ranking; notify instructor.') - print('Response from server -->') - print(r.text); - print('<---') - -m = re.search(r'lab-7-l1[a-z]-bonus-([^/])+/lab-7-l1(?P
[a-z])-bonus-(?P\S+)', os.getcwd()) -if m: - github_username = m.group('user') - print("Username: " + github_username) - section = m.group('section').upper() - print("Section: L1" + section) -else: - print("ERROR: Did not match regex. Unable to queue your submission for ranking; notify instructor.") - exit(1) -notify_autograder(8,section,github_username) -- cgit v1.2.3