pearmut 0.2.7__tar.gz → 0.2.8__tar.gz
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.
- {pearmut-0.2.7 → pearmut-0.2.8}/PKG-INFO +1 -1
- {pearmut-0.2.7 → pearmut-0.2.8}/pearmut.egg-info/PKG-INFO +1 -1
- {pearmut-0.2.7 → pearmut-0.2.8}/pyproject.toml +1 -1
- {pearmut-0.2.7 → pearmut-0.2.8}/server/cli.py +19 -23
- {pearmut-0.2.7 → pearmut-0.2.8}/LICENSE +0 -0
- {pearmut-0.2.7 → pearmut-0.2.8}/README.md +0 -0
- {pearmut-0.2.7 → pearmut-0.2.8}/pearmut.egg-info/SOURCES.txt +0 -0
- {pearmut-0.2.7 → pearmut-0.2.8}/pearmut.egg-info/dependency_links.txt +0 -0
- {pearmut-0.2.7 → pearmut-0.2.8}/pearmut.egg-info/entry_points.txt +0 -0
- {pearmut-0.2.7 → pearmut-0.2.8}/pearmut.egg-info/requires.txt +0 -0
- {pearmut-0.2.7 → pearmut-0.2.8}/pearmut.egg-info/top_level.txt +0 -0
- {pearmut-0.2.7 → pearmut-0.2.8}/server/app.py +0 -0
- {pearmut-0.2.7 → pearmut-0.2.8}/server/assignment.py +0 -0
- {pearmut-0.2.7 → pearmut-0.2.8}/server/static/assets/favicon.svg +0 -0
- {pearmut-0.2.7 → pearmut-0.2.8}/server/static/assets/style.css +0 -0
- {pearmut-0.2.7 → pearmut-0.2.8}/server/static/dashboard.bundle.js +0 -0
- {pearmut-0.2.7 → pearmut-0.2.8}/server/static/dashboard.html +0 -0
- {pearmut-0.2.7 → pearmut-0.2.8}/server/static/index.html +0 -0
- {pearmut-0.2.7 → pearmut-0.2.8}/server/static/listwise.bundle.js +0 -0
- {pearmut-0.2.7 → pearmut-0.2.8}/server/static/listwise.html +0 -0
- {pearmut-0.2.7 → pearmut-0.2.8}/server/static/pointwise.bundle.js +0 -0
- {pearmut-0.2.7 → pearmut-0.2.8}/server/static/pointwise.html +0 -0
- {pearmut-0.2.7 → pearmut-0.2.8}/server/utils.py +0 -0
- {pearmut-0.2.7 → pearmut-0.2.8}/setup.cfg +0 -0
|
@@ -278,26 +278,24 @@ def _add_single_campaign(data_file, overwrite, server):
|
|
|
278
278
|
)
|
|
279
279
|
|
|
280
280
|
# Symlink path is based on the destination, stripping the 'assets/' prefix
|
|
281
|
-
symlink_path = f"{STATIC_DIR}/{assets_destination}"
|
|
281
|
+
symlink_path = f"{STATIC_DIR}/{assets_destination}".rstrip("/")
|
|
282
282
|
|
|
283
283
|
# Remove existing symlink if present and we are overriding the same campaign
|
|
284
284
|
if os.path.lexists(symlink_path):
|
|
285
285
|
# Check if any other campaign is using this destination
|
|
286
286
|
current_campaign_id = campaign_data['campaign_id']
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
f"Assets destination '{assets_destination}' is already used by campaign '{other_campaign_id}'."
|
|
300
|
-
)
|
|
287
|
+
|
|
288
|
+
for other_campaign_id in progress_data.keys():
|
|
289
|
+
if other_campaign_id == current_campaign_id:
|
|
290
|
+
continue
|
|
291
|
+
with open(f"{ROOT}/data/tasks/{other_campaign_id}.json", "r") as f:
|
|
292
|
+
other_campaign = json.load(f)
|
|
293
|
+
other_assets = other_campaign.get("info", {}).get("assets")
|
|
294
|
+
if other_assets:
|
|
295
|
+
if other_assets.get("destination") == assets_destination:
|
|
296
|
+
raise ValueError(
|
|
297
|
+
f"Assets destination '{assets_destination}' is already used by campaign '{other_campaign_id}'."
|
|
298
|
+
)
|
|
301
299
|
# Only allow overwrite if it's the same campaign
|
|
302
300
|
if overwrite:
|
|
303
301
|
os.remove(symlink_path)
|
|
@@ -305,7 +303,8 @@ def _add_single_campaign(data_file, overwrite, server):
|
|
|
305
303
|
raise ValueError(f"Assets destination '{assets_destination}' is already taken.")
|
|
306
304
|
|
|
307
305
|
# Ensure the assets directory exists
|
|
308
|
-
|
|
306
|
+
# get parent of symlink_path dir
|
|
307
|
+
os.makedirs(os.path.dirname(symlink_path), exist_ok=True)
|
|
309
308
|
|
|
310
309
|
os.symlink(assets_real_path, symlink_path, target_is_directory=True)
|
|
311
310
|
print(f"Assets symlinked: {symlink_path} -> {assets_real_path}")
|
|
@@ -391,7 +390,7 @@ def main():
|
|
|
391
390
|
campaign_data = json.load(f)
|
|
392
391
|
destination = campaign_data.get("info", {}).get("assets", {}).get("destination")
|
|
393
392
|
if destination:
|
|
394
|
-
symlink_path = f"{STATIC_DIR}/{destination}"
|
|
393
|
+
symlink_path = f"{STATIC_DIR}/{destination}".rstrip("/")
|
|
395
394
|
if os.path.islink(symlink_path):
|
|
396
395
|
os.remove(symlink_path)
|
|
397
396
|
print(f"Assets symlink removed: {symlink_path}")
|
|
@@ -436,12 +435,9 @@ def main():
|
|
|
436
435
|
)
|
|
437
436
|
if confirm.lower() == 'y':
|
|
438
437
|
# Unlink all assets first
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
if task_file.endswith('.json'):
|
|
443
|
-
campaign_id = task_file[:-5]
|
|
444
|
-
_unlink_assets(campaign_id)
|
|
438
|
+
progress_data = load_progress_data()
|
|
439
|
+
for campaign_id in progress_data.keys():
|
|
440
|
+
_unlink_assets(campaign_id)
|
|
445
441
|
shutil.rmtree(f"{ROOT}/data/tasks", ignore_errors=True)
|
|
446
442
|
shutil.rmtree(f"{ROOT}/data/outputs", ignore_errors=True)
|
|
447
443
|
if os.path.exists(f"{ROOT}/data/progress.json"):
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|