[MERGE] _generate_text_key_index

Martin Pool mbp at sourcefrog.net
Fri Nov 16 05:05:07 GMT 2007


> It made me think though, what do 'you' think of an @with_progress
> decorator. This would:
>  - create a nested pb.
>  - pass it in as a kw arg to the decorated function
>  - call finished() on it automatically.

... so a bit like what we do with locks.

It does remove a certain amount of repeated code.  On the other hand,
having the parameter magically added somewhat violates "explicit is
better", and with locks it may have encouraged us to add them to more
methods than really need it.  We also needed a little extra work to
make them come up properly in profilers.  On the whole I'd incline
against it for progress bars.

In passing, I'd really like if nested progress bars described the
phase they're in (eg "generating text index") rather than "reconcile
phase 3/6", which is redundant with the overall progress bar.

-- 
Martin



More information about the bazaar mailing list