diff options
author | Marian Beermann <public@enkore.de> | 2016-08-07 14:24:30 +0200 |
---|---|---|
committer | Marian Beermann <public@enkore.de> | 2016-08-21 01:09:20 +0200 |
commit | 5924915d3579e38a8f8c86b16f427dd32d1f206f (patch) | |
tree | c12dce0ea5fcaf59953a75d6d742ea65e991b737 /src | |
parent | 8709cec57cfe66a915702155d10ad0f213f19854 (diff) |
Flip ProgressIndicatorPercent same_line default to True
Every production use of this uses same_line=True
Diffstat (limited to 'src')
-rw-r--r-- | src/borg/archive.py | 4 | ||||
-rw-r--r-- | src/borg/archiver.py | 2 | ||||
-rw-r--r-- | src/borg/helpers.py | 2 | ||||
-rw-r--r-- | src/borg/repository.py | 4 | ||||
-rw-r--r-- | src/borg/testsuite/helpers.py | 2 | ||||
-rw-r--r-- | src/borg/upgrader.py | 2 |
6 files changed, 8 insertions, 8 deletions
diff --git a/src/borg/archive.py b/src/borg/archive.py index 5a1509706..b17685429 100644 --- a/src/borg/archive.py +++ b/src/borg/archive.py @@ -640,7 +640,7 @@ Number of files: {0.stats.nfiles}'''.format( try: unpacker = msgpack.Unpacker(use_list=False) items_ids = self.metadata.items - pi = ProgressIndicatorPercent(total=len(items_ids), msg="Decrementing references %3.0f%%", same_line=True) + pi = ProgressIndicatorPercent(total=len(items_ids), msg="Decrementing references %3.0f%%") for (i, (items_id, data)) in enumerate(zip(items_ids, self.repository.get_many(items_ids))): if progress: pi.show(i) @@ -1033,7 +1033,7 @@ class ArchiveChecker: logger.info('Starting cryptographic data integrity verification...') count = len(self.chunks) errors = 0 - pi = ProgressIndicatorPercent(total=count, msg="Verifying data %6.2f%%", step=0.01, same_line=True) + pi = ProgressIndicatorPercent(total=count, msg="Verifying data %6.2f%%", step=0.01) for chunk_id, (refcount, *_) in self.chunks.iteritems(): pi.show() try: diff --git a/src/borg/archiver.py b/src/borg/archiver.py index d607940aa..417f055ee 100644 --- a/src/borg/archiver.py +++ b/src/borg/archiver.py @@ -492,7 +492,7 @@ class Archiver: self.print_warning('%s: %s', remove_surrogates(orig_path), e) if not args.dry_run: - pi = ProgressIndicatorPercent(total=len(dirs), msg='Setting directory permissions %3.0f%%', same_line=True) + pi = ProgressIndicatorPercent(total=len(dirs), msg='Setting directory permissions %3.0f%%') while dirs: pi.show() dir_item = dirs.pop(-1) diff --git a/src/borg/helpers.py b/src/borg/helpers.py index c3251881b..72f03ac67 100644 --- a/src/borg/helpers.py +++ b/src/borg/helpers.py @@ -1105,7 +1105,7 @@ def yes(msg=None, false_msg=None, true_msg=None, default_msg=None, class ProgressIndicatorPercent: - def __init__(self, total, step=5, start=0, same_line=False, msg="%3.0f%%"): + def __init__(self, total, step=5, start=0, same_line=True, msg="%3.0f%%"): """ Percentage-based progress indicator diff --git a/src/borg/repository.py b/src/borg/repository.py index 9ae7e36f8..8b5f85db5 100644 --- a/src/borg/repository.py +++ b/src/borg/repository.py @@ -536,7 +536,7 @@ class Repository: self.prepare_txn(index_transaction_id, do_cleanup=False) try: segment_count = sum(1 for _ in self.io.segment_iterator()) - pi = ProgressIndicatorPercent(total=segment_count, msg="Replaying segments %3.0f%%", same_line=True) + pi = ProgressIndicatorPercent(total=segment_count, msg="Replaying segments %3.0f%%") for i, (segment, filename) in enumerate(self.io.segment_iterator()): pi.show(i) if index_transaction_id is not None and segment <= index_transaction_id: @@ -636,7 +636,7 @@ class Repository: segments_transaction_id = self.io.get_segments_transaction_id() self.prepare_txn(None) # self.index, self.compact, self.segments all empty now! segment_count = sum(1 for _ in self.io.segment_iterator()) - pi = ProgressIndicatorPercent(total=segment_count, msg="Checking segments %3.1f%%", step=0.1, same_line=True) + pi = ProgressIndicatorPercent(total=segment_count, msg="Checking segments %3.1f%%", step=0.1) for i, (segment, filename) in enumerate(self.io.segment_iterator()): pi.show(i) if segment > transaction_id: diff --git a/src/borg/testsuite/helpers.py b/src/borg/testsuite/helpers.py index 0f8a853e0..c398ee28f 100644 --- a/src/borg/testsuite/helpers.py +++ b/src/borg/testsuite/helpers.py @@ -887,7 +887,7 @@ def test_progress_percentage_multiline(capfd): def test_progress_percentage_sameline(capfd): - pi = ProgressIndicatorPercent(1000, step=5, start=0, same_line=True, msg="%3.0f%%") + pi = ProgressIndicatorPercent(1000, step=5, start=0, msg="%3.0f%%") pi.show(0) out, err = capfd.readouterr() assert err == ' 0%\r' diff --git a/src/borg/upgrader.py b/src/borg/upgrader.py index 42f9a4696..69712832a 100644 --- a/src/borg/upgrader.py +++ b/src/borg/upgrader.py @@ -77,7 +77,7 @@ class AtticRepositoryUpgrader(Repository): replace the 8 first bytes of all regular files in there.""" logger.info("converting %d segments..." % len(segments)) segment_count = len(segments) - pi = ProgressIndicatorPercent(total=segment_count, msg="Converting segments %3.0f%%", same_line=True) + pi = ProgressIndicatorPercent(total=segment_count, msg="Converting segments %3.0f%%") for i, filename in enumerate(segments): if progress: pi.show(i) |