diff options
Diffstat (limited to 'python2/pyinotify.py')
-rwxr-xr-x | python2/pyinotify.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/python2/pyinotify.py b/python2/pyinotify.py index a91282f..4f07d65 100755 --- a/python2/pyinotify.py +++ b/python2/pyinotify.py @@ -1297,6 +1297,9 @@ class Notifier: """ while self._eventq: raw_event = self._eventq.popleft() # pop next event + if self._watch_manager.ignore_events: + log.debug("Event ignored: %s" % repr(raw_event)) + continue watch_ = self._watch_manager.get_watch(raw_event.wd) if (watch_ is None) and not (raw_event.mask & IN_Q_OVERFLOW): if not (raw_event.mask & IN_IGNORED): @@ -1752,6 +1755,7 @@ class WatchManager: filter for every call to add_watch. @type exclude_filter: callable object """ + self._ignore_events = False self._exclude_filter = exclude_filter self._wmd = {} # watch dict key: watch descriptor, value: watch @@ -2184,6 +2188,16 @@ class WatchManager: auto_add=False, do_glob=False, exclude_filter=lambda path: False) + def get_ignore_events(self): + return self._ignore_events + + def set_ignore_events(self, nval): + self._ignore_events = nval + + ignore_events = property(get_ignore_events, set_ignore_events, + "Make watch manager ignoring new events.") + + class RawOutputFormat: """ |