From 82a11b9960489143225f161a3d7f34bea4937635 Mon Sep 17 00:00:00 2001 From: Will McGugan Date: Sun, 15 Mar 2020 15:45:45 +0000 Subject: [PATCH] replace cwwidth --- .gitignore | 1 + rich/progress.py | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/.gitignore b/.gitignore index df23e0ae..acbe050d 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ mypy_report docs/build docs/source/_build +tools/*.txt # Byte-compiled / optimized / DLL files __pycache__/ diff --git a/rich/progress.py b/rich/progress.py index 5d0c9069..1fd95db7 100644 --- a/rich/progress.py +++ b/rich/progress.py @@ -412,6 +412,15 @@ class Progress: if refresh: self.refresh() + def advance(self, task_id: TaskID, advance: float = 1) -> None: + """Advance task by a number of steps. + + Args: + task_id (TaskID): ID of task. + advance (float): Number of steps to advance. Default is 1. + """ + self.update(task_id, advance=advance) + def refresh(self) -> None: """Refresh (render) the progress information.""" with self._lock: