refactor(clew): model object dumper as Python library
This commit is contained in:
@@ -1,9 +1,16 @@
|
||||
load("@rules_python//python:defs.bzl", "py_binary")
|
||||
load("@rules_python//python:defs.bzl", "py_binary", "py_library")
|
||||
|
||||
py_library(
|
||||
name = "renpy_object_dump",
|
||||
srcs = ["renpy_object_dump.py"],
|
||||
)
|
||||
|
||||
py_binary(
|
||||
name = "clew",
|
||||
srcs = ["clew.py"],
|
||||
data = ["renpy_object_dump.py"],
|
||||
main = "clew.py",
|
||||
deps = ["//third_party/python:rpycdec"],
|
||||
deps = [
|
||||
":renpy_object_dump",
|
||||
"//third_party/python:rpycdec",
|
||||
],
|
||||
)
|
||||
|
||||
@@ -10,6 +10,7 @@ from collections import deque
|
||||
from pathlib import Path
|
||||
|
||||
from rpycdec.rpa import extract_rpa
|
||||
from src.clew import renpy_object_dump
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
@@ -116,7 +117,7 @@ def object_dump_output_path(output_root: Path, extracted_root: Path, game_root:
|
||||
|
||||
|
||||
def run_renpy_object_dump(game_root: Path, script: Path, output: Path) -> None:
|
||||
exporter = Path(__file__).with_name("renpy_object_dump.py").resolve()
|
||||
exporter = Path(renpy_object_dump.__file__).resolve()
|
||||
bundled_python = game_root / "lib" / "linux-x86_64" / "python"
|
||||
output.parent.mkdir(parents=True, exist_ok=True)
|
||||
command = [
|
||||
|
||||
Reference in New Issue
Block a user