mirror of
https://github.com/lllin000/PaperForge.git
synced 2026-07-22 06:50:53 +00:00
fix: add zotero_dir to paperforge_paths() for PDF resolution; fix L3 diagnostic to skip schema check without file upload
This commit is contained in:
parent
ee260e05f5
commit
2bfbec691e
3 changed files with 12 additions and 4 deletions
|
|
@ -258,6 +258,10 @@ def paperforge_paths(
|
|||
bases = vault / base_dir
|
||||
skill_path = vault / skill_dir
|
||||
|
||||
zotero_dir_val = os.environ.get("ZOTERO_DATA_DIR", "").strip()
|
||||
if not zotero_dir_val:
|
||||
zotero_dir_val = str(system / "Zotero")
|
||||
|
||||
# worker_script: paperforge worker package (pipeline/ removed in v1.3)
|
||||
worker_script = Path(__file__).parent / "worker" / "__init__.py"
|
||||
# ld_deep_script: look relative to skill_dir first, then repo paperforge/skills for dev
|
||||
|
|
@ -278,6 +282,7 @@ def paperforge_paths(
|
|||
"paperforge": paperforge,
|
||||
"exports": paperforge / "exports",
|
||||
"ocr": paperforge / "ocr",
|
||||
"zotero_dir": Path(zotero_dir_val),
|
||||
"resources": resources,
|
||||
"literature": literature,
|
||||
"control": control,
|
||||
|
|
|
|||
|
|
@ -111,12 +111,14 @@ def ocr_doctor(config: dict[str, str] | None, live: bool = False) -> dict:
|
|||
)
|
||||
except Exception:
|
||||
pass # ignore cancel failure
|
||||
except requests.RequestException as e:
|
||||
except requests.RequestException:
|
||||
# Without a real file upload the API will reject the request (4xx/5xx).
|
||||
# This is expected — L2 already confirmed connectivity + token validity.
|
||||
# Run `--live` for a full upload round-trip test.
|
||||
return {
|
||||
"level": 3,
|
||||
"passed": False,
|
||||
"error": f"API submission test failed: {e}",
|
||||
"fix": "Check PADDLEOCR configuration and network. Run `paperforge ocr --diagnose` again after fixes.",
|
||||
"passed": True,
|
||||
"message": "Skipped (requires file upload). Use `paperforge ocr --diagnose --live` for full validation.",
|
||||
}
|
||||
except (json.JSONDecodeError, KeyError) as e:
|
||||
return {
|
||||
|
|
|
|||
|
|
@ -310,6 +310,7 @@ def test_paperforge_paths_returns_exact_keys(tmp_path: Path):
|
|||
"paperforge",
|
||||
"exports",
|
||||
"ocr",
|
||||
"zotero_dir",
|
||||
"resources",
|
||||
"literature",
|
||||
"control",
|
||||
|
|
|
|||
Loading…
Reference in a new issue