MCPcopy Create free account
hub / github.com/comaps/comaps / find_executable

Function find_executable

tools/python/maps_generator/utils/file.py:50–60  ·  view source on GitHub ↗
(path: AnyStr, exe: Optional[AnyStr] = None)

Source from the content-addressed store, hash-verified

48
49@functools.lru_cache()
50def find_executable(path: AnyStr, exe: Optional[AnyStr] = None) -> AnyStr:
51 if exe is None:
52 if is_executable(path):
53 return path
54 else:
55 raise FileNotFoundError(path)
56 find_pattern = f"{path}/**/{exe}"
57 for name in glob.iglob(find_pattern, recursive=True):
58 if is_executable(name):
59 return name
60 raise FileNotFoundError(f"{exe} not found in {path}")
61
62
63def download_file(url: AnyStr, name: AnyStr, download_if_exists: bool = True):

Callers 4

setup_generator_toolMethod · 0.90
setup_mwm_diff_toolMethod · 0.90
cmake_pybindingsMethod · 0.85

Calls 1

is_executableFunction · 0.85

Tested by

no test coverage detected