ui factory - what should it do?

Martin Pool mbp at sourcefrog.net
Wed Feb 22 05:03:51 GMT 2006


On 22 Feb 2006, Robert Collins <robertc at robertcollins.net> wrote:
> On Wed, 2006-02-22 at 14:53 +1100, Martin Pool wrote:
> > On Tue, 2006-02-21 at 17:05 -0800, Robey Pointer wrote:
> > 
> > > The code I posted last week used a single pbar object, on which  
> > > callers could push and pop state.  Debouncing is trivial that way.   
> > > We could also use weakref to do an automatic pop when a child pbar is  
> > > collected (though I may be jumping ahead here).
> > 
> > Probably better to just have code use a try/finally block in the scope
> > where the progressbar is created.
> 
> What about progress bars in objects?
> 
> I.e. Fetcher.
> 
> I suppose we need to ensure theres a very clear 'active lifetime' for
> such things so that a finally can be written.

In that particular case it's clearly working for only the duration of
__init__.  (Which is perhaps not an ideal idiom; other job-type classes
have an explicit "do it" method, and perhaps we should standardize
that.)

If we had a class that hung around for a long time, with no clear scope
for when it was acting, and that wanted to keep updating a progress bar,
then I don't think it would fit into a stack setup at all.

-- 
Martin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: Digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060222/1de53af7/attachment.pgp 


More information about the bazaar mailing list