From 4d09d5dc0625b00629eef1303ef550a0540664f9 Mon Sep 17 00:00:00 2001 From: Sebastien Martini Date: Mon, 30 Jun 2008 18:26:28 +0200 Subject: Documentation. --- pyinotify.py | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/pyinotify.py b/pyinotify.py index 9d0a106..b66a1a8 100755 --- a/pyinotify.py +++ b/pyinotify.py @@ -1227,12 +1227,17 @@ class Watch: class ExcludeFilter: + """ + ExcludeFilter is an exclusion filter. + """ + def __init__(self, arg_lst): """ - arg_lst is either a list or dict. - [pattern1, ..., patternn] - {'filename1': (list1, listn), ...} where list1 is a list - of patterns + @param arg_lst: is either a list or dict of patterns: + [pattern1, ..., patternn] + {'filename1': (list1, listn), ...} where list1 is + a list of patterns + @type arg_lst: list or dict """ if isinstance(arg_lst, dict): lst = self._load_patterns(arg_lst) @@ -1258,6 +1263,13 @@ class ExcludeFilter: return regex.match(path) is not None def __call__(self, path): + """ + @param path: path to match against regexps. + @type path: str + @return: return True is path has been matched and should + be excluded, False otherwise. + @rtype: bool + """ for regex in self._lregex: if self._match(regex, path): return True -- cgit v1.2.1