日志: 处理中的文件名显示完整后缀
This commit is contained in:
+6
-5
@@ -454,13 +454,14 @@ class BatchTableExtractorApp:
|
||||
self.root.after(0, lambda: self.log("\n❌ 任务已被用户手动终止!"))
|
||||
break
|
||||
|
||||
base_name = os.path.splitext(os.path.basename(file_path))[0]
|
||||
full_name = os.path.basename(file_path)
|
||||
base_name = os.path.splitext(full_name)[0]
|
||||
target_excel = os.path.join(out_dir, f"{base_name}_表格.xlsx")
|
||||
|
||||
conflict_action = self.conflict_action_var.get()
|
||||
if os.path.exists(target_excel):
|
||||
if conflict_action == "直接跳过":
|
||||
self.root.after(0, lambda i=idx, t=total, name=base_name: self.log(f"[{i}/{t}] 跳过同名: {name}"))
|
||||
self.root.after(0, lambda i=idx, t=total, name=full_name: self.log(f"[{i}/{t}] 跳过同名: {name}"))
|
||||
record_log(batch_id, "跳过", base_name, "-", 0, 0.0, file_path, "发现同名文件,跳过")
|
||||
def update_skip_btn(i=idx, t=total):
|
||||
self.btn_run.config_btn(text=f"提取中 {i}/{t} | 点击终止操作")
|
||||
@@ -476,7 +477,7 @@ class BatchTableExtractorApp:
|
||||
break
|
||||
counter += 1
|
||||
|
||||
self.root.after(0, lambda i=idx, t=total, name=base_name: self.log(f"[{i}/{t}] 处理中: {name}"))
|
||||
self.root.after(0, lambda i=idx, t=total, name=full_name: self.log(f"[{i}/{t}] 处理中: {name}"))
|
||||
import time
|
||||
t0 = time.time()
|
||||
try:
|
||||
@@ -540,9 +541,9 @@ class BatchTableExtractorApp:
|
||||
import traceback
|
||||
trace_str = traceback.format_exc()
|
||||
if self.debug_var.get():
|
||||
err_msg = f" ❌ 失败跳过 [{base_name}]: {e}\n{trace_str}"
|
||||
err_msg = f" ❌ 失败跳过 [{full_name}]: {e}\n{trace_str}"
|
||||
else:
|
||||
err_msg = f" ❌ 失败跳过 [{base_name}]: {e}"
|
||||
err_msg = f" ❌ 失败跳过 [{full_name}]: {e}"
|
||||
self.root.after(0, lambda m=err_msg: self.log(m, tag="error"))
|
||||
record_log(batch_id, "失败", base_name, "-", 0, duration, file_path, f"{e}\n{trace_str}")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user