1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2024-12-25 09:19:31 +00:00

reproducible doc for ProgressIndicator*

building the API docs captured sys.stderr's IO charset, making the build
unreproducible.
This commit is contained in:
Danny Edel 2016-03-14 09:44:24 +01:00 committed by Thomas Waldmann
parent c2f95332e5
commit 60ca65a438

View file

@ -974,7 +974,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%%", file=sys.stderr):
def __init__(self, total, step=5, start=0, same_line=False, msg="%3.0f%%", file=None):
"""
Percentage-based progress indicator
@ -989,6 +989,8 @@ def __init__(self, total, step=5, start=0, same_line=False, msg="%3.0f%%", file=
self.total = total
self.trigger_at = start # output next percentage value when reaching (at least) this
self.step = step
if file is None:
file = sys.stderr
self.file = file
self.msg = msg
self.same_line = same_line
@ -1016,7 +1018,7 @@ def finish(self):
class ProgressIndicatorEndless:
def __init__(self, step=10, file=sys.stderr):
def __init__(self, step=10, file=None):
"""
Progress indicator (long row of dots)
@ -1026,6 +1028,8 @@ def __init__(self, step=10, file=sys.stderr):
self.counter = 0 # call counter
self.triggered = 0 # increases 1 per trigger event
self.step = step # trigger every <step> calls
if file is None:
file = sys.stderr
self.file = file
def progress(self):