|
|
@@ -100,7 +100,9 @@ class DetailBase(object):
|
|
|
|
|
|
def run_all(self):
|
|
|
if self.template_name:
|
|
|
- self.out_put_dir = "{}/{}".format(self.out_put_dir, self.template_name)
|
|
|
+ self.out_put_dir = "{}/详情模板{}".format(
|
|
|
+ self.out_put_dir, self.template_name
|
|
|
+ )
|
|
|
|
|
|
print("===================detailed_images=================")
|
|
|
# 如果没有指定页面,则删除指定目录下的对应的详情文件夹
|
|
|
@@ -108,7 +110,7 @@ class DetailBase(object):
|
|
|
self.del_detail_folder()
|
|
|
detailed_images = self.deal_details()
|
|
|
self.create_folder(self.out_put_dir)
|
|
|
- detail_path = "{out_put_dir}/{goods_no}/details".format(
|
|
|
+ detail_path = "{out_put_dir}/{goods_no}/详情页切片".format(
|
|
|
out_put_dir=self.out_put_dir, goods_no=self.goods_no
|
|
|
)
|
|
|
self.create_folder(detail_path)
|
|
|
@@ -187,7 +189,8 @@ class DetailBase(object):
|
|
|
|
|
|
# 生成拼接的图片
|
|
|
def generate_spliced_picture(self):
|
|
|
- detail_path = "{out_put_dir}/{goods_no}/details".format(
|
|
|
+ print("详情页切片", "详情页切片")
|
|
|
+ detail_path = "{out_put_dir}/{goods_no}/详情页切片".format(
|
|
|
out_put_dir=self.out_put_dir, goods_no=self.goods_no
|
|
|
)
|
|
|
if not os.path.exists(detail_path):
|
|
|
@@ -197,11 +200,11 @@ class DetailBase(object):
|
|
|
detailed_images.append(PictureProcessing(image_data["file_path"]))
|
|
|
# 生成拼接图
|
|
|
img = self.add_pic(detailed_images)
|
|
|
- join_path = "{out_put_dir}/{goods_no}/拼接图".format(
|
|
|
+ join_path = "{out_put_dir}/{goods_no}/详情页".format(
|
|
|
out_put_dir=self.out_put_dir, goods_no=self.goods_no
|
|
|
)
|
|
|
- self.create_folder(join_path)
|
|
|
- img.save("{}/1.jpg".format(join_path), format="JPEG")
|
|
|
+ # self.create_folder(join_path)
|
|
|
+ img.save("{}.jpg".format(join_path), format="JPEG")
|
|
|
|
|
|
def image_list_append(self, image_list: list, data):
|
|
|
self.check_state_end()
|
|
|
@@ -481,15 +484,15 @@ class DetailBase(object):
|
|
|
goods_art_no = goods_art_no_dict["货号"]
|
|
|
# print("goods_art_no:", goods_art_no)
|
|
|
# 移动颜色图=====================
|
|
|
- goods_art_no_f = "{}/{}/{}".format(
|
|
|
- self.out_put_dir, self.goods_no, goods_art_no
|
|
|
+ goods_art_no_f = "{}/{}".format(
|
|
|
+ self.out_put_dir, self.goods_no
|
|
|
)
|
|
|
self.create_folder(goods_art_no_f)
|
|
|
# 放入一张主图
|
|
|
old_pic_path_1 = goods_art_no_dict["800x800"][0]
|
|
|
shutil.copy(
|
|
|
old_pic_path_1,
|
|
|
- "{}/{}{}".format(
|
|
|
+ "{}/颜色图{}{}".format(
|
|
|
goods_art_no_f, goods_art_no, os.path.splitext(old_pic_path_1)[1]
|
|
|
),
|
|
|
)
|
|
|
@@ -501,7 +504,7 @@ class DetailBase(object):
|
|
|
e = os.path.splitext(pic_path)[1]
|
|
|
shutil.copy(
|
|
|
pic_path,
|
|
|
- "{out_put_dir}/{goods_no}/{goods_no}({goods_no_main_pic_number}){e}".format(
|
|
|
+ "{out_put_dir}/{goods_no}/主图{goods_no}({goods_no_main_pic_number}){e}".format(
|
|
|
out_put_dir=self.out_put_dir,
|
|
|
goods_no=self.goods_no,
|
|
|
goods_no_main_pic_number=str(
|