mkv2cast.ui.legacy_ui

Legacy text-based progress UI for mkv2cast.

Used when rich is not available or in non-interactive terminals.

Functions

fmt_hms(seconds)

Format seconds as HH:MM:SS.

mkbar(pct[, width])

Create a simple progress bar string.

shorten(s, maxlen)

Shorten a string with ellipsis if too long.

term_width()

Get terminal width.

Classes

LegacyProgressUI([progress, bar_width])

Fallback progress UI when rich is not available.

UIState(stage, pct, cur, total, base, eta, speed)

State for legacy UI rendering.

mkv2cast.ui.legacy_ui.term_width() int[source]

Get terminal width.

mkv2cast.ui.legacy_ui.mkbar(pct: int, width: int = 26) str[source]

Create a simple progress bar string.

mkv2cast.ui.legacy_ui.shorten(s: str, maxlen: int) str[source]

Shorten a string with ellipsis if too long.

mkv2cast.ui.legacy_ui.fmt_hms(seconds: float) str[source]

Format seconds as HH:MM:SS.

class mkv2cast.ui.legacy_ui.UIState(stage: str, pct: int, cur: int, total: int, base: str, eta: str, speed: str, elapsed: str = '')[source]

Bases: object

State for legacy UI rendering.

stage: str
pct: int
cur: int
total: int
base: str
eta: str
speed: str
elapsed: str = ''
class mkv2cast.ui.legacy_ui.LegacyProgressUI(progress: bool = True, bar_width: int = 26)[source]

Bases: object

Fallback progress UI when rich is not available.

render(st: UIState) None[source]

Render progress line to terminal.

endline() None[source]

Clear the current progress line.

log(msg: str) None[source]

Print a log message, clearing progress line first.

inc_ok() None[source]

Increment success counter.

inc_skipped() None[source]

Increment skipped counter.

inc_failed() None[source]

Increment failed counter.

get_stats()[source]

Get current stats.