Browse Source

已存在直接切屁

master
dongchangxi 6 days ago
parent
commit
db129b7f2c
  1. 9
      factory_sliceing/download_batch_data/main_download_batch_data_and_trans.py
  2. 1
      factory_sliceing/download_batch_data/utils/funcs.py

9
factory_sliceing/download_batch_data/main_download_batch_data_and_trans.py

@ -18,14 +18,19 @@ elif ENV == 'prod':
def step1(versionId): def step1(versionId):
# 下载json 文件 和 图片 # 下载json 文件 和 图片
dirName,machineInfo = downloadJsonAndJpgFileAndMoveToCorrectDir(versionId,currentDir) dirName,machineInfo,isAlreadyExist = downloadJsonAndJpgFileAndMoveToCorrectDir(versionId,currentDir)
if not dirName: if not dirName:
return False return False
#判断是否是小机台 #判断是否是小机台
isSmallMachine = False isSmallMachine = False
if str(machineInfo["machine_type"]) == '1': if str(machineInfo["machine_type"]) == '1':
isSmallMachine = True 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
#下载数据,转换数据 #下载数据,转换数据

1
factory_sliceing/download_batch_data/utils/funcs.py

@ -215,6 +215,7 @@ def downloadJsonAndJpgFileAndMoveToCorrectDir(versionId, currentDir):
# 判断目录是否存在,存在就删除 # 判断目录是否存在,存在就删除
if os.path.exists(dirNewName): if os.path.exists(dirNewName):
return dirNewName, machineInfo,True
shutil.rmtree(dirNewName) shutil.rmtree(dirNewName)
# 创建目录 # 创建目录
os.makedirs(dirNewName) os.makedirs(dirNewName)

Loading…
Cancel
Save