Find which elements of a lib_path have the directory a module needs to exist.
(self, id: str, lib_path: tuple[str, ...])
| 260 | return None |
| 261 | |
| 262 | def find_lib_path_dirs(self, id: str, lib_path: tuple[str, ...]) -> PackageDirs: |
| 263 | """Find which elements of a lib_path have the directory a module needs to exist.""" |
| 264 | components = id.split(".") |
| 265 | dir_chain = os.sep.join(components[:-1]) # e.g., 'foo/bar' |
| 266 | |
| 267 | dirs = [] |
| 268 | for pathitem in self.get_toplevel_possibilities(lib_path, components[0]): |
| 269 | # e.g., '/usr/lib/python3.4/foo/bar' |
| 270 | if dir_chain: |
| 271 | dir = os_path_join(pathitem, dir_chain) |
| 272 | else: |
| 273 | dir = pathitem |
| 274 | if self.fscache.isdir(dir): |
| 275 | dirs.append((dir, True)) |
| 276 | return dirs |
| 277 | |
| 278 | def get_toplevel_possibilities(self, lib_path: tuple[str, ...], id: str) -> list[str]: |
| 279 | """Find which elements of lib_path could contain a particular top-level module. |
no test coverage detected