Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

pacman style progressbar #37

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion alive_progress/animations/bars.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ def draw_bar(percent, end=False):
return draw_bar.left_border + bar + (draw_bar.right_border if right else '')

virtual_length = length * len(chars)
padding = background * math.ceil((length - len(tip)) / len(background))
padding = background * int(math.ceil((length - len(tip)) / len(background)))
blanks = ' ' * (length - len(tip))

draw_bar.left_border, draw_bar.right_border = borders
Expand Down
3 changes: 2 additions & 1 deletion alive_progress/styles/internal.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,11 @@ def __create_bars():
solid = standard_bar_factory(chars='■', borders='<>', tip='►', errors='⚠✗')
checks = standard_bar_factory(chars='✓', tip='', errors='⚠✗')
filling = standard_bar_factory(chars='▁▂▃▄▅▆▇█', tip=None, errors='⚠✗')
pacman = standard_bar_factory(chars='Cc-', background=" o", borders="[]", tip=None, errors='⚠✗')

result = {k: v for k, v in locals().items() if not k.startswith('_')}
desired_order = 'classic classic2 smooth blocks bubbles circles hollow squares solid checks ' \
'filling'.split()
'filling pacman'.split()
return _wrap_ordered(result, desired_order)


Expand Down
4 changes: 4 additions & 0 deletions demo.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from alive_progress import alive_bar, showtime, show_bars

# it's showtime baby!
show_bars()