e2xauthoring 0.3.0.dev0__py3-none-any.whl → 0.3.0.dev1__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.
- e2xauthoring/__version__.py +1 -1
- e2xauthoring/managers/taskmanager.py +25 -5
- e2xauthoring/managers/taskpoolmanager.py +16 -3
- {e2xauthoring-0.3.0.dev0.dist-info → e2xauthoring-0.3.0.dev1.dist-info}/METADATA +1 -1
- {e2xauthoring-0.3.0.dev0.dist-info → e2xauthoring-0.3.0.dev1.dist-info}/RECORD +7 -7
- {e2xauthoring-0.3.0.dev0.dist-info → e2xauthoring-0.3.0.dev1.dist-info}/WHEEL +0 -0
- {e2xauthoring-0.3.0.dev0.dist-info → e2xauthoring-0.3.0.dev1.dist-info}/licenses/LICENSE +0 -0
e2xauthoring/__version__.py
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
__version__ = "0.3.0-
|
|
1
|
+
__version__ = "0.3.0-dev1"
|
|
@@ -128,12 +128,23 @@ class TaskManager(BaseManager):
|
|
|
128
128
|
tasks = []
|
|
129
129
|
path = os.path.join(self.base_path, pool)
|
|
130
130
|
assert os.path.exists(path), f"No pool with the name {pool} exists."
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
131
|
+
|
|
132
|
+
coroutines = []
|
|
133
|
+
task_dirs = self.listdir(os.path.join(self.base_path, pool))
|
|
134
|
+
|
|
135
|
+
for task_dir in task_dirs:
|
|
136
|
+
coroutines.append(self.__get_task_info(task_dir, pool))
|
|
137
|
+
coroutines.append(asyncio.to_thread(self.git_status, pool, task_dir))
|
|
138
|
+
|
|
139
|
+
results = await asyncio.gather(*coroutines)
|
|
140
|
+
|
|
141
|
+
for i, task_dir in enumerate(task_dirs):
|
|
142
|
+
points, n_questions = results[i * 2]
|
|
143
|
+
git_status = results[i * 2 + 1]
|
|
134
144
|
|
|
135
145
|
if "repo" in git_status:
|
|
136
146
|
del git_status["repo"]
|
|
147
|
+
|
|
137
148
|
tasks.append(
|
|
138
149
|
Task(
|
|
139
150
|
name=task_dir,
|
|
@@ -143,15 +154,24 @@ class TaskManager(BaseManager):
|
|
|
143
154
|
git_status=git_status,
|
|
144
155
|
)
|
|
145
156
|
)
|
|
157
|
+
|
|
146
158
|
return tasks
|
|
147
159
|
|
|
148
160
|
async def list_all(self):
|
|
149
161
|
pool_manager = TaskPoolManager(self.coursedir)
|
|
150
162
|
tasks = []
|
|
151
163
|
pool_list = await pool_manager.list()
|
|
152
|
-
|
|
153
|
-
|
|
164
|
+
|
|
165
|
+
# Collect all coroutines
|
|
166
|
+
coroutines = [self.list(pool.name) for pool in pool_list]
|
|
167
|
+
|
|
168
|
+
# Run them concurrently
|
|
169
|
+
results = await asyncio.gather(*coroutines)
|
|
170
|
+
|
|
171
|
+
# Flatten the list of results
|
|
172
|
+
for pool_tasks in results:
|
|
154
173
|
tasks.extend(pool_tasks)
|
|
174
|
+
|
|
155
175
|
return tasks
|
|
156
176
|
|
|
157
177
|
def copy(self, old_name: str, new_name: str, pool: str = ""):
|
|
@@ -61,13 +61,25 @@ class TaskPoolManager(BaseManager):
|
|
|
61
61
|
if not os.path.exists(self.base_path):
|
|
62
62
|
self.log.warning("The pool directory does not exist.")
|
|
63
63
|
os.makedirs(self.base_path, exist_ok=True)
|
|
64
|
+
|
|
64
65
|
pool_dirs = await asyncio.to_thread(self.listdir, self.base_path)
|
|
65
66
|
tasks = []
|
|
67
|
+
coroutines = []
|
|
68
|
+
|
|
66
69
|
for pool_dir in pool_dirs:
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
+
coroutines.append(self.__get_n_tasks(pool_dir))
|
|
71
|
+
coroutines.append(
|
|
72
|
+
asyncio.to_thread(
|
|
73
|
+
is_version_controlled, os.path.join(self.base_path, pool_dir)
|
|
74
|
+
)
|
|
70
75
|
)
|
|
76
|
+
|
|
77
|
+
results = await asyncio.gather(*coroutines)
|
|
78
|
+
|
|
79
|
+
for i, pool_dir in enumerate(pool_dirs):
|
|
80
|
+
n_tasks = results[i * 2]
|
|
81
|
+
is_repo = results[i * 2 + 1]
|
|
82
|
+
|
|
71
83
|
tasks.append(
|
|
72
84
|
TaskPool(
|
|
73
85
|
name=pool_dir,
|
|
@@ -75,4 +87,5 @@ class TaskPoolManager(BaseManager):
|
|
|
75
87
|
is_repo=is_repo,
|
|
76
88
|
)
|
|
77
89
|
)
|
|
90
|
+
|
|
78
91
|
return tasks
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Metadata-Version: 2.3
|
|
2
2
|
Name: e2xauthoring
|
|
3
|
-
Version: 0.3.0.
|
|
3
|
+
Version: 0.3.0.dev1
|
|
4
4
|
Summary: Authoring app for e2xgrader
|
|
5
5
|
Project-URL: Source, https://github.com/Digiklausur/e2xauthoring
|
|
6
6
|
Project-URL: Documentation, https://e2xauthoring.readthedocs.io/en/latest/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
e2xauthoring/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
2
|
-
e2xauthoring/__version__.py,sha256=
|
|
2
|
+
e2xauthoring/__version__.py,sha256=tgUijMYyAGuaPfiCpkMqY-poIEf3SOv-hE8By80rRUs,27
|
|
3
3
|
e2xauthoring/app/__init__.py,sha256=dAcKvUKQEUD4RGfiabBdpmFe0wadDaVF5V1V4856cL4,64
|
|
4
4
|
e2xauthoring/app/authoring.py,sha256=5y5gDU2qdn02pEcgmUDpE-eAr3Yw9QdnwC_desqEEqA,1000
|
|
5
5
|
e2xauthoring/app/handlers/apihandlers.py,sha256=-bFgPK3W1-EEa5jc3-XP6M1qiKgyqIoR3AuzRNNI_44,3794
|
|
@@ -18,8 +18,8 @@ e2xauthoring/managers/__init__.py,sha256=eiaIwWVsM7vt_zALnPaBImK1nsrys9JUB2Bm97r
|
|
|
18
18
|
e2xauthoring/managers/assignmentmanager.py,sha256=rtnq89ZoiQESgSo9z0vv1v2g3kPOByqhHep3A5ZoxKw,1067
|
|
19
19
|
e2xauthoring/managers/base.py,sha256=V0S-Aqk-ZBlJo5Q33-cIGfr0ErW4EQIspTMvUYlb1pI,1654
|
|
20
20
|
e2xauthoring/managers/presetmanager.py,sha256=4xn3Ct_jxQt2FI2hbMlNnZoqTcGMEqUCGXxkgmsY_28,2714
|
|
21
|
-
e2xauthoring/managers/taskmanager.py,sha256=
|
|
22
|
-
e2xauthoring/managers/taskpoolmanager.py,sha256=
|
|
21
|
+
e2xauthoring/managers/taskmanager.py,sha256=QRc8JQm9f4OW7IKsRGJH5munRQTObUUwkiqBWcA2uEU,7068
|
|
22
|
+
e2xauthoring/managers/taskpoolmanager.py,sha256=Qpsg5aMPvBltkrf5sC2Ht-D8bsfIUA5GiQRtE6hZ0Go,3004
|
|
23
23
|
e2xauthoring/managers/templatemanager.py,sha256=0cW4PHt_BJ0Fsvvmg-iCuvYvEEfiVwcLCIFM60N082w,2692
|
|
24
24
|
e2xauthoring/managers/worksheetmanager.py,sha256=tAEZGH1C3KzGIF69TBzKjUtZX9MiFfkSYuDyhppqvJk,1687
|
|
25
25
|
e2xauthoring/managers/dataclasses/__init__.py,sha256=6TKalTEjmtK0ZSeQ1JUKLtaojKxdFsACpLOvcY3OEUA,751
|
|
@@ -46,7 +46,7 @@ e2xauthoring/preprocessors/removeexercise.py,sha256=ZVCy_92BjiSNfkWC0Z72dSUd1o7E
|
|
|
46
46
|
e2xauthoring/utils/__init__.py,sha256=ORm5Z51bACVUChgBBzJtjPF4elHUveoyFmE0cuctTK4,106
|
|
47
47
|
e2xauthoring/utils/gitutils.py,sha256=AJedjYwtlHBpbhgQfS-_fs_wgU4O0WqPAEfuwovP9g8,5941
|
|
48
48
|
e2xauthoring/utils/notebookvariableextractor.py,sha256=E9oxz6TA3rTq2Ye1uDj0QJe1sZsTZgANfEagwv1WKH0,397
|
|
49
|
-
e2xauthoring-0.3.0.
|
|
50
|
-
e2xauthoring-0.3.0.
|
|
51
|
-
e2xauthoring-0.3.0.
|
|
52
|
-
e2xauthoring-0.3.0.
|
|
49
|
+
e2xauthoring-0.3.0.dev1.dist-info/METADATA,sha256=-TpqmDl8K2oIGOUbqJ161OSGpnkTGZC2PWRvmX3slgk,2155
|
|
50
|
+
e2xauthoring-0.3.0.dev1.dist-info/WHEEL,sha256=1yFddiXMmvYK7QYTqtRNtX66WJ0Mz8PYEiEUoOUUxRY,87
|
|
51
|
+
e2xauthoring-0.3.0.dev1.dist-info/licenses/LICENSE,sha256=lbgSaWqrEqIf7B9gj3dpxM7PvrKgpEND3REakth-zGU,1068
|
|
52
|
+
e2xauthoring-0.3.0.dev1.dist-info/RECORD,,
|
|
File without changes
|
|
File without changes
|