diff options
Diffstat (limited to 'progress.py')
-rw-r--r-- | progress.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/progress.py b/progress.py index de46f538..43c7ad21 100644 --- a/progress.py +++ b/progress.py | |||
@@ -42,7 +42,8 @@ def duration_str(total): | |||
42 | 42 | ||
43 | 43 | ||
44 | class Progress(object): | 44 | class Progress(object): |
45 | def __init__(self, title, total=0, units='', print_newline=False, delay=True): | 45 | def __init__(self, title, total=0, units='', print_newline=False, delay=True, |
46 | quiet=False): | ||
46 | self._title = title | 47 | self._title = title |
47 | self._total = total | 48 | self._total = total |
48 | self._done = 0 | 49 | self._done = 0 |
@@ -54,6 +55,13 @@ class Progress(object): | |||
54 | self._show_jobs = False | 55 | self._show_jobs = False |
55 | self._active = 0 | 56 | self._active = 0 |
56 | 57 | ||
58 | # When quiet, never show any output. It's a bit hacky, but reusing the | ||
59 | # existing logic that delays initial output keeps the rest of the class | ||
60 | # clean. Basically we set the start time to years in the future. | ||
61 | if quiet: | ||
62 | self._show = False | ||
63 | self._start += 2**32 | ||
64 | |||
57 | def start(self, name): | 65 | def start(self, name): |
58 | self._active += 1 | 66 | self._active += 1 |
59 | if not self._show_jobs: | 67 | if not self._show_jobs: |