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

print errors

parent 19e052d2
Branches
No related tags found
No related merge requests found
......@@ -31,15 +31,18 @@ folders = [(pdf_folder, tuple([""]))]
while len(folders) > 0:
folder, path = folders.pop()
ospath = os.path.join(GITLAB_FOLDER_NAME, *path)
print("Uploading pdf files in folder {}".format(ospath))
print("Uploading files in folder {}".format(ospath))
for f in os.listdir(ospath):
print("Looking at {}".format(f))
gitlabpath = os.path.join(ospath, f)
canvaspath = "/".join(tuple([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.full_name))
if nfolder is None:
nfolder = folder.create_folder(f)
folders.append((nfolder, tuple([*path, f])))
else:
print("Uploading file")
folder.upload(gitlabpath)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment