unison.py 文件源码

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

项目:substance 作者: turbulent 项目源码 文件源码
def start(self, direction, path=''):
        self.ensureKeyPerms()
        unisonPath = self.getUnisonBin()
        unisonArgs = self.getUnisonArgs(direction, path)
        unisonEnv = self.getUnisonEnv()
        if self.ignoreArchives:
            # It seems that in certain cases, unison does not observe the -ignorearchives flag correctly
            # So to make sure, we forcibly delete previous archives on both sides
            res = Try.sequence([
                # Delete host archives
                Shell.call(["rm", "-rf", unisonEnv['UNISON']], shell=False),
                # Delete guest archives
                self.engine.readLink().bind(Link.runCommand, 'rm -rf /substance/.unison')
            ])
            if res.isFail():
                return res
        logger.info("Syncing local directory %s to remote directory %s", unisonArgs[-2], unisonArgs[-1])
        logger.debug("EXEC: %s", Shell.stringify([unisonPath] + unisonArgs, unisonEnv))
        os.execve(unisonPath, unisonArgs, unisonEnv)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号