1
0
Fork 0
mirror of https://github.com/borgbackup/borg.git synced 2025-01-30 19:21:17 +00:00

Merge pull request #898 from ThomasWaldmann/1.0-maint

reproducible doc for ProgressIndicator*
This commit is contained in:
TW 2016-04-13 16:09:14 +02:00
commit 0a253edcfd

View file

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