|
|
@@ -256,19 +256,24 @@ class DetailBase(object):
|
|
|
|
|
|
# 生成各个详情图切片
|
|
|
def deal_details(self):
|
|
|
- detailed_images = []
|
|
|
- for index, func in enumerate(self.deal_pic_func_list):
|
|
|
- image_pp = func()
|
|
|
- if not self.assigned_page_list:
|
|
|
- self.image_list_append(detailed_images, image_pp)
|
|
|
- else:
|
|
|
- index = "{}".format(index + 1)
|
|
|
- if index in self.assigned_page_list:
|
|
|
+ try:
|
|
|
+ detailed_images = []
|
|
|
+ for index, func in enumerate(self.deal_pic_func_list):
|
|
|
+ image_pp = func()
|
|
|
+ if not self.assigned_page_list:
|
|
|
self.image_list_append(detailed_images, image_pp)
|
|
|
else:
|
|
|
- self.image_list_append(detailed_images, {"mes": "不生成"})
|
|
|
+ index = "{}".format(index + 1)
|
|
|
+ if index in self.assigned_page_list:
|
|
|
+ self.image_list_append(detailed_images, image_pp)
|
|
|
+ else:
|
|
|
+ self.image_list_append(detailed_images, {"mes": "不生成"})
|
|
|
|
|
|
- return [x for x in detailed_images if x]
|
|
|
+ return [x for x in detailed_images if x]
|
|
|
+ except KeyError as e:
|
|
|
+ raise UnicornException(f"缺少详情页资料:[{e}],请检查系统商品信息或excel是否缺少该字段")
|
|
|
+ except Exception as e:
|
|
|
+ raise UnicornException(str(e))
|
|
|
|
|
|
# 生成拼接的图片
|
|
|
def generate_spliced_picture(self):
|