Closed jonturneratduke closed 5 years ago
Hey @jonturneratduke!
Actually it does already support situational messages in manual mode, you just have to pass them both in the bar call.
The use in manual mode is: bar(percent, text=None)
, ie the percent is required, the text is optional.
If there's any demand to pass them separately, ie set the text without changing the current percent, I could change it very quickly to support bar(percent=None, text=None)
.
Ah, got it! I guess I should dive into the code and have a look from henceforth.
No need to break the individual parameters out in this case -- adding the named param perc
did the trick: bar(perc=myProgress, text='working...')
I'll slink away and stop being a pest now. :)
No problem at all!
Yeah, this one you would have noticed for sure... It's in here: https://github.com/rsalmei/alive-progress/blob/master/alive_progress/progress.py#L114
Anyway, it seems this requirement might be relaxed for the manual mode. It could improve usability to change the text without changing the percentage... For the other modes it does not make much sense.
But even if both params become optional, if you use them in positional form the first will always be the percentage, so it is good to send them named!
You're welcome! :smile:
trying to add a situational message to the bar in manual mode, with the following code:
I get the following error:
It would be valuable to be able to pass a situational message in manual mode.