peltak.core.fs
¶
- peltak.core.fs.filtered_walk(path, include=None, exclude=None)[source]¶
Walk recursively starting at path excluding files matching exclude
- Parameters
path (
str
) – A starting path. This has to be an existing directory.include (
Optional
[List
[str
]]) – A white list of glob patterns. If given, only files that match those globs will be yielded (filtered by exclude).exclude (
Optional
[List
[str
]]) – A list of glob string patterns to test against. If the file/path matches any of those patters, it will be filtered out.
- Return type
- Returns
A generator yielding all the files that do not match any pattern in
exclude
.
- peltak.core.fs.match_globs(path, patterns)[source]¶
Test whether the given path matches any patterns in patterns
- peltak.core.fs.search_globs(path, patterns)[source]¶
Test whether the given path contains any patterns in patterns