summaryrefslogtreecommitdiffstats
path: root/progress.py
diff options
context:
space:
mode:
Diffstat (limited to 'progress.py')
-rw-r--r--progress.py13
1 files changed, 4 insertions, 9 deletions
diff --git a/progress.py b/progress.py
index 290265c6..fe246c74 100644
--- a/progress.py
+++ b/progress.py
@@ -100,6 +100,7 @@ class Progress:
100 self._show = not delay 100 self._show = not delay
101 self._units = units 101 self._units = units
102 self._elide = elide and _TTY 102 self._elide = elide and _TTY
103 self._quiet = quiet
103 104
104 # Only show the active jobs section if we run more than one in parallel. 105 # Only show the active jobs section if we run more than one in parallel.
105 self._show_jobs = False 106 self._show_jobs = False
@@ -114,13 +115,7 @@ class Progress:
114 ) 115 )
115 self._update_thread.daemon = True 116 self._update_thread.daemon = True
116 117
117 # When quiet, never show any output. It's a bit hacky, but reusing the 118 if not quiet and show_elapsed:
118 # existing logic that delays initial output keeps the rest of the class
119 # clean. Basically we set the start time to years in the future.
120 if quiet:
121 self._show = False
122 self._start += 2**32
123 elif show_elapsed:
124 self._update_thread.start() 119 self._update_thread.start()
125 120
126 def _update_loop(self): 121 def _update_loop(self):
@@ -160,7 +155,7 @@ class Progress:
160 msg = self._last_msg 155 msg = self._last_msg
161 self._last_msg = msg 156 self._last_msg = msg
162 157
163 if not _TTY or IsTraceToStderr(): 158 if not _TTY or IsTraceToStderr() or self._quiet:
164 return 159 return
165 160
166 elapsed_sec = time.time() - self._start 161 elapsed_sec = time.time() - self._start
@@ -202,7 +197,7 @@ class Progress:
202 197
203 def end(self): 198 def end(self):
204 self._update_event.set() 199 self._update_event.set()
205 if not _TTY or IsTraceToStderr() or not self._show: 200 if not _TTY or IsTraceToStderr() or self._quiet:
206 return 201 return
207 202
208 duration = duration_str(time.time() - self._start) 203 duration = duration_str(time.time() - self._start)