From b6f787167f8e238a3a6da6fd24c475a662a8bbd0 Mon Sep 17 00:00:00 2001 From: "Jason K. Moore" Date: Wed, 8 Jul 2020 14:20:35 -0700 Subject: [PATCH] Print more info on attachments. --- export.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/export.py b/export.py index d26d7e6..729f2f2 100644 --- a/export.py +++ b/export.py @@ -258,10 +258,12 @@ def download_submission_attachments(course, course_view): for attachment in submission.attachments: filepath = os.path.join(attachment_dir, attachment.filename) if not os.path.exists(filepath): - print('Downloading attachment: {}'.format(attachment.filename)) + print('Downloading attachment: {}'.format(filepath)) r = requests.get(attachment.url, allow_redirects=True) with open(filepath, 'wb') as f: f.write(r.content) + else: + print('File already exists: {}'.format(filepath)) def getCoursePageUrls(course):