update progress bar

This commit is contained in:
zachary62
2025-05-05 11:53:53 -04:00
parent a1d1ab697c
commit 060bc9d50e
2 changed files with 26 additions and 24 deletions
+1 -11
View File
@@ -62,22 +62,12 @@ class FetchRepo(Node):
else:
print(f"Crawling directory: {prep_res['local_dir']}...")
def progress_callback(processed, total):
percentage = (processed / total) * 100 if total > 0 else 0
rounded_percentage = int(percentage)
if rounded_percentage > progress_callback.last_reported:
progress_callback.last_reported = rounded_percentage
print(f"\033[92mProgress: {processed}/{total} files ({rounded_percentage}%)\033[0m")
progress_callback.last_reported = -1
result = crawl_local_files(
directory=prep_res["local_dir"],
include_patterns=prep_res["include_patterns"],
exclude_patterns=prep_res["exclude_patterns"],
max_file_size=prep_res["max_file_size"],
use_relative_paths=prep_res["use_relative_paths"],
progress_callback=progress_callback
use_relative_paths=prep_res["use_relative_paths"]
)
# Convert dict to list of tuples: [(path, content), ...]