diff options
| author | avi robusta <avi@robusta.dev> | 2023-05-18 11:00:53 +0300 |
|---|---|---|
| committer | avi robusta <avi@robusta.dev> | 2023-05-18 11:00:53 +0300 |
| commit | c21b87db6bd330906116d31f4e308b2eced591e7 (patch) | |
| tree | a2212a5926cd3dc006b9fbe9e7ab2fb01dba9cc6 /robusta_krr/utils/progress_bar.py | |
| parent | a0c7a64dbba581e5db3bcb518f8326ac3330cb55 (diff) | |
PR fixes
Diffstat (limited to 'robusta_krr/utils/progress_bar.py')
| -rw-r--r-- | robusta_krr/utils/progress_bar.py | 12 |
1 files changed, 4 insertions, 8 deletions
diff --git a/robusta_krr/utils/progress_bar.py b/robusta_krr/utils/progress_bar.py index cd5038c..5bd71d5 100644 --- a/robusta_krr/utils/progress_bar.py +++ b/robusta_krr/utils/progress_bar.py @@ -1,7 +1,7 @@ from robusta_krr.utils.configurable import Configurable from alive_progress import alive_bar from robusta_krr.core.models.config import Config - +import sys class ProgressBar(Configurable): def __init__(self, config: Config, **kwargs) -> None: @@ -9,16 +9,12 @@ class ProgressBar(Configurable): self.show_bar = self.echo_active if self.show_bar: self.alive_bar = alive_bar(**kwargs) - - def __enter__(self): - if self.show_bar: self.bar = self.alive_bar.__enter__() - return self def progress(self): if self.show_bar: self.bar() - - def __exit__(self, *args): + + def close_bar(self): if self.show_bar: - self.alive_bar.__exit__(*args)
\ No newline at end of file + self.alive_bar.__exit__(*sys.exc_info())
\ No newline at end of file |
