Files
Medios-Macina/SYS/progress.py
Nose ef01ca03a0
Some checks failed
smoke-mm / Install & smoke test mm --help (push) Has been cancelled
Migrate imports to SYS package (pipeline/result_table) and update related imports
2025-12-29 23:28:15 -08:00

33 lines
680 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 SYS.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()