diff --git a/progress.py b/progress.py index 290265c6..fe246c74 100644 --- a/progress.py +++ b/progress.py @@ -100,6 +100,7 @@ class Progress: self._show = not delay self._units = units self._elide = elide and _TTY + self._quiet = quiet # Only show the active jobs section if we run more than one in parallel. self._show_jobs = False @@ -114,13 +115,7 @@ class Progress: ) self._update_thread.daemon = True - # When quiet, never show any output. It's a bit hacky, but reusing the - # existing logic that delays initial output keeps the rest of the class - # clean. Basically we set the start time to years in the future. - if quiet: - self._show = False - self._start += 2**32 - elif show_elapsed: + if not quiet and show_elapsed: self._update_thread.start() def _update_loop(self): @@ -160,7 +155,7 @@ class Progress: msg = self._last_msg self._last_msg = msg - if not _TTY or IsTraceToStderr(): + if not _TTY or IsTraceToStderr() or self._quiet: return elapsed_sec = time.time() - self._start @@ -202,7 +197,7 @@ class Progress: def end(self): self._update_event.set() - if not _TTY or IsTraceToStderr() or not self._show: + if not _TTY or IsTraceToStderr() or self._quiet: return duration = duration_str(time.time() - self._start)