print_colored("Error:\n\n" + gpg.stderr, 'red')
return
+ lastflush = 0
with open('/tmp/SHA256SUM', 'a') as digestfile:
with sftp.open(filename, 'xw', BUFFER) as remotefile:
digest = hashlib.sha256()
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)
+
+ if done - lastflush > 128 * 1024**2:
+ remotefile.flush()
+ lastflush = done
+
digest.update(junk)
junk = gpg.stdout.read(BUFFER)