Add MofNCompleteColumn ProgressColumn and Progress.get_default_column notes to docs

This commit is contained in:
ptmcg 2022-02-10 09:33:30 -06:00
parent 32e437a47d
commit 93ad00dffb
2 changed files with 11 additions and 1 deletions

View File

@ -11,7 +11,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added ProgressColumn `MofNCompleteColumn` to display raw `completed/total` column (similar to DownloadColumn,
but displays values as ints, does not convert to floats or add bit/bytes units).
https://github.com/Textualize/rich/discussions/1899
https://github.com/Textualize/rich/pull/1941
## [11.2.0] - 2022-02-08

View File

@ -113,12 +113,21 @@ The defaults are roughly equivalent to the following::
TimeRemainingColumn(),
)
To create a Progress with your own columns in addition to the defaults, use :meth:`~rich.progress.Progress.get_default_columns`::
progress = Progress(
SpinnerColumn(),
*Progress.get_default_columns(),
TimeElapsedColumn(),
)
The following column objects are available:
- :class:`~rich.progress.BarColumn` Displays the bar.
- :class:`~rich.progress.TextColumn` Displays text.
- :class:`~rich.progress.TimeElapsedColumn` Displays the time elapsed.
- :class:`~rich.progress.TimeRemainingColumn` Displays the estimated time remaining.
- :class:`~rich.progress.MofNCompleteColumn` Displays completion progress as ``"{task.completed}/{task.total}"`` (works best if completed and total are ints).
- :class:`~rich.progress.FileSizeColumn` Displays progress as file size (assumes the steps are bytes).
- :class:`~rich.progress.TotalFileSizeColumn` Displays total file size (assumes the steps are bytes).
- :class:`~rich.progress.DownloadColumn` Displays download progress (assumes the steps are bytes).
@ -128,6 +137,7 @@ The following column objects are available:
To implement your own columns, extend the :class:`~rich.progress.ProgressColumn` class and use it as you would the other columns.
Table Columns
~~~~~~~~~~~~~