From 0c49ca0fccc23b94238907c57efbeb4b8c1696fa Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Tue, 14 Nov 2023 13:39:59 +0100 Subject: [PATCH] implemented progress --- main.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index c98122e..045f719 100644 --- a/main.py +++ b/main.py @@ -2,6 +2,7 @@ import os import argparse import hashlib from collections import defaultdict +from tqdm import tqdm def md5sum(filename): hash_md5 = hashlib.md5() @@ -13,10 +14,10 @@ def md5sum(filename): def find_duplicates(directories, file_type): hashes = defaultdict(list) for directory in directories: - for root, dirs, files in os.walk(directory, followlinks=False): + for root, dirs, files in tqdm(os.walk(directory, followlinks=False), desc="Indexing files", unit="dir"): for filename in files: if file_type and not filename.endswith(file_type): - continue + continue path = os.path.join(root, filename) if not os.path.islink(path): file_hash = md5sum(path)