diff options
author | Lars Wirzenius <liw@liw.fi> | 2015-09-27 13:01:25 +0300 |
---|---|---|
committer | Lars Wirzenius <liw@liw.fi> | 2015-09-27 13:05:31 +0300 |
commit | 7120bb1c3df3e034060ed922b21dd49a13508b84 (patch) | |
tree | a8295c5a24720a382dc82a25bc71dd0e261f877a | |
parent | bf91f20962206f73b4f0587887dcda4bc75efac0 (diff) | |
download | obnam-7120bb1c3df3e034060ed922b21dd49a13508b84.tar.gz |
Use multiline ttystatus when available
-rw-r--r-- | NEWS | 5 | ||||
-rw-r--r-- | obnamlib/backup_progress.py | 21 |
2 files changed, 21 insertions, 5 deletions
@@ -16,6 +16,11 @@ Version 1.18, released UNRELEASED address `[` followed by the port `:1]`, but now it is correctly interpreted as the adddress `::1` and no explicit port. +* Lars Wirzenius added support for a multiline progress message during + backup. Version 0.24 or newer of `ttystatus` is needed for this, but + Obnam will work with an older version by displaying the same + single-line progress message as before. + Version 1.17, released 2015-09-12 --------------------------------- diff --git a/obnamlib/backup_progress.py b/obnamlib/backup_progress.py index e0bb55e6..dabf0b45 100644 --- a/obnamlib/backup_progress.py +++ b/obnamlib/backup_progress.py @@ -34,11 +34,22 @@ class BackupProgress(object): self._ts['current-file'] = '' self._ts['scanned-bytes'] = 0 self._ts['uploaded-bytes'] = 0 - self._ts.format('%ElapsedTime() ' - '%Counter(current-file) ' - 'files ' - '%ByteSize(scanned-bytes) scanned: ' - '%String(what)') + + if hasattr(self._ts, 'start_new_line'): + self._ts.format( + '%ElapsedTime() Backing up: ' + 'found %Counter(current-file) files, ' + '%ByteSize(scanned-bytes); ' + 'uploaded: %ByteSize(uploaded-bytes)\n' + '%String(what)' + ) + else: + self._ts.format( + '%ElapsedTime() ' + '%Counter(current-file) ' + 'files ' + '%ByteSize(scanned-bytes) scanned: ' + '%String(what)') def clear(self): self._ts.clear() |