| 5 | |
| 6 | |
| 7 | class Prefix(NamedTuple): |
| 8 | prefix_dir: str |
| 9 | |
| 10 | def path(self, *parts: str) -> str: |
| 11 | return os.path.normpath(os.path.join(self.prefix_dir, *parts)) |
| 12 | |
| 13 | def exists(self, *parts: str) -> bool: |
| 14 | return os.path.exists(self.path(*parts)) |
| 15 | |
| 16 | def star(self, end: str) -> tuple[str, ...]: |
| 17 | paths = os.listdir(self.prefix_dir) |
| 18 | return tuple(path for path in paths if path.endswith(end)) |
no outgoing calls