utility.py 文件源码

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

项目:autoimgsys 作者: rbogle 项目源码 文件源码
def start_rtsync(self):
        if self.notifier is None:
            self.watchman = pyinotify.WatchManager()
            self.notifier = pyinotify.ThreadedNotifier(self.watchman, self.syncevt, read_freq=self.watch_delay)
            self.notifier.coalesce_events(True)
            mask = self.get_mask()
            wpaths = self.syncevt.get_wpaths()
            for awpath in wpaths:
                self.logger.debug("adding %s to sync watches" %awpath['src'])
                wpath = copy.deepcopy(awpath)
                self.watchman.add_watch(wpath['src'], mask, rec=True, auto_add=True)
                # do an initial sync, dont wait for rsync to finish.
                wpath['wait']=False
                self.rsync.sync(**wpath)
            self.logger.debug("starting notifier...")
            self.notifier.start()
        else:
            self.logger.debug("start_rtsync called by notifier not none.")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号