Deal better with additional label errors.
parent
bd35e69534
commit
f9d43e3ad9
|
|
@ -511,11 +511,13 @@ Here is a list of all possible labels. You need to answer with a list one of the
|
||||||
|
|
||||||
tprint(f"\tHandling additional-answer for {pid} {label}")
|
tprint(f"\tHandling additional-answer for {pid} {label}")
|
||||||
keep_error = False
|
keep_error = False
|
||||||
|
error = "al:"
|
||||||
for add_label in add_labels:
|
for add_label in add_labels:
|
||||||
if add_label == label:
|
if add_label == label:
|
||||||
continue
|
continue
|
||||||
if add_label not in all_labels:
|
if add_label not in all_labels:
|
||||||
tprint(f"\t\t Inexistent label from additional-answer processing {pid} {label}. Ignoring")
|
tprint(f"\t\t Inexistent label ({add_label}) from additional-answer processing {pid} {label}. Ignoring")
|
||||||
|
error += f"{add_label}??"
|
||||||
keep_error = True
|
keep_error = True
|
||||||
continue
|
continue
|
||||||
new_pdf_path = Path(INPUT_DIR) / f"Copie{pid}" / f"{add_label}.pdf"
|
new_pdf_path = Path(INPUT_DIR) / f"Copie{pid}" / f"{add_label}.pdf"
|
||||||
|
|
@ -530,11 +532,13 @@ Here is a list of all possible labels. You need to answer with a list one of the
|
||||||
add_label, False))
|
add_label, False))
|
||||||
else:
|
else:
|
||||||
keep_error = True
|
keep_error = True
|
||||||
|
error += f"{add_label}"
|
||||||
tprint(f"\t\tAlready present (not copied) Copie{pid} : {label} -> {add_label}")
|
tprint(f"\t\tAlready present (not copied) Copie{pid} : {label} -> {add_label}")
|
||||||
|
|
||||||
|
|
||||||
if not keep_error:
|
if not keep_error:
|
||||||
res["error"] = ""
|
res["error"] = ""
|
||||||
|
else:
|
||||||
|
res["error"] = error
|
||||||
|
|
||||||
return new_tasks
|
return new_tasks
|
||||||
|
|
||||||
|
|
@ -585,6 +589,9 @@ def process_single_task(task_tuple):
|
||||||
yming, ymaxg, width_r = d_data[pid]
|
yming, ymaxg, width_r = d_data[pid]
|
||||||
|
|
||||||
pdf_path = Path(INPUT_DIR) / f"Copie{pid}" / f"{label}.pdf"
|
pdf_path = Path(INPUT_DIR) / f"Copie{pid}" / f"{label}.pdf"
|
||||||
|
if !can_spawn_tasks and res["error"] == "additional-answer":
|
||||||
|
tprint("\tSwallowing an additional-answer from a subsequent task.")
|
||||||
|
res["error"]= ""
|
||||||
if res["error"] != "":
|
if res["error"] != "":
|
||||||
tprint("\tError :", res["error"], "for Copie", pid, group_name)
|
tprint("\tError :", res["error"], "for Copie", pid, group_name)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue