Print more info on attachments.
This commit is contained in:
parent
fa7e2f5046
commit
b6f787167f
|
@ -258,10 +258,12 @@ def download_submission_attachments(course, course_view):
|
||||||
for attachment in submission.attachments:
|
for attachment in submission.attachments:
|
||||||
filepath = os.path.join(attachment_dir, attachment.filename)
|
filepath = os.path.join(attachment_dir, attachment.filename)
|
||||||
if not os.path.exists(filepath):
|
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)
|
r = requests.get(attachment.url, allow_redirects=True)
|
||||||
with open(filepath, 'wb') as f:
|
with open(filepath, 'wb') as f:
|
||||||
f.write(r.content)
|
f.write(r.content)
|
||||||
|
else:
|
||||||
|
print('File already exists: {}'.format(filepath))
|
||||||
|
|
||||||
|
|
||||||
def getCoursePageUrls(course):
|
def getCoursePageUrls(course):
|
||||||
|
|
Loading…
Reference in New Issue