Iterate over this subtree and yield all existing files (of any kind, including directories) matching the given relative pattern.
(self, pattern, *, recurse_symlinks=True)
| 325 | raise NotImplementedError |
| 326 | |
| 327 | def glob(self, pattern, *, recurse_symlinks=True): |
| 328 | """Iterate over this subtree and yield all existing files (of any |
| 329 | kind, including directories) matching the given relative pattern. |
| 330 | """ |
| 331 | anchor, parts = _explode_path(pattern, self.parser.split) |
| 332 | if anchor: |
| 333 | raise NotImplementedError("Non-relative patterns are unsupported") |
| 334 | elif not parts: |
| 335 | raise ValueError(f"Unacceptable pattern: {pattern!r}") |
| 336 | elif not recurse_symlinks: |
| 337 | raise NotImplementedError("recurse_symlinks=False is unsupported") |
| 338 | case_sensitive = self.parser.normcase('Aa') == 'Aa' |
| 339 | globber = _PathGlobber(self.parser.sep, case_sensitive, recursive=True) |
| 340 | select = globber.selector(parts) |
| 341 | return select(self.joinpath('')) |
| 342 | |
| 343 | def walk(self, top_down=True, on_error=None, follow_symlinks=False): |
| 344 | """Walk the directory tree from this directory, similar to os.walk().""" |
nothing calls this directly
no test coverage detected