rsalmei/alive-progress

Specifying the `unit` argument displays unit without a space within the bar

takanuva15 opened this issue · 2 comments

There seems to be no space before the unit when I customize the unit in the progress bar, so the unit output gets scrunched-up like which looks unpleasant. Am I missing something?

with alive_progress.alive_bar(unit="batches") as bar:
    time.sleep(2)
    bar()

Output:
|████████████████████████████████████████| 1batches in 2.1s (0.48batches/s)
^(note there is no space between the number 1 and the custom unit "batches")

Yes, because I have to clean unit and other fields in order to remove newlines and other control chars.
In this process, I've also trimmed it to remove spaces so one could always have clean 4MB or 82it, etc.
But it wasn't really needed, so I've just released a new version that does support spaces.
Just update alive-progress 👍

Dang, I was not expecting a fix that blazing fast. Kudos to you sir!

(For anyone who comes across this later, just specify the unit as unit=" batches" to show a space before the unit)