'commit'
This commit is contained in:
@@ -18,7 +18,9 @@ from Apps.XinDianTu.Config.Setting import SCROLL_DISTANCE_RATIO, WAIT_AFTER_SCRO
|
||||
from Apps.XinDianTu.FirstPageKit import run_ocr_rect, run_batch_in_dir
|
||||
|
||||
|
||||
LOGS_DIR = os.path.join(os.path.dirname(os.path.abspath(__file__)), "Logs")
|
||||
OUTPUT_DIR = os.path.join(project_root, "Output")
|
||||
LOGS_DIR = os.path.join(project_root, "Logs")
|
||||
os.makedirs(OUTPUT_DIR, exist_ok=True)
|
||||
os.makedirs(LOGS_DIR, exist_ok=True)
|
||||
LOG_FILE_PATH = os.path.join(LOGS_DIR, "T_XinDianTu_FirstPageScrollTest.log")
|
||||
|
||||
@@ -51,7 +53,7 @@ async def run_scroll_capture():
|
||||
|
||||
logger.info(f"当前设备: {device_info.get('productName')} | 分辨率: {w}x{h}")
|
||||
|
||||
base_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "Output")
|
||||
base_dir = OUTPUT_DIR
|
||||
if os.path.exists(base_dir):
|
||||
for name in os.listdir(base_dir):
|
||||
path = os.path.join(base_dir, name)
|
||||
@@ -89,7 +91,7 @@ async def run_single_image(image_path: str):
|
||||
|
||||
|
||||
async def run_output_regression():
|
||||
base_dir = os.path.join(os.path.dirname(os.path.abspath(__file__)), "Output")
|
||||
base_dir = OUTPUT_DIR
|
||||
if not os.path.exists(base_dir):
|
||||
logger.error(f"离线回归目录不存在: {base_dir}")
|
||||
return
|
||||
@@ -153,6 +155,20 @@ async def run_output_regression():
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
if os.path.exists(LOGS_DIR):
|
||||
for name in os.listdir(LOGS_DIR):
|
||||
if not name.startswith("T_XinDianTu_"):
|
||||
continue
|
||||
path = os.path.join(LOGS_DIR, name)
|
||||
if os.path.isfile(path) or os.path.islink(path):
|
||||
try:
|
||||
os.remove(path)
|
||||
except PermissionError:
|
||||
pass
|
||||
elif os.path.isdir(path):
|
||||
shutil.rmtree(path, ignore_errors=True)
|
||||
else:
|
||||
os.makedirs(LOGS_DIR, exist_ok=True)
|
||||
mode = "scroll"
|
||||
image_path = None
|
||||
if len(sys.argv) >= 2:
|
||||
|
||||
Reference in New Issue
Block a user