已存在直接切屁

This commit is contained in:
dongchangxi committed 2025-12-19 16:03:54 +08:00
1 parent 2ce2000147
commit db129b7f2c
2 files changed
+8 -2

No files matched your search

@@ -18,14 +18,19 @@ elif ENV == 'prod':
def step1(versionId):
# 下载json 文件 和 图片
dirName,machineInfo = downloadJsonAndJpgFileAndMoveToCorrectDir(versionId,currentDir)
dirName,machineInfo,isAlreadyExist = downloadJsonAndJpgFileAndMoveToCorrectDir(versionId,currentDir)
if not dirName:
return False
#判断是否是小机台
isSmallMachine = False
if str(machineInfo["machine_type"]) == '1':
isSmallMachine = True
if isAlreadyExist:
objFilePath = os.path.join(dirName, 'json')
keyValue = f'{versionId}_small_No{machineInfo["id"]}'
BeginSliceing(versionId,machineInfo["id"],objFilePath,keyValue)
return True
#下载数据,转换数据
@@ -215,6 +215,7 @@ def downloadJsonAndJpgFileAndMoveToCorrectDir(versionId, currentDir):
# 判断目录是否存在,存在就删除
if os.path.exists(dirNewName):
return dirNewName, machineInfo,True
shutil.rmtree(dirNewName)
# 创建目录
os.makedirs(dirNewName)