random thought of the day - a progress bar for tree transforms ?

John A Meinel john at arbash-meinel.com
Wed Feb 15 01:26:26 GMT 2006


Robey Pointer wrote:
> 
> On 14 Feb 2006, at 8:57, Aaron Bentley wrote:
> 
>> John A Meinel wrote:
>>> I'm thinking that if it is a fixed number of iterations, just do the
>>> progress as 14 steps, and skip ones you don't use.
>>> But it might be nicer to have an idea how many files you are checking,
>>> and iterate over that instead.
>>
>> On the plus side, we all seem to agree that nested progress bars would
>> be nice.  On the minus side, no one's actually done it yet...
> 
> I played with nested progress bars this morning, but didn't like the way
> they looked.  My kinda half-baked idea was that child progress bars
> would just operate a spinner inside the parent, like this:
> 
> [=====/          ] copy  109/8743
> 
> Subdividing the parent would be useless, since in my experience, the
> parent is usually iterating over thousands of items.  But the spinner
> coming and going just looked confusing.  Anyone got better ideas?
> 
> robey

This is the code I wrote for layout. It doesn't include how you actually
set the items, but anyway.

This gives progress bars that look like:

|====    | parent  50% |====== | child  80%

We could add more information like the count, and time till finished,
but there is only so much room on one line.

I initially tried changing the fractions for each bar to not be even, so
that the parent would have more room that the child.

But for my work, I tend to have 5 steps in the parent, and thousands to
millions of steps in the child. (512*512*512 steps). Now, my actual
progress code does some fancy tricks so that it doesn't actually call
the update progress bar code all of the time (keeps a counter and a bit
mask and does if count & mask == 0: call update).
So this code expects everything to be in percent completed, not actual
numbers to be done. But it is pretty easy to fix.

And it comes with test cases. :)

John
=:->


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: test_progress_layout.py
Url: https://lists.ubuntu.com/archives/bazaar/attachments/20060214/0d3cec49/attachment.diff 
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 249 bytes
Desc: OpenPGP digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060214/0d3cec49/attachment.pgp 


More information about the bazaar mailing list