refactor(clew): type path finder predicate
This commit is contained in:
@@ -7,6 +7,7 @@ import shutil
|
|||||||
import subprocess
|
import subprocess
|
||||||
import sys
|
import sys
|
||||||
from collections import deque
|
from collections import deque
|
||||||
|
from collections.abc import Callable
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
|
||||||
from rpycdec.rpa import extract_rpa
|
from rpycdec.rpa import extract_rpa
|
||||||
@@ -84,7 +85,7 @@ def extract_game_files(game_root: Path, output_path: Path) -> None:
|
|||||||
shutil.copy2(item, destination)
|
shutil.copy2(item, destination)
|
||||||
|
|
||||||
|
|
||||||
def find(root: Path, predicate) -> list[Path]:
|
def find(root: Path, predicate: Callable[[Path], bool]) -> 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)
|
||||||
|
|||||||
Reference in New Issue
Block a user