Files
Medios-Macina/SYS/progress.py
Nose c019c00aed
Some checks failed
smoke-mm / Install & smoke test mm --help (push) Has been cancelled
df
2025-12-29 17:05:03 -08:00

30 lines
661 B
Python

"""Rich-only progress helpers.
These functions preserve the legacy call signatures used around the codebase,
but all rendering is performed via Rich (no ASCII progress bars).
"""
from __future__ import annotations
import sys
from models import ProgressBar
_BAR = ProgressBar()
def print_progress(
filename: str, current: int, total: int, speed: float = 0, end: str = "\r"
) -> None:
_BAR.update(
downloaded=int(current),
total=int(total) if total else None,
label=str(filename or "progress"),
file=sys.stderr,
)
def print_final_progress(filename: str, total: int, elapsed: float) -> None:
_BAR.finish()