|
|
@@ -25,14 +25,6 @@ from service.base import check_move_goods_art_no_folder
|
|
|
import hashlib
|
|
|
import win32api, win32gui, win32con
|
|
|
from win32gui import EnumWindows, GetWindowText
|
|
|
-
|
|
|
-
|
|
|
-# from service.AutoDealPics import AutoDealPics
|
|
|
-# for plugin in settings.plugins:
|
|
|
-# module_path, class_name = plugin.rsplit(".", 1)
|
|
|
-# print("module_path", module_path, class_name)
|
|
|
-# module = importlib.import_module(module_path)
|
|
|
-# getattr(module, class_name)
|
|
|
def calculate_md5(filepath):
|
|
|
# 打开文件,以二进制只读模式打开
|
|
|
with open(filepath, "rb") as f:
|
|
|
@@ -315,6 +307,7 @@ async def handle_detail(request: Request, params: HandlerDetail):
|
|
|
limit_path = "output/{}".format(
|
|
|
time.strftime("%Y-%m-%d", time.localtime(time.time()))
|
|
|
)
|
|
|
+ check_path(limit_path)
|
|
|
# 该数组表示是否需要后面的移动文件夹操作,减少重复抠图,提升抠图时间和速度
|
|
|
move_folder_array = check_move_goods_art_no_folder(
|
|
|
"output", goods_art_no_arrays, limit_path
|
|
|
@@ -481,9 +474,11 @@ async def handle_detail(request: Request, params: HandlerDetail):
|
|
|
handler_result.append(
|
|
|
{"goods_art_no": "", "success": False, "info": "处理失败"}
|
|
|
)
|
|
|
+ except UnicornException as e:
|
|
|
+ handler_result_folder = ""
|
|
|
+ handler_result = e.msg
|
|
|
except Exception as e:
|
|
|
- print(e.__traceback__.tb_frame.f_globals["__file__"]) # 发生异常所在的文件
|
|
|
- print(e.__traceback__.tb_lineno) # 发生异常所在的行数
|
|
|
+ handler_result_folder = ""
|
|
|
handler_result.append({"goods_art_no": "", "success": False, "info": str(e)})
|
|
|
return {
|
|
|
"code": 0,
|