addon_updater.py 文件源码

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

项目:Blender-WMO-import-export-scripts 作者: WowDevTools 项目源码 文件源码
def deepMergeDirectory(self,base,merger):
        if not os.path.exists(base):
            if self._verbose:print("Base path does not exist")
            return -1
        elif not os.path.exists(merger):
            if self._verbose:print("Merger path does not exist")
            return -1

        # this should have better error handling
        # and also avoid the addon dir
        # Could also do error handling outside this function
        for path, dirs, files in os.walk(merger):
            relPath = os.path.relpath(path, merger)
            destPath = os.path.join(base, relPath)
            if not os.path.exists(destPath):
                os.makedirs(destPath)
            for file in files:
                destFile = os.path.join(destPath, file)
                if os.path.isfile(destFile):
                    os.remove(destFile)
                srcFile = os.path.join(path, file)
                os.rename(srcFile, destFile)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号