diff --git a/examples/downloader.py b/examples/downloader.py index ceba2c7d..172f4286 100644 --- a/examples/downloader.py +++ b/examples/downloader.py @@ -8,7 +8,7 @@ from urllib.request import urlopen from rich.progress import bar_widget, Progress, TaskID -progress = Progress(bar_widget, "{task.percentage:0.1f}%", "{task.fields[filename]}") +progress = Progress(bar_widget, "{task.percentage:>3.0f}%", "{task.fields[filename]}") def copy_url(task_id: TaskID, url: str, path: str) -> None: diff --git a/rich/progress.py b/rich/progress.py index 99c14600..e2fda726 100644 --- a/rich/progress.py +++ b/rich/progress.py @@ -141,6 +141,7 @@ class Progress: task.completed = completed if visible is not None: task.visible = True + task.fields.update(fields) def refresh(self) -> None: """Refresh (render) the progress information.""" diff --git a/rich/table.py b/rich/table.py index f65b53ab..363e5dc5 100644 --- a/rich/table.py +++ b/rich/table.py @@ -457,7 +457,7 @@ class Table: yield new_line -if __name__ == "__main__": # pragma: no cover +if __name__ == "__main__": from .console import Console c = Console(width=80)