File renames, or moving files into or out of the directory, weren't being detected.

This commit is contained in:
Andrew Hamilton 2016-01-23 21:09:16 +00:00
parent 3538e5ba0d
commit 74ca3426ff

3
vigil
View file

@ -850,7 +850,8 @@ def is_path_excluded(path):
def make_watch_manager(root_path, callback):
watch_manager = pyinotify.WatchManager()
event_mask = (pyinotify.IN_CREATE | pyinotify.IN_DELETE |
pyinotify.IN_CLOSE_WRITE | pyinotify.IN_ATTRIB)
pyinotify.IN_CLOSE_WRITE | pyinotify.IN_ATTRIB |
pyinotify.IN_MOVED_FROM | pyinotify.IN_MOVED_TO)
watch_manager.add_watch(root_path, event_mask, rec=True, auto_add=True,
proc_fun=callback, exclude_filter=lambda path:
is_path_excluded(path))