Add callable support for bar_format argument#181
Conversation
Current coverage is 85.30% (diff: 66.66%)@@ master #181 diff @@
==========================================
Files 7 8 +1
Lines 477 524 +47
Methods 0 0
Messages 0 0
Branches 85 97 +12
==========================================
+ Hits 432 447 +15
- Misses 44 77 +33
+ Partials 1 0 -1
|
|
ah, nice... an update callback wrapped by another update callback. |
|
Ah you're right, I didn't give it enough thought, this code probably I think it would be better to just provide a special value to format_meter The idea is to avoid forcing the user to recode the rate, remaining and 2016-06-08 19:36 GMT+02:00 Casper da Costa-Luis [email protected]:
|
|
I think it might make sense for a call to from tqdm import tqdm
def callback_gen(t, ...):
def inner(...):
params = t.update(dict=true)
if params:
# use params
return inner
callback = callback_gen(tqdm(total=len(iter)))
for x in iter:
callback()I'd estimate this would add a 50% overhead on average |
|
This should be reworked on to also provide the separate values when Summary todo:
|
Signed-off-by: Stephen L. <[email protected]>
… for total=None Signed-off-by: Stephen L. <[email protected]>
cdf0e45 to
5f40415
Compare
|
Closing this, this should be merged with #223 as it uses |
|
Note that #223 contains bugfixes compared to the version in here, this is the reason I close this PR. |
The main goal is to allow the parent application to manage the progress bar display itself. For example, if an application with a GUI (such as moviepy?) wants to use
tqdmon both its console and GUI displays without having to make a dedicated module (that won't be reusable for any other module but theirs). This is way easier than subclassingtqdmand should be pretty much as fast performance-wise.Todo: