canvas-download 1.1.5__py3-none-any.whl → 1.1.6__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- canvas_download/canvas_download.py +12 -7
- {canvas_download-1.1.5.dist-info → canvas_download-1.1.6.dist-info}/METADATA +1 -1
- canvas_download-1.1.6.dist-info/RECORD +7 -0
- canvas_download-1.1.5.dist-info/RECORD +0 -7
- {canvas_download-1.1.5.dist-info → canvas_download-1.1.6.dist-info}/WHEEL +0 -0
- {canvas_download-1.1.5.dist-info → canvas_download-1.1.6.dist-info}/entry_points.txt +0 -0
- {canvas_download-1.1.5.dist-info → canvas_download-1.1.6.dist-info}/licenses/LICENSE.txt +0 -0
|
@@ -9,6 +9,7 @@ from datetime import datetime, timezone
|
|
|
9
9
|
from pathlib import Path
|
|
10
10
|
|
|
11
11
|
from canvasapi import Canvas
|
|
12
|
+
from canvasapi.exceptions import Forbidden
|
|
12
13
|
from tqdm import tqdm
|
|
13
14
|
|
|
14
15
|
if sys.platform == "win32":
|
|
@@ -92,16 +93,20 @@ def main():
|
|
|
92
93
|
file.download(str(file_path))
|
|
93
94
|
elif user_choice == "files":
|
|
94
95
|
for folder in course.get_folders():
|
|
95
|
-
|
|
96
|
+
folder_name = folder.full_name
|
|
97
|
+
full_path = Path(folder_name)
|
|
96
98
|
folder_path = (
|
|
97
99
|
course_path / full_path.relative_to(full_path.parts[0])
|
|
98
100
|
if full_path.parts[0] == "course files"
|
|
99
101
|
else None
|
|
100
102
|
)
|
|
101
103
|
folder_path.mkdir(parents=True, exist_ok=True)
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
104
|
+
try:
|
|
105
|
+
for file in folder.get_files():
|
|
106
|
+
if file.locked:
|
|
107
|
+
continue
|
|
108
|
+
file_path = folder_path / get_valid_filename(file.display_name)
|
|
109
|
+
if not file_path.exists():
|
|
110
|
+
file.download(str(file_path))
|
|
111
|
+
except Forbidden as err:
|
|
112
|
+
print(err)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.4
|
|
2
2
|
Name: canvas-download
|
|
3
|
-
Version: 1.1.
|
|
3
|
+
Version: 1.1.6
|
|
4
4
|
Summary: Downloads Canvas modules/files into a local directory.
|
|
5
5
|
Project-URL: Homepage, https://github.com/suncloudsmoon/canvas-download
|
|
6
6
|
Project-URL: Issues, https://github.com/suncloudsmoon/canvas-download/issues
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
canvas_download/__init__.py,sha256=UYMprX3e0pTWVOXVUNEa0no_Fp0T4sLV5hVQ-LTtm-A,33
|
|
2
|
+
canvas_download/canvas_download.py,sha256=aeEHl3oKAFVa4Co7kJE5hm3AqhdrQx8WxSy0Krpuisc,4264
|
|
3
|
+
canvas_download-1.1.6.dist-info/METADATA,sha256=SyxJlmVscUE3Vd87bJyJWHRCehNlNaB_mVFwE_7ILpE,1979
|
|
4
|
+
canvas_download-1.1.6.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
5
|
+
canvas_download-1.1.6.dist-info/entry_points.txt,sha256=BxAmz6cqp2vls7uVmWnkbq1Dek5VrXqLE3vSU9Ozu1M,57
|
|
6
|
+
canvas_download-1.1.6.dist-info/licenses/LICENSE.txt,sha256=5chfP2IKlCssxQ6-2ISz9dbWt-d33GN5K1eS9SAUdto,1069
|
|
7
|
+
canvas_download-1.1.6.dist-info/RECORD,,
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
canvas_download/__init__.py,sha256=UYMprX3e0pTWVOXVUNEa0no_Fp0T4sLV5hVQ-LTtm-A,33
|
|
2
|
-
canvas_download/canvas_download.py,sha256=bVjlJap3VYywqpAiY_1i9OE-skMEIn0bYiAv0kEp7WI,4046
|
|
3
|
-
canvas_download-1.1.5.dist-info/METADATA,sha256=CCsaYV9ALJ3G-NcdGUoe6aERDOSf0yQN8VcOAoRVx04,1979
|
|
4
|
-
canvas_download-1.1.5.dist-info/WHEEL,sha256=WLgqFyCfm_KASv4WHyYy0P3pM_m7J5L9k2skdKLirC8,87
|
|
5
|
-
canvas_download-1.1.5.dist-info/entry_points.txt,sha256=BxAmz6cqp2vls7uVmWnkbq1Dek5VrXqLE3vSU9Ozu1M,57
|
|
6
|
-
canvas_download-1.1.5.dist-info/licenses/LICENSE.txt,sha256=5chfP2IKlCssxQ6-2ISz9dbWt-d33GN5K1eS9SAUdto,1069
|
|
7
|
-
canvas_download-1.1.5.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|
|
File without changes
|