storage.py 文件源码

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

项目:piston-lib 作者: xeroc 项目源码 文件源码
def check_legacy_v2(self):
        """ Look for legacy wallet and move to new directory
        """
        appname = "steem"
        appauthor = "Fabian Schuh"
        storageDatabase = "steem.sqlite"
        data_dir = user_data_dir(appname, appauthor)
        sqlDataBaseFile = os.path.join(data_dir, storageDatabase)

        if os.path.isdir(data_dir) and not os.path.exists(self.sqlDataBaseFile):
            # Move whole directory
            try:
                shutil.copytree(data_dir, self.data_dir)
            except FileExistsError:
                pass
            # Copy piston.sql to steem.sql (no deletion!)
            shutil.copy(sqlDataBaseFile, self.sqlDataBaseFile)
            log.info("Your settings have been moved to {}".format(self.sqlDataBaseFile))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号