This commit is contained in:
Ross
2025-10-21 21:56:33 +01:00
parent 90b48f6dc5
commit f8775d1f7e
462 changed files with 14382 additions and 566 deletions
+6 -4
View File
@@ -511,12 +511,13 @@ def find_title_in_capture_index(docid: str, base_dir: str) -> str | None:
return None
def process_file(path: str, out_dir: str, overwrite: bool = False) -> tuple[bool, str]:
def process_file(path: str, out_dir: str, overwrite: bool = False, verbose: bool = False) -> tuple[bool, str]:
"""Process one JSON file. Returns (success, output_path_or_error)."""
base = os.path.basename(path)
name, _ = os.path.splitext(base)
logger.debug(f"Processing file: {path}")
if verbose:
logger.debug(f"Processing file: {path}")
# attempt to extract article name for nicer filenames
try:
@@ -698,8 +699,9 @@ def process_file(path: str, out_dir: str, overwrite: bool = False) -> tuple[bool
# could be list or simple string
ddx_list = ddx_entry
else:
logger.debug(f"No cached DDX entry for docid {docid}")
logger.debug(f"DDX keys available: {list(DDX.keys())}")
if verbose:
logger.debug(f"No cached DDX entry for docid {docid}")
logger.debug(f"DDX keys available: {list(DDX.keys())}")
if ddx_list:
# render list representation