summaryrefslogtreecommitdiffstats
path: root/progress.py
diff options
context:
space:
mode:
Diffstat (limited to 'progress.py')
-rw-r--r--progress.py15
1 files changed, 15 insertions, 0 deletions
diff --git a/progress.py b/progress.py
index fe246c74..a386f426 100644
--- a/progress.py
+++ b/progress.py
@@ -195,6 +195,21 @@ class Progress:
195 ) 195 )
196 ) 196 )
197 197
198 def display_message(self, msg):
199 """Clears the current progress line and prints a message above it.
200
201 The progress bar is then redrawn on the next line.
202 """
203 if not _TTY or IsTraceToStderr() or self._quiet:
204 return
205
206 # Erase the current line, print the message with a newline,
207 # and then immediately redraw the progress bar on the new line.
208 sys.stderr.write("\r" + CSI_ERASE_LINE)
209 sys.stderr.write(msg + "\n")
210 sys.stderr.flush()
211 self.update(inc=0)
212
198 def end(self): 213 def end(self):
199 self._update_event.set() 214 self._update_event.set()
200 if not _TTY or IsTraceToStderr() or self._quiet: 215 if not _TTY or IsTraceToStderr() or self._quiet: