1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2024-12-23 00:07:38 +00:00

cache sync: change progress output to separate lines

printing without \n plus sys.stdout.flush() didn't work as expected.
This commit is contained in:
Thomas Waldmann 2015-08-09 19:02:35 +02:00
parent 197ca9c0d3
commit 69456e07c4

View file

@ -307,14 +307,13 @@ def create_master_idx(chunk_idx, tf_in, tmp_dir):
for tarinfo in tf_in: for tarinfo in tf_in:
archive_id_hex = tarinfo.name archive_id_hex = tarinfo.name
archive_name = tarinfo.pax_headers['archive_name'] archive_name = tarinfo.pax_headers['archive_name']
print("- processing archive: %s -> extract, " % archive_name, end='') ; sys.stdout.flush() print("- extracting archive %s ..." % archive_name)
tf_in.extract(archive_id_hex, tmp_dir) tf_in.extract(archive_id_hex, tmp_dir)
chunk_idx_path = os.path.join(tmp_dir, archive_id_hex).encode('utf-8') chunk_idx_path = os.path.join(tmp_dir, archive_id_hex).encode('utf-8')
print("read, ", end='') ; sys.stdout.flush() print("- reading archive ...")
archive_chunk_idx = ChunkIndex.read(chunk_idx_path) archive_chunk_idx = ChunkIndex.read(chunk_idx_path)
print("merge, ", end='') ; sys.stdout.flush() print("- merging archive ...")
chunk_idx.merge(archive_chunk_idx) chunk_idx.merge(archive_chunk_idx)
print("done.")
os.unlink(chunk_idx_path) os.unlink(chunk_idx_path)
self.begin_txn() self.begin_txn()