coldrun: jetzt auch mit validierung
This commit is contained in:
1 parent
7a6d35d8a1
commit
a4a678d11e
1 file changed
+13
+13
@@ -22,6 +22,7 @@ from src.config import (
|
|||||||
get_available_templates,
|
get_available_templates,
|
||||||
)
|
)
|
||||||
from src.parser import parse_input_file, group_by_employee, get_unique_employees
|
from src.parser import parse_input_file, group_by_employee, get_unique_employees
|
||||||
|
from src.validator import validate_template
|
||||||
from src.writer import generate_activity_reports
|
from src.writer import generate_activity_reports
|
||||||
|
|
||||||
|
|
||||||
@@ -57,6 +58,18 @@ def main():
|
|||||||
template_path = Path(config.template_dir) / template_file
|
template_path = Path(config.template_dir) / template_file
|
||||||
print(f"[INFO] Template: {template_file}")
|
print(f"[INFO] Template: {template_file}")
|
||||||
|
|
||||||
|
# ── Template validieren ───────────────────────────────────────────
|
||||||
|
print()
|
||||||
|
print("[INFO] Validiere PDF-Template…")
|
||||||
|
tpl_result = validate_template(template_path, config.output_mapping)
|
||||||
|
if not tpl_result.is_valid:
|
||||||
|
for err in tpl_result.errors:
|
||||||
|
print(f"[FEHLER] {err}")
|
||||||
|
return 1
|
||||||
|
found = tpl_result.info.get("found_fields", "?")
|
||||||
|
total = tpl_result.info.get("total_fields", "?")
|
||||||
|
print(f"[OK] {found}/{total} Platzhalter im Template gefunden.")
|
||||||
|
|
||||||
# ── Input parsen ──────────────────────────────────────────────────
|
# ── Input parsen ──────────────────────────────────────────────────
|
||||||
print()
|
print()
|
||||||
print("[INFO] Parse Input-Datei…")
|
print("[INFO] Parse Input-Datei…")
|
||||||
|
|||||||
Reference in new issue
Block a user