fix(clew): avoid truncating object dumps by default

This commit is contained in:
2026-09-07 17:57:51 -04:00
parent ec98993377
commit e209c2ab6f
2 changed files with 6 additions and 5 deletions

View File

@@ -130,7 +130,6 @@ def run_renpy_object_dump(game_root: Path, script: Path, output: Path) -> None:
"--output",
str(output),
]
LOG.info("dumping Ren'Py object graph: %s", script)
subprocess.run(command, check=True)
@@ -148,11 +147,13 @@ def dump_renpy_objects(output_root: Path, overwrite: bool) -> None:
for game_root in game_roots:
scripts = find_compiled_scripts(game_root)
LOG.info("found %d compiled Ren'Py scripts under %s", len(scripts), game_root)
for script in scripts:
total = len(scripts)
for index, script in enumerate(scripts, start=1):
output = object_dump_output_path(output_root, extracted_root, game_root, script)
if output.exists() and not overwrite:
LOG.info("skipping existing Ren'Py object dump: %s", output)
LOG.info("skipping existing Ren'Py object dump %d/%d: %s", index, total, output)
continue
LOG.info("dumping Ren'Py object graph %d/%d: %s", index, total, script)
run_renpy_object_dump(game_root, script, output)

View File

@@ -35,7 +35,7 @@ def parse_args(argv):
parser.add_argument("--game-root", required=True)
parser.add_argument("--input", required=True)
parser.add_argument("--output", required=True)
parser.add_argument("--max-depth", default=24, type=int)
parser.add_argument("--max-depth", type=int)
return parser.parse_args(argv)
@@ -121,7 +121,7 @@ class Dumper(object):
if is_primitive(value):
return safe_text(value)
if depth >= self.max_depth:
if self.max_depth is not None and depth >= self.max_depth:
return {
"type": "truncated",
"class": class_name(value),