def watch_shakemaps_push(
working_dir, timeout=None, handler=None, daemon=False):
wm = pyinotify.WatchManager()
if daemon:
notifier = pyinotify.ThreadedNotifier(wm, handler, timeout=timeout)
else:
notifier = pyinotify.Notifier(wm, handler, timeout=timeout)
flags = pyinotify.IN_CREATE | pyinotify.IN_MODIFY | pyinotify.IN_MOVED_TO
wm.add_watch(working_dir, flags, rec=True, auto_add=True)
return notifier
评论列表
文章目录