chains.py 文件源码

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

项目:fluffy 作者: m4ce 项目源码 文件源码
def save(self):
        """Persist the chains to disk"""

        try:
            logger.debug("Backing up chains")
            if os.path.exists(self._db):
                shutil.copyfile(self._db, "{}.bak".format(self._db))
        except Exception as e:
            logger.exception("Failed to backup chains")
            return

        try:
            logger.debug("Saving chains")
            with open(self._db, 'w') as f:
                f.write(yaml.safe_dump(self._tables,
                                       default_flow_style=False, explicit_start=True))
        except:
            logger.exception("Failed to save chains")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号