diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index edacc5885..5ad3e1df3 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -63,6 +63,7 @@ The following people have contributed to the development of Rich: - [Tushar Sadhwani](https://github.com/tusharsadhwani) - [Luca Salvarani](https://github.com/LukeSavefrogs) - [Paul Sanders](https://github.com/sanders41) +- [Louis Sautier](https://github.com/sbraz) - [Tim Savage](https://github.com/timsavage) - [Anthony Shaw](https://github.com/tonybaloney) - [Nicolas Simonds](https://github.com/0xDEC0DE) diff --git a/docs/source/progress.rst b/docs/source/progress.rst index 7a771c8d8..5db381bca 100644 --- a/docs/source/progress.rst +++ b/docs/source/progress.rst @@ -131,7 +131,7 @@ Columns You may customize the columns in the progress display with the positional arguments to the :class:`~rich.progress.Progress` constructor. The columns are specified as either a `format string `_ or a :class:`~rich.progress.ProgressColumn` object. -Format strings will be rendered with a single value `"task"` which will be a :class:`~rich.progress.Task` instance. For example ``"{task.description}"`` would display the task description in the column, and ``"{task.completed} of {task.total}"`` would display how many of the total steps have been completed. Additional fields passed via keyword arguments to `~rich.progress.Progress.update` are store in ``task.fields``. You can add them to a format string with the following syntax: ``"extra info: {task.fields[extra]}"``. +Format strings will be rendered with a single value `"task"` which will be a :class:`~rich.progress.Task` instance. For example ``"{task.description}"`` would display the task description in the column, and ``"{task.completed} of {task.total}"`` would display how many of the total steps have been completed. Additional fields passed via keyword arguments to `~rich.progress.Progress.update` are stored in ``task.fields``. You can add them to a format string with the following syntax: ``"extra info: {task.fields[extra]}"``. The default columns are equivalent to the following:: diff --git a/examples/downloader.py b/examples/downloader.py index 8a0be5001..b58e96f81 100644 --- a/examples/downloader.py +++ b/examples/downloader.py @@ -73,7 +73,8 @@ def download(urls: Iterable[str], dest_dir: str): if __name__ == "__main__": - # Try with https://releases.ubuntu.com/20.04/ubuntu-20.04.3-desktop-amd64.iso + # Try with https://releases.ubuntu.com/noble/ubuntu-24.04-desktop-amd64.iso + # and https://releases.ubuntu.com/noble/ubuntu-24.04-live-server-amd64.iso if sys.argv[1:]: download(sys.argv[1:], "./") else: diff --git a/rich/live.py b/rich/live.py index f0529a781..8738cf09f 100644 --- a/rich/live.py +++ b/rich/live.py @@ -37,7 +37,7 @@ class Live(JupyterMixin, RenderHook): Args: renderable (RenderableType, optional): The renderable to live display. Defaults to displaying nothing. - console (Console, optional): Optional Console instance. Default will an internal Console instance writing to stdout. + console (Console, optional): Optional Console instance. Defaults to an internal Console instance writing to stdout. screen (bool, optional): Enable alternate screen mode. Defaults to False. auto_refresh (bool, optional): Enable auto refresh. If disabled, you will need to call `refresh()` or `update()` with refresh flag. Defaults to True refresh_per_second (float, optional): Number of times per second to refresh the live display. Defaults to 4. diff --git a/rich/progress.py b/rich/progress.py index effcab40c..930d63e9a 100644 --- a/rich/progress.py +++ b/rich/progress.py @@ -1056,7 +1056,7 @@ class Progress(JupyterMixin): """Renders an auto-updating progress bar(s). Args: - console (Console, optional): Optional Console instance. Default will an internal Console instance writing to stdout. + console (Console, optional): Optional Console instance. Defaults to an internal Console instance writing to stdout. auto_refresh (bool, optional): Enable auto refresh. If disabled, you will need to call `refresh()`. refresh_per_second (Optional[float], optional): Number of times per second to refresh the progress information or None to use default (10). Defaults to None. speed_estimate_period: (float, optional): Period (in seconds) used to calculate the speed estimate. Defaults to 30.