diff options
author | Lars Wirzenius <liw@liw.fi> | 2017-06-03 17:22:57 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2017-06-03 17:22:57 +0300 |
commit | 57d78a5f4030846bf78829b3f2916f4543e1874f (patch) | |
tree | b026a1886af7f49c8b6566974666f0d4e864f2b9 /ttystatus | |
parent | 7016d5fd00b6c1960a531f796dddf1afdf2aecf0 (diff) | |
download | ttystatus-57d78a5f4030846bf78829b3f2916f4543e1874f.tar.gz |
Add: TerminalStatus.hide method
Diffstat (limited to 'ttystatus')
-rw-r--r-- | ttystatus/status.py | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/ttystatus/status.py b/ttystatus/status.py index 77f0b18..a5c40d1 100644 --- a/ttystatus/status.py +++ b/ttystatus/status.py @@ -118,7 +118,21 @@ class TerminalStatus(object): if self._m.enabled and self._m.time_to_write(): self._write() + def hide(self): # pragma: no cover + '''Hide current progress report. + + Use .flush() to make it visible again. Hiding is useful if you + want to write things to stdout/stderr that might get mixed + with progress output. The .notify() and .error() methods get + disabled if progress reporting gets disabled, but .hide() + doesn't. + + ''' + + self._m.clear() + def flush(self): + '''Force an update of current state to the screen. This happens even if it is not yet time to output the screen. |