Return a list of paths matching a pathname pattern. The pattern may contain simple shell-style wildcards a la fnmatch. Unlike fnmatch, filenames starting with a dot are special cases that are not matched by '*' and '?' patterns by default. The order of the returned list is unde
(pathname, *, root_dir=None, dir_fd=None, recursive=False,
include_hidden=False)
| 14 | __all__ = ["glob", "iglob", "escape", "translate"] |
| 15 | |
| 16 | def glob(pathname, *, root_dir=None, dir_fd=None, recursive=False, |
| 17 | include_hidden=False): |
| 18 | """Return a list of paths matching a pathname pattern. |
| 19 | |
| 20 | The pattern may contain simple shell-style wildcards a la |
| 21 | fnmatch. Unlike fnmatch, filenames starting with a |
| 22 | dot are special cases that are not matched by '*' and '?' |
| 23 | patterns by default. |
| 24 | |
| 25 | The order of the returned list is undefined. Sort it if you need a |
| 26 | particular order. |
| 27 | |
| 28 | If `include_hidden` is true, the patterns '*', '?', '**' will match hidden |
| 29 | directories. |
| 30 | |
| 31 | If `recursive` is true, the pattern '**' will match any files and |
| 32 | zero or more directories and subdirectories. |
| 33 | """ |
| 34 | return list(iglob(pathname, root_dir=root_dir, dir_fd=dir_fd, recursive=recursive, |
| 35 | include_hidden=include_hidden)) |
| 36 | |
| 37 | def iglob(pathname, *, root_dir=None, dir_fd=None, recursive=False, |
| 38 | include_hidden=False): |
no test coverage detected