refactor(clew): shorten path finder name
This commit is contained in:
@@ -84,7 +84,7 @@ def extract_game_files(game_root: Path, output_path: Path) -> None:
|
|||||||
shutil.copy2(item, destination)
|
shutil.copy2(item, destination)
|
||||||
|
|
||||||
|
|
||||||
def matching_paths(root: Path, predicate) -> list[Path]:
|
def find(root: Path, predicate) -> list[Path]:
|
||||||
matches = []
|
matches = []
|
||||||
for current, _directories, files in os.walk(root):
|
for current, _directories, files in os.walk(root):
|
||||||
current_path = Path(current)
|
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:
|
def dump_renpy_objects(output_root: Path, extracted_root: Path, overwrite: bool) -> None:
|
||||||
game_roots = matching_paths(
|
game_roots = find(
|
||||||
extracted_root,
|
extracted_root,
|
||||||
lambda path: (
|
lambda path: (
|
||||||
(path / "game").is_dir()
|
(path / "game").is_dir()
|
||||||
@@ -135,7 +135,7 @@ def dump_renpy_objects(output_root: Path, extracted_root: Path, overwrite: bool)
|
|||||||
return
|
return
|
||||||
|
|
||||||
for game_root in game_roots:
|
for game_root in game_roots:
|
||||||
scripts = matching_paths(
|
scripts = find(
|
||||||
game_root / "game",
|
game_root / "game",
|
||||||
lambda path: path.is_file() and path.suffix.lower() in {".rpyc", ".rpymc"},
|
lambda path: path.is_file() and path.suffix.lower() in {".rpyc", ".rpymc"},
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in New Issue
Block a user