nested progress bars...

Robert Collins robertc at robertcollins.net
Tue Mar 7 09:14:01 GMT 2006


On Tue, 2006-03-07 at 16:38 +1100, Martin Pool wrote:


> > I worry that a stack-based progress bar will wind up getting out of  
> > sync
> > with the program stack.  But I guess requiring it to be returned via
> > pb.finished will probably work, and allow us to warn if we miss a
> > finished() call.
> 
> If you miss a call the progress bar will be gc'd.  (We could use a  
> __del__ method to warn there, but that seems generally considered a  
> bad idea.)  We can detect that the enclosing pb was finalized before  
> its child and implicitly get rid of it or warn.

What I've done is raise an exception on a finished() call when the pb
was not the top of the stack. Works well - it caught bugs when I
converted code over ;).

Rob
-- 
GPG key available at: <http://www.robertcollins.net/keys.txt>.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: This is a digitally signed message part
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060307/7a1790fd/attachment.pgp 


More information about the bazaar mailing list