Initial commit
This commit is contained in:
Executable
+36
@@ -0,0 +1,36 @@
|
||||
#!/usr/bin/env python3
|
||||
"""config.py の設定値を表示する互換ユーティリティ。"""
|
||||
|
||||
from __future__ import annotations
|
||||
|
||||
import argparse
|
||||
import json
|
||||
|
||||
from common import CONFIG
|
||||
|
||||
|
||||
def main() -> int:
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("--json", action="store_true")
|
||||
args = parser.parse_args()
|
||||
data = {
|
||||
"PDF_ROOT": str(CONFIG.path.pdf_root),
|
||||
"SCAN_DIRECTORIES": list(
|
||||
CONFIG.processing.scan_directories
|
||||
),
|
||||
"REMOTE": CONFIG.remote.host,
|
||||
"REMOTE_DB": CONFIG.remote.database_dir,
|
||||
"REMOTE_PDF": CONFIG.remote.pdf_dir,
|
||||
"MAX_PAPERS": CONFIG.processing.max_papers,
|
||||
"AI_BACKEND": CONFIG.ai.backend,
|
||||
}
|
||||
if args.json:
|
||||
print(json.dumps(data, ensure_ascii=False, indent=2))
|
||||
else:
|
||||
for key, value in data.items():
|
||||
print(f"{key}={value}")
|
||||
return 0
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
raise SystemExit(main())
|
||||
Reference in New Issue
Block a user