Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
extracted from fileNameRegex.
:type fileNameRegexGroups: str
:param groupRegexSubstitutions: A dictionary of lists. Keyed off the
regex group names. The values are lists of dictionaries contains
mappings of regex => repl using to replace parts of the captured group.
For example {'n': '-'} - The will replace the 'n' with '-'.
:type groupRegexSubstitutions: str
"""
self._validate_connection_params(path, fileNameRegex,
fileNameRegexGroups,
groupRegexSubstitutions)
self._filename_regex = fileNameRegex
self._filename_regex_groups = fileNameRegexGroups
self._group_regex_substitutions = groupRegexSubstitutions
self._monitor = Monitor(path, filename_regex=fileNameRegex,
valid_file_check=_valid_file_check)
def __init__(self, path, filename_regex=None,
valid_file_check=lambda f: True):
super(Monitor, self).__init__()
self._path = path
self._files = queue.Queue()
self._filename_regex \
= re.compile(filename_regex) if filename_regex else None
self._listing = set()
self._valid_file_check = valid_file_check