Commit 12147e88 authored by Kevin Lin's avatar Kevin Lin
Browse files

get_groups_zoom.py: Remove dependency on config file

parent 16579d44
......@@ -5,15 +5,10 @@ import canvas_api
import os.path
import readline
from config import token_file, course_id
if __name__ == "__main__":
if not os.path.isfile(token_file):
token = input("Enter a Canvas Token (https://canvas.uw.edu/profile/settings): ")
with open(token_file, 'w') as f:
f.write(token)
token = open(token_file, 'r').read().strip(" \n\t")
token = os.getenv("TOKEN")
if not token:
token = input("Enter a Canvas token (https://canvas.uw.edu/profile/settings): ")
canvas = canvas_api.Canvas(token)
......@@ -22,6 +17,10 @@ if __name__ == "__main__":
print("Invalid Canvas token.")
exit(1)
course_id = os.getenv("COURSE_ID")
if not course_id:
course_id = input("Enter a Canvas course ID (URL slug): ")
course = canvas.get_course(course_id)
if course is None:
print("Invalid Canvas course.")
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment