Skip to content

Instantly share code, notes, and snippets.

@shnjp
Created April 26, 2010 18:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shnjp/379685 to your computer and use it in GitHub Desktop.
Save shnjp/379685 to your computer and use it in GitHub Desktop.
try:
import pyfsevents
except ImportError:
raise
else:
class FSEventDirWatch(DirWatch):
def __init__(self):
pass
def wait(self, bld):
for x in self.enumerate(bld.srcnode):
path = os.path.abspath(x)
pyfsevents.registerpath(path, self.callback)
pyfsevents.listen()
pyfsevents.clear()
def callback(self, path, isrec):
print `path, isrec`
pyfsevents.stop()
DefaultDirWatch = FSEventDirWatch
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment