Skip to content
Snippets Groups Projects
Commit 2eb11928 authored by Albin Heimerson's avatar Albin Heimerson
Browse files

print errors

parent 3c55e818
Branches
Tags
No related merge requests found
......@@ -31,19 +31,18 @@ folders = [(pdf_folder, ())]
while len(folders) > 0:
folder, path = folders.pop()
ospath = os.path.join(GITLAB_FOLDER_NAME, *path)
print("Uploading files in folder {}".format(ospath))
print("Looking in folder {}".format(ospath))
for f in os.listdir(ospath):
print("Looking at {}".format(f))
gitlabpath = os.path.join(ospath, f)
canvaspath = "/".join([CANVAS_BASE_PATH, CANVAS_FOLDER_NAME, *path, f])
if os.path.isdir(gitlabpath):
nfolder = next((folder for folder in course.get_folders()
if folder.full_name == canvaspath), None)
print("{} is folder, found {} on canvas".format(gitlabpath, nfolder))
if nfolder is None:
print("Creating new canvas folder.")
nfolder = folder.create_folder(f)
folders.append((nfolder, tuple([*path, f])))
else:
print("Uploading file")
print("{} is file, uploading!".format(gitlabpath))
folder.upload(gitlabpath)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment