Skip to content

Commit

Permalink
Merge pull request #3452 from sbraz/typos_examples
Browse files Browse the repository at this point in the history
Fix some typos and update one example
  • Loading branch information
willmcgugan authored Aug 26, 2024
2 parents 1b2dada + 2edbc66 commit 035f3ea
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 4 deletions.
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion docs/source/progress.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://docs.python.org/3/library/string.html#formatspec>`_ 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::

Expand Down
3 changes: 2 additions & 1 deletion examples/downloader.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion rich/live.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
2 changes: 1 addition & 1 deletion rich/progress.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 035f3ea

Please sign in to comment.