fix(clew): avoid truncating object dumps by default
This commit is contained in:
@@ -130,7 +130,6 @@ def run_renpy_object_dump(game_root: Path, script: Path, output: Path) -> None:
|
|||||||
"--output",
|
"--output",
|
||||||
str(output),
|
str(output),
|
||||||
]
|
]
|
||||||
LOG.info("dumping Ren'Py object graph: %s", script)
|
|
||||||
subprocess.run(command, check=True)
|
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:
|
for game_root in game_roots:
|
||||||
scripts = find_compiled_scripts(game_root)
|
scripts = find_compiled_scripts(game_root)
|
||||||
LOG.info("found %d compiled Ren'Py scripts under %s", len(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)
|
output = object_dump_output_path(output_root, extracted_root, game_root, script)
|
||||||
if output.exists() and not overwrite:
|
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
|
continue
|
||||||
|
LOG.info("dumping Ren'Py object graph %d/%d: %s", index, total, script)
|
||||||
run_renpy_object_dump(game_root, script, output)
|
run_renpy_object_dump(game_root, script, output)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -35,7 +35,7 @@ def parse_args(argv):
|
|||||||
parser.add_argument("--game-root", required=True)
|
parser.add_argument("--game-root", required=True)
|
||||||
parser.add_argument("--input", required=True)
|
parser.add_argument("--input", required=True)
|
||||||
parser.add_argument("--output", 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)
|
return parser.parse_args(argv)
|
||||||
|
|
||||||
|
|
||||||
@@ -121,7 +121,7 @@ class Dumper(object):
|
|||||||
if is_primitive(value):
|
if is_primitive(value):
|
||||||
return safe_text(value)
|
return safe_text(value)
|
||||||
|
|
||||||
if depth >= self.max_depth:
|
if self.max_depth is not None and depth >= self.max_depth:
|
||||||
return {
|
return {
|
||||||
"type": "truncated",
|
"type": "truncated",
|
||||||
"class": class_name(value),
|
"class": class_name(value),
|
||||||
|
|||||||
Reference in New Issue
Block a user