• Ensured progress bar is silent when maximum value is zero.
1 parent 044c096 commit b343995a14c020752fc5b330302b3fb9b6dc6ff0
Nigel Stanger authored on 19 Sep 2016
Showing 2 changed files
View
4
process_podcast.py
globals.log.info("Processing frames...")
frame_segments = [s for s in segments if isinstance(s, FrameSegment)]
n = len(frame_segments)
globals.log.debug("{fn}(): num frames = {n}".format(fn=fn, n=n))
progress = ProgressBar(max_value=n, quiet=args.quiet or args.debug)
progress = ProgressBar(max_value=n,
quiet=args.quiet or args.debug or n == 0)
for i, f in enumerate(frame_segments):
progress.update(i)
globals.log.debug("{fn}(): frame (before) = {b}".format(fn=fn, b=f))
# Frame segments that use a frame from the previous segment.
View
6
progress_bar.py
def finish(self):
"""Complete the progress bar by setting it to its maximum value."""
self.update(value=self.max_value)
print
if not self.quiet:
print
def update(self, value=0):
"""Set the current vaule of the progress bar and redraw it."""
"""Set the current value of the progress bar and redraw it."""
self.set(value)
self.draw()
def draw(self):