From 729c6259bf82aef0adc27faa10384cd019f9e915 Mon Sep 17 00:00:00 2001 From: xz Date: Fri, 30 Oct 2026 20:05:22 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E5=9C=A8=E6=96=87=E4=BB=B6=E6=80=BB?= =?UTF-8?q?=E6=95=B0=E5=B0=8F=E4=BA=8E100=E7=9A=84=E6=A3=80=E6=9F=A5?= =?UTF-8?q?=E4=B8=AD=E5=B4=A9=E6=BA=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- app.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app.py b/app.py index 4615b3a..acfbf0b 100644 --- a/app.py +++ b/app.py @@ -16,6 +16,7 @@ def traverse_dir(root_dir): def hash_files_from_glist(algorithm: function): print("正在计算文件散列ing...") i = 0 + p_old_i = -1 for f_path in runing_data.file_path_list: with open(f_path, "rb") as f: f_hash = hashlib.file_digest(f, algorithm) @@ -25,7 +26,7 @@ def hash_files_from_glist(algorithm: function): if i % config.wait_c == 0: p_old_i = i print(f"\r{i}/{len(runing_data.file_path_list)}", end="") - if i != p_old_i: + if p_old_i != -1 and i != p_old_i: print(f"\r{i}/{len(runing_data.file_path_list)}", end="") print()