summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2012-12-15 12:23:23 +0000
committerLars Wirzenius <liw@liw.fi>2012-12-15 12:23:23 +0000
commit25839d339795398a535a3d33df0aebfb3145784a (patch)
treef500666bed4f7b75f58785a6938d28412dea13a0
parentde2723fce386317644890ae2c6c6323884ae26ba (diff)
downloadobnam-25839d339795398a535a3d33df0aebfb3145784a.tar.gz
Update progress reporting during file backup
This makes the progress report, especially the elapsed time, update even when backing up a large file that has had very few changes.
-rw-r--r--obnamlib/plugins/backup_plugin.py4
1 files changed, 4 insertions, 0 deletions
diff --git a/obnamlib/plugins/backup_plugin.py b/obnamlib/plugins/backup_plugin.py
index ec9b7035..479df272 100644
--- a/obnamlib/plugins/backup_plugin.py
+++ b/obnamlib/plugins/backup_plugin.py
@@ -137,6 +137,9 @@ class BackupPlugin(obnamlib.ObnamPlugin):
self.app.ts['what'] = what_what
self.app.ts.flush()
+ def update_progress(self):
+ self.app.ts['not-shown'] = 'not shown'
+
def configure_ttystatus_for_checkpoint_removal(self):
self.what('removing checkpoints')
@@ -613,6 +616,7 @@ class BackupPlugin(obnamlib.ObnamPlugin):
chunkids = []
while True:
tracing.trace('reading some data')
+ self.update_progress()
data = f.read(chunk_size)
if not data:
tracing.trace('end of data')