Miscs
This commit is contained in:
+7
-3
@@ -465,20 +465,22 @@ Here is a list of all possible lables. You need to answer with one of these :
|
||||
res["error"] = "wrg-lbl:cldtfix"
|
||||
return []
|
||||
if new_label == label:
|
||||
res["error"] =""
|
||||
res["error"] = ""
|
||||
return []
|
||||
new_pdf_path = Path(INPUT_DIR) / f"Copie{pid}" / f"{new_label}.pdf"
|
||||
if new_pdf_path.exists():
|
||||
tprint(f"\t\tCopie{pid} tried to move wrong {label} to {new_label}, but it already exists.")
|
||||
res["error"] = f"wrg-lbl:{new_label}?exists"
|
||||
else:
|
||||
res["error"] = f"wrg-lbl-moved-to:{new_label}"
|
||||
tprint(f"\t\tCopie{pid} : moving wrong {label} to {new_label}.")
|
||||
shutil.move(str(pdf_path), str(new_pdf_path))
|
||||
# Since we moved the file, this Copie/label should not be taken
|
||||
# into account in the future, I think
|
||||
idx = get_next_group_idx(INPUT_DIR, new_label)
|
||||
height = grouping.get_pdf_height(str(new_pdf_path))
|
||||
grouping.create_jpg(new_label, idx, [(pid, str(new_pdf_path), height)], INPUT_DIR)
|
||||
grouping.create_jpg(new_label, idx, [(pid, str(new_pdf_path), height)],
|
||||
INPUT_DIR)
|
||||
tprint(f"\t\tMaking {new_label} group {idx+1}")
|
||||
new_tasks.append((str(Path(INPUT_DIR) / new_label / f"Group_{idx+1}.jpg"),
|
||||
new_label, False))
|
||||
@@ -532,9 +534,11 @@ Here is a list of all possible labels. You need to answer with a list one of the
|
||||
grouping.create_jpg(add_label, idx, [(pid, str(new_pdf_path), height)], INPUT_DIR)
|
||||
new_tasks.append((str(Path(INPUT_DIR) / add_label / f"Group_{idx+1}.jpg"),
|
||||
add_label, False))
|
||||
error += f"(->){add_label}"
|
||||
keep_error = True
|
||||
else:
|
||||
keep_error = True
|
||||
error += f"{add_label}"
|
||||
error += f"(xx){add_label}"
|
||||
tprint(f"\t\tAlready present (not copied) Copie{pid} : {label} -> {add_label}")
|
||||
|
||||
if not keep_error:
|
||||
|
||||
Reference in New Issue
Block a user