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)
addon_updater.py 文件源码
python
阅读 30
收藏 0
点赞 0
评论 0
评论列表
文章目录