summaryrefslogtreecommitdiff
path: root/obnamlib/backup_progress.py
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2015-09-27 13:01:25 +0300
committerLars Wirzenius <liw@liw.fi>2015-09-27 13:05:31 +0300
commit7120bb1c3df3e034060ed922b21dd49a13508b84 (patch)
treea8295c5a24720a382dc82a25bc71dd0e261f877a /obnamlib/backup_progress.py
parentbf91f20962206f73b4f0587887dcda4bc75efac0 (diff)
downloadobnam-7120bb1c3df3e034060ed922b21dd49a13508b84.tar.gz
Use multiline ttystatus when available
Diffstat (limited to 'obnamlib/backup_progress.py')
-rw-r--r--obnamlib/backup_progress.py21
1 files changed, 16 insertions, 5 deletions
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()