Created
April 26, 2010 18:26
-
-
Save shnjp/379685 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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