def start(self):
for f in os.listdir(self.path):
name = file2mod(f)
if not name:
continue
self._load(name)
wm = pyinotify.WatchManager()
wm.add_watch(self.path,
pyinotify.IN_DELETE |
pyinotify.IN_CREATE |
pyinotify.IN_MODIFY ,
rec = False)
handle = EventHandler(self)
self._notifier = pyinotify.TornadoAsyncNotifier(
wm, self._ioloop, default_proc_fun = handle)
评论列表
文章目录