diff --git a/CHANGELOG.md b/CHANGELOG.md index 1386aae0..9bbd6379 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -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 diff --git a/docs/source/progress.rst b/docs/source/progress.rst index 1a4e02ed..4ce35883 100644 --- a/docs/source/progress.rst +++ b/docs/source/progress.rst @@ -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 ~~~~~~~~~~~~~