MCPcopy Create free account
hub / github.com/917Dhj/DeepPaperNote / main

Function main

scripts/check_environment.py:68–124  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

66
67
68def main() -> None:
69 args = parser().parse_args()
70 config = runtime_config()
71
72 obsidian_vault = str(config.get("obsidian_vault", "")).strip()
73 obsidian_vault_exists = bool(obsidian_vault) and Path(obsidian_vault).expanduser().exists()
74
75 tesseract_path = shutil.which("tesseract") or ""
76 pdftoppm_path = shutil.which("pdftoppm") or ""
77
78 payload = {
79 "status": "ok",
80 "script": "check_environment.py",
81 "tool_role": "maintenance",
82 "python": {
83 "executable": sys.executable,
84 "version": sys.version.split()[0],
85 "fitz_installed": import_available("fitz"),
86 "pytesseract_installed": import_available("pytesseract"),
87 "pillow_installed": import_available("PIL"),
88 },
89 "obsidian": {
90 "configured": bool(obsidian_vault),
91 "vault_path": obsidian_vault,
92 "vault_exists": obsidian_vault_exists,
93 "papers_dir": str(config.get("papers_dir", "")),
94 "output_dir": str(config.get("output_dir", "")),
95 "candidate_vaults": find_obsidian_candidates(),
96 },
97 "workspace_fallback": {
98 "available": True,
99 "current_working_directory": str(Path.cwd().resolve()),
100 "workspace_output_dir": str(config.get("workspace_output_dir", "DeepPaperNote_output")),
101 "note": "If no Obsidian vault is configured, DeepPaperNote can still save notes under the current working directory.",
102 },
103 "zotero": {
104 "local_hints": find_local_zotero_hints(),
105 "mcp_available_from_script": False,
106 "session_integration_checked_by_script": False,
107 "note": "Session-scoped library integrations must be checked by the active agent at runtime, not by this script.",
108 },
109 "ocr": {
110 "tesseract_installed": bool(tesseract_path),
111 "tesseract_path": tesseract_path,
112 "pytesseract_installed": import_available("pytesseract"),
113 "pillow_installed": import_available("PIL"),
114 "pdftoppm_installed": bool(pdftoppm_path),
115 "pdftoppm_path": pdftoppm_path,
116 },
117 "metadata": {
118 "maintenance_utility": True,
119 "semantic_scholar_api_key_configured": bool(
120 env_config_value("DEEPPAPERNOTE_SEMANTIC_SCHOLAR_API_KEY", "SEMANTIC_SCHOLAR_API_KEY")
121 )
122 },
123 }
124 emit(payload, args.output)
125

Callers 1

Calls 7

runtime_configFunction · 0.90
env_config_valueFunction · 0.90
emitFunction · 0.90
import_availableFunction · 0.85
find_obsidian_candidatesFunction · 0.85
find_local_zotero_hintsFunction · 0.85
parserFunction · 0.70

Tested by

no test coverage detected