JanKanis avatar JanKanis committed 435887b

update README, small changes to watcher.py

Comments (0)

Files changed (2)

 slow to the extent that I stopped trying to fix its problems and wrote
 a new implementation instead.
 
+One difference is that pyinotify has a callback based API in which you 
+define callbacks or methods that are called when a specific event happens, 
+forcing an event-driven programmig style. Python-inotify has an API that 
+allows you to use a blocking `Watcher.read()` call. 
+
 You can find pyinotify at http://pyinotify.sourceforge.net/
 
 

inotify/watcher.py

         for evt in inotify.read(self.fd, bufsize):
             event = Event(evt, None if evt.wd == -1 else self._wds[evt.wd][0])
             events.append(event)
-            if evt.mask & inotify.IN_IGNORED:
+            if evt.ignored:
                 self._remove(evt.wd)
-            elif evt.mask & inotify.IN_UNMOUNT:
+            elif evt.umount:
                 self.close()
         return events
 
         callable that takes one parameter.  It will be called each time
         a directory is about to be automatically watched.  If it returns
         True, the directory will be watched if it still exists,
-        otherwise, it will beb skipped.'''
+        otherwise, it will be skipped.'''
 
         super(AutoWatcher, self).__init__()
         self.addfilter = addfilter
Tip: Filter by directory path e.g. /media app.js to search for public/media/app.js.
Tip: Use camelCasing e.g. ProjME to search for ProjectModifiedEvent.java.
Tip: Filter by extension type e.g. /repo .js to search for all .js files in the /repo directory.
Tip: Separate your search with spaces e.g. /ssh pom.xml to search for src/ssh/pom.xml.
Tip: Use ↑ and ↓ arrow keys to navigate and return to view the file.
Tip: You can also navigate files with Ctrl+j (next) and Ctrl+k (previous) and view the file with Ctrl+o.
Tip: You can also navigate files with Alt+j (next) and Alt+k (previous) and view the file with Alt+o.