refactor(clew): clarify AST extraction function names
This commit is contained in:
@@ -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")
|
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()
|
exporter = Path(dump_ast_script.__file__).resolve()
|
||||||
bundled_python = game_root / "lib" / "linux-x86_64" / "python"
|
bundled_python = game_root / "lib" / "linux-x86_64" / "python"
|
||||||
output.parent.mkdir(parents=True, exist_ok=True)
|
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)
|
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(
|
game_roots = find(
|
||||||
extracted_root,
|
extracted_root,
|
||||||
lambda path: (
|
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)
|
LOG.info("skipping existing AST dump %d/%d: %s", index, total, output)
|
||||||
continue
|
continue
|
||||||
LOG.info("dumping AST %d/%d: %s", index, total, script)
|
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:
|
def run(args: argparse.Namespace) -> None:
|
||||||
@@ -163,7 +163,7 @@ def run(args: argparse.Namespace) -> None:
|
|||||||
extract_game_files(game_root, extracted)
|
extract_game_files(game_root, extracted)
|
||||||
|
|
||||||
if not args.no_ast_dump:
|
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__":
|
if __name__ == "__main__":
|
||||||
|
|||||||
Reference in New Issue
Block a user