]> git.siccegge.de Git - tools.git/commitdiff
Only print data rate after second junk (it's not reliable before)
authorChristoph Egger <christoph@christoph-egger.org>
Mon, 5 Jan 2015 17:55:30 +0000 (18:55 +0100)
committerChristoph Egger <christoph@christoph-egger.org>
Mon, 5 Jan 2015 17:59:51 +0000 (18:59 +0100)
backup-zfs

index c060712c3f1bcbe284ecad49128efcf20dfc7169..9d52e0635cf82b37fa3f9a28f5142a4ebbf59e8a 100755 (executable)
@@ -121,8 +121,9 @@ def sftp_send(dataset, reference=None):
                 done = done + len(junk)
 #                sys.stdout.write('#')
 #                sys.stdout.flush()
-                sys.stdout.write("\r%s %.3f GB      (%.3f MB/s)          " % (term['green'], (1.0 * done) / (1024 ** 3), (done / (1024 ** 2 *(time.time() - startt)))))
-                sys.stdout.flush()
+                if done != len(junk):
+                    sys.stdout.write("     \r%s %.3f GB      (%.3f MB/s)" % (term['green'], (1.0 * done) / (1024 ** 3), (done / (1024 ** 2 *(time.time() - startt)))))
+                    sys.stdout.flush()
                 remotefile.write(junk)
                 digest.update(junk)
                 junk = gpg.stdout.read(BUFFER)