qwikstart.utils.filesystem module¶
-
class
qwikstart.utils.filesystem.
FileTreeGenerator
(source_dir: pathlib.Path, target_dir: pathlib.Path, renderer: qwikstart.utils.templates.TemplateRenderer, ignore_patterns: Optional[List[str]] = None)¶ Bases:
object
-
copy
() → None¶
-
-
qwikstart.utils.filesystem.
fnmatches_to_regex
(patterns: Optional[Iterable[str]], case_insensitive: bool = False, flags: int = 0) → Pattern[str]¶ Return a compiled regex Convert fnmatch patterns to that matches any of them.
Slashes are always converted to match either slash or backslash, for Windows support, even when running elsewhere.
- Parameters
partial – If True, then the pattern will match if the target string starts with the pattern. Otherwise, it must match the entire string.
Adapted from coveragepy’s
fnmatches_to_regex
. See https://github.com/nedbat/coveragepy/blob/master/coverage/files.py
-
qwikstart.utils.filesystem.
join_regex
(regexes: Iterable[str]) → str¶ Combine a list of regexes into one that matches any of them.