diff --git a/README.rst b/README.rst index cce3023..94d65d7 100644 --- a/README.rst +++ b/README.rst @@ -12,13 +12,14 @@ Easy progress reporting for Python Bars ---- -There are 6 progress bars to choose from: +There are 7 progress bars to choose from: - ``Bar`` - ``ChargingBar`` - ``FillingSquaresBar`` - ``FillingCirclesBar`` - ``IncrementalBar`` +- ``PixelBar`` - ``ShadyBar`` To use them, just call ``next`` to advance and ``finish`` to finish: diff --git a/progress/bar.py b/progress/bar.py index 26008e9..5ee968f 100644 --- a/progress/bar.py +++ b/progress/bar.py @@ -80,5 +80,9 @@ class IncrementalBar(Bar): self.writeln(line) +class PixelBar(IncrementalBar): + phases = ('⡀', '⡄', '⡆', '⡇', '⣇', '⣧', '⣷', '⣿') + + class ShadyBar(IncrementalBar): phases = (' ', '░', '▒', '▓', '█') diff --git a/test_progress.py b/test_progress.py index ae7bb19..7d59093 100755 --- a/test_progress.py +++ b/test_progress.py @@ -6,7 +6,8 @@ import random import time from progress.bar import (Bar, ChargingBar, FillingSquaresBar, - FillingCirclesBar, IncrementalBar, ShadyBar) + FillingCirclesBar, IncrementalBar, PixelBar, + ShadyBar) from progress.spinner import Spinner, PieSpinner, MoonSpinner, LineSpinner from progress.counter import Counter, Countdown, Stack, Pie @@ -23,7 +24,7 @@ for bar_cls in (Bar, ChargingBar, FillingSquaresBar, FillingCirclesBar): for i in bar.iter(range(200)): sleep() -for bar_cls in (IncrementalBar, ShadyBar): +for bar_cls in (IncrementalBar, PixelBar, ShadyBar): suffix = '%(percent)d%% [%(elapsed_td)s / %(eta_td)s]' bar = bar_cls(bar_cls.__name__, suffix=suffix) for i in bar.iter(range(200)):