fix: Preflight-Check und Exit-Code in --once Modus (v0.2.1)
- #1: check_preflight() prüft beim Start tesseract + gs, wirft PreflightError. CLI endet mit Exit 2 statt grün zu bleiben. - #2: run_once() gibt Anzahl fehlgeschlagener PDFs zurück, CLI endet mit Exit 1 wenn mindestens eine Datei scheiterte. - pytest-Suite mit 11 Tests für beide Szenarien - ocrmypdf-Import lazy in processor.py (Tests ohne ocrmypdf möglich) Closes #1, #2 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,5 +1,17 @@
|
||||
# Changelog
|
||||
|
||||
## [0.2.1] - 2026-04-09
|
||||
|
||||
### Fixed
|
||||
- **Issue #1**: Preflight-Check beim Start prüft jetzt `tesseract` und `gs` (Ghostscript). Fehlt eine Abhängigkeit, beendet sich der Service sofort mit Exit-Code 2 und klarer Fehlermeldung statt erst bei der ersten Datei.
|
||||
- **Issue #2**: `--once`-Modus liefert jetzt Exit-Code `1`, sobald **mindestens ein** PDF fehlgeschlagen ist. Exit-Code `0` nur bei vollständigem Erfolg (inkl. "keine Dateien vorhanden"). Exit-Code `2` bei Preflight-Fehler.
|
||||
|
||||
### Added
|
||||
- Public API: `HotfolderService.run_once()`, `.success_count`, `.error_count`, `.ensure_dirs()`
|
||||
- `check_preflight()` / `PreflightError` in `pdf_ocr_hotfolder.service`
|
||||
- pytest-Test-Suite (`tests/`) mit 11 Tests — deckt alle Szenarien aus Issue #1 und #2 ab
|
||||
- `ocrmypdf`-Import in `processor.py` ist jetzt lazy (Tests ohne ocrmypdf-Installation möglich)
|
||||
|
||||
## [0.2.0] - 2026-04-08
|
||||
|
||||
### Added
|
||||
|
||||
Reference in New Issue
Block a user