-
-
Notifications
You must be signed in to change notification settings - Fork 211
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 progress bar #34
Comments
Hello @FredBrockstedt The problem is because you are using two characters for a "blank", it should be a single char. But it is a nice idea nevertheless! I liked it. It will maybe take a little while, because I'm in the middle of a big refactor in the whole |
Just as you reply... here is the solution, after thinking about it some time. |
And this can be done even simpler by: |
Actually I just did `padding[len(fill):]` and it works.
It discards the first characters, where the bar will appear, you do not need to get the last chars.
And it also need a small fix in the padding and blanks generation, as it will gen a way bigger than needed string.
|
That is very elegant. I don't think it will get better than this. |
You're welcome man! I didn't get Arch Linux joke 🤔 |
Pacman is the official package manager for Arch Linux (similar to pip for python). Pacman has a easter egg, where the progress bar mimics pacman.
There is also a joke, that you find out that someone uses Arch Linux, because they will tell you ;)
… On 1. May 2020, at 17:36, Rogério Sampaio de Almeida ***@***.***> wrote:
You're welcome man!
Thank you for the idea! I'll let you know when it is available.
I didn't get Arch Linux joke 🤔
I use macOS 😉
—
You are receiving this because you modified the open/close state.
Reply to this email directly, view it on GitHub <#34 (comment)>, or unsubscribe <https://github.com/notifications/unsubscribe-auth/AA2DDPXURVLX5QJ2S2OLQM3RPLUA5ANCNFSM4MXCL4WQ>.
|
Ohhh right, I see! lol |
Hey @FredBrockstedt , I'm releasing the "Pacman" support at this moment! |
Done. Care to test it again? |
Outstanding work. There is a little bug. math.ceil returns a float and that can't be used to repeat a string. The first part is a little surprising, atleast to me. I send you a pull request with the little fix and the progress bar and a demo file, if you like to try for yourself. |
Thanks man. That's odd, I did test it, thoroughly. It is working. |
|
My bad, I must have run it in python 2 without realizing. I checked the documentation and python 3 will return an integer as expected. In python 2 ceil returns a float, because an int might overflow. Funny thing, with the cast to int, it runs perfectly in 2.7, maybe that is the reason I didn't notice? |
Yeah, I do support python 2, it should really work. I'll drop python 2 support only in the next major version, 2.0, which is in the works. |
I fail to make a pacman style progress bar with:
pacman = standard_bar_factory(borders="[]", tip=None, chars="Cc-", blank=" o")
It works sort of, but the dots move "away" from the "pacman".
Example:
ideally the dots would stay in place, like this:
The problem arises from how the padding (right part of the progress bar) is handled in bars.py.
My idea would be using some module tricks to scroll the padding. There is probably a better way.
The text was updated successfully, but these errors were encountered: