addon_updater.py 文件源码

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

项目:kaleidoscope 作者: blenderskool 项目源码 文件源码
def create_backup(self):
        if self._verbose:print("Backing up current addon folder")
        local = os.path.join(self._updater_path,"backup")
        tempdest = os.path.join(self._addon_root,
                        os.pardir,
                        self._addon+"_updater_backup_temp")

        if os.path.isdir(local) == True:
            shutil.rmtree(local)
        if self._verbose:print("Backup destination path: ",local)

        # make the copy
        shutil.copytree(self._addon_root,tempdest)
        shutil.move(tempdest,local)

        # save the date for future ref
        now = datetime.now()
        self._json["backup_date"] = "{m}-{d}-{yr}".format(
                m=now.strftime("%B"),d=now.day,yr=now.year)
        self.save_updater_json()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号