module documentation

Pattern-matching utility functions for Sphinx.

Class Matcher A pattern matcher for Multiple shell-style glob patterns.
Function compile_matchers Undocumented
Function get_matching_files Get all file names in a directory, recursively.
Function patfilter Return the subset of the list ``names`` that match the regular expression (pattern) ``pat``.
Function patmatch Return if name matches the regular expression (pattern) ``pat```. Adapted from fnmatch module.
Constant DOTFILES Undocumented
Function _translate_pattern Translate a shell-style glob pattern to a regular expression.
Variable _pat_cache Undocumented
def compile_matchers(patterns): (source)

Undocumented

Parameters
patterns:Iterable[str]Undocumented
Returns
list[Callable[[str], re.Match[str]|None]]Undocumented
def get_matching_files(dirname, include_patterns=('**'), exclude_patterns=()): (source)

Get all file names in a directory, recursively. Filter file names by the glob-style include_patterns and exclude_patterns. The default values include all files ("**") and exclude nothing (""). Only files matching some pattern in *include_patterns* are included, and exclusions from *exclude_patterns* take priority over inclusions.

Parameters
dirname:strUndocumented
include_patterns:Iterable[str]Undocumented
exclude_patterns:Iterable[str]Undocumented
Returns
Iterator[str]Undocumented
def patfilter(names, pat): (source)

Return the subset of the list ``names`` that match the regular expression (pattern) ``pat``. Adapted from fnmatch module.

Parameters
names:Iterable[str]Undocumented
pat:strUndocumented
Returns
list[str]Undocumented
def patmatch(name, pat): (source)

Return if name matches the regular expression (pattern) ``pat```. Adapted from fnmatch module.

Parameters
name:strUndocumented
pat:strUndocumented
Returns
re.Match[str]|NoneUndocumented
DOTFILES = (source)

Undocumented

Value
Matcher(['**/.*'])
def _translate_pattern(pat): (source)

Translate a shell-style glob pattern to a regular expression. Adapted from the fnmatch module, but enhanced so that single stars don't match slashes.

Parameters
pat:strUndocumented
Returns
strUndocumented
_pat_cache: dict[str, re.Pattern] = (source)

Undocumented