BF: pyinotify - use bitwise op on masks and do not try tracking newly created directories

pull/142/head
Yaroslav Halchenko 2013-01-25 16:01:35 -05:00 committed by Orion Poplawski
parent 3b0800459b
commit e4aedfdc00
1 changed files with 5 additions and 1 deletions

View File

@ -65,7 +65,11 @@ class FilterPyinotify(FileFilter):
def callback(self, event):
path = event.pathname
if event.mask == pyinotify.IN_CREATE:
if event.mask & pyinotify.IN_CREATE:
# skip directories altogether
if event.mask & pyinotify.IN_ISDIR:
logSys.debug("Ignoring creation of directory %s" % path)
return
# check if that is a file we care about
if not path in self.__watches:
logSys.debug("Ignoring creation of %s we do not monitor" % path)