Module pyinotify :: Class ExcludeFilter
[hide private]
[frames] | no frames]

Class ExcludeFilter

source code


ExcludeFilter is an exclusion filter.

Instance Methods [hide private]
 
__init__(self, arg_lst)
Examples: ef1 = ExcludeFilter(["/etc/rc.*", "/etc/hostname"]) ef2 = ExcludeFilter("/my/path/exclude.lst") Where exclude.lst contains: /etc/rc.* /etc/hostname
source code
 
_load_patterns_from_file(self, filename) source code
 
_match(self, regex, path) source code
bool
__call__(self, path)
Returns: Return True if path has been matched and should be excluded, False otherwise.
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, arg_lst)
(Constructor)

source code 

Examples:
  ef1 = ExcludeFilter(["/etc/rc.*", "/etc/hostname"])
  ef2 = ExcludeFilter("/my/path/exclude.lst")
  Where exclude.lst contains:
  /etc/rc.*
  /etc/hostname

Note: it is not possible to exclude a file if its encapsulating
      directory is itself watched. See this issue for more details
      https://github.com/seb-m/pyinotify/issues/31

@param arg_lst: is either a list of patterns or a filename from which
                patterns will be loaded.
@type arg_lst: list of str or str

Overrides: object.__init__

__call__(self, path)
(Call operator)

source code 
Parameters:
  • path (str) - Path to match against provided regexps.
Returns: bool
Return True if path has been matched and should be excluded, False otherwise.