refactor(clew): clarify AST extraction function names

This commit is contained in:
2026-09-07 18:25:32 -04:00
parent a97293948f
commit 779b1a0fd0

View File

@@ -104,7 +104,7 @@ def ast_dump_output_path(output_root: Path, extracted_root: Path, game_root: Pat
return output_root / "ast-raw" / namespace / relative_script.with_suffix(relative_script.suffix + ".json")
def run_ast_dump(game_root: Path, script: Path, output: Path) -> None:
def run_extract_renpy_ast(game_root: Path, script: Path, output: Path) -> None:
exporter = Path(dump_ast_script.__file__).resolve()
bundled_python = game_root / "lib" / "linux-x86_64" / "python"
output.parent.mkdir(parents=True, exist_ok=True)
@@ -122,7 +122,7 @@ def run_ast_dump(game_root: Path, script: Path, output: Path) -> None:
subprocess.run(command, check=True)
def orchestrate_ast_dump(output_root: Path, extracted_root: Path, overwrite: bool) -> None:
def extract_game_ast(output_root: Path, extracted_root: Path, overwrite: bool) -> None:
game_roots = find(
extracted_root,
lambda path: (
@@ -148,7 +148,7 @@ def orchestrate_ast_dump(output_root: Path, extracted_root: Path, overwrite: boo
LOG.info("skipping existing AST dump %d/%d: %s", index, total, output)
continue
LOG.info("dumping AST %d/%d: %s", index, total, script)
run_ast_dump(game_root, script, output)
run_extract_renpy_ast(game_root, script, output)
def run(args: argparse.Namespace) -> None:
@@ -163,7 +163,7 @@ def run(args: argparse.Namespace) -> None:
extract_game_files(game_root, extracted)
if not args.no_ast_dump:
orchestrate_ast_dump(output_root, extracted, args.overwrite)
extract_game_ast(output_root, extracted, args.overwrite)
if __name__ == "__main__":