refactor(clew): shorten path finder name

This commit is contained in:
2026-09-07 18:17:29 -04:00
parent 8e5ae23fd2
commit cac4fac77f

View File

@@ -84,7 +84,7 @@ def extract_game_files(game_root: Path, output_path: Path) -> None:
shutil.copy2(item, destination)
def matching_paths(root: Path, predicate) -> list[Path]:
def find(root: Path, predicate) -> list[Path]:
matches = []
for current, _directories, files in os.walk(root):
current_path = Path(current)
@@ -122,7 +122,7 @@ def run_renpy_object_dump(game_root: Path, script: Path, output: Path) -> None:
def dump_renpy_objects(output_root: Path, extracted_root: Path, overwrite: bool) -> None:
game_roots = matching_paths(
game_roots = find(
extracted_root,
lambda path: (
(path / "game").is_dir()
@@ -135,7 +135,7 @@ def dump_renpy_objects(output_root: Path, extracted_root: Path, overwrite: bool)
return
for game_root in game_roots:
scripts = matching_paths(
scripts = find(
game_root / "game",
lambda path: path.is_file() and path.suffix.lower() in {".rpyc", ".rpymc"},
)