This commit is contained in:
nose
2025-12-13 12:09:50 -08:00
parent 30eb628aa3
commit 52a79b0086
16 changed files with 729 additions and 655 deletions

View File

@@ -3,7 +3,7 @@
import sys
from SYS.logger import log, debug
from SYS.logger import log
def format_progress_bar(current: int, total: int, width: int = 40, label: str = "") -> str:
@@ -69,7 +69,7 @@ def format_download_status(filename: str, current: int, total: int, speed: float
def print_progress(filename: str, current: int, total: int, speed: float = 0, end: str = "\r") -> None:
"""Print download progress to stderr (doesn't interfere with piped output)."""
status = format_download_status(filename, current, total, speed)
debug(status, end=end, flush=True)
print(status, file=sys.stderr, end=end, flush=True)
def print_final_progress(filename: str, total: int, elapsed: float) -> None:
@@ -86,7 +86,7 @@ def print_final_progress(filename: str, total: int, elapsed: float) -> None:
hours = elapsed / 3600
time_str = f"{hours:.2f}h"
debug(f"{bar} ({size_str}) - {time_str}")
print(f"{bar} ({size_str}) - {time_str}", file=sys.stderr, flush=True)
if __name__ == "__main__":