1
This commit is contained in:
1 parent
4d5d7dd456
commit
9788861224
1 file changed
+6
-8
@@ -32,6 +32,7 @@ def down_obj_fromoss(pid,order_id):
|
|||||||
ossPath = res.json()['data']
|
ossPath = res.json()['data']
|
||||||
ossPath = ossPath.replace("\\","/")
|
ossPath = ossPath.replace("\\","/")
|
||||||
|
|
||||||
|
|
||||||
path = os.path.join(workdir, 'print', pid)
|
path = os.path.join(workdir, 'print', pid)
|
||||||
if not os.path.exists(path): os.makedirs(path)
|
if not os.path.exists(path): os.makedirs(path)
|
||||||
|
|
||||||
@@ -39,17 +40,14 @@ def down_obj_fromoss(pid,order_id):
|
|||||||
prefix = f'objs/print/{pid}/'
|
prefix = f'objs/print/{pid}/'
|
||||||
if ossPath != "":
|
if ossPath != "":
|
||||||
prefix = os.path.join("objs","print",pid,ossPath,order_id)
|
prefix = os.path.join("objs","print",pid,ossPath,order_id)
|
||||||
|
prefix = prefix.replace("\\","/")
|
||||||
|
|
||||||
print(f'prefix:{prefix}')
|
print(f'prefix:{prefix}')
|
||||||
print(f'ossPath:{ossPath}')
|
print(f'实际有用的地址:objs/print/253312/model/standard_size/88942')
|
||||||
# #判断filelist是否为空
|
|
||||||
# if len(list(filelist)) == 0:
|
|
||||||
# filelist = oss2.ObjectIteratorV2(oss_client, prefix=f'objs/print/{pid}/')
|
|
||||||
# print(f"从 objs/print/{pid}/ 下载数据")
|
|
||||||
# else:
|
|
||||||
print(f"从 objs/print/{pid}/{ossPath}/{order_id}/ 下载数据")
|
|
||||||
prefix = "objs/print/253312/model/standard_size/88942"
|
|
||||||
filelist = oss2.ObjectIteratorV2(oss_client, prefix=prefix)
|
filelist = oss2.ObjectIteratorV2(oss_client, prefix=prefix)
|
||||||
|
if len(list(filelist)) == 0:
|
||||||
|
filelist = oss2.ObjectIteratorV2(oss_client, prefix=f"objs/print/{pid}")
|
||||||
|
|
||||||
find = False
|
find = False
|
||||||
for file in filelist:
|
for file in filelist:
|
||||||
filename = file.key.split('/')[-1]
|
filename = file.key.split('/')[-1]
|
||||||
|
|||||||
Reference in new issue
Block a user