notify_new_shake.py 文件源码

python
阅读 17 收藏 0 点赞 0 评论 0

项目:inasafe-realtime 作者: inasafe 项目源码 文件源码
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
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号