using nested ProgressTask
Martin Pool
mbp at sourcefrog.net
Thu Feb 23 06:28:42 UTC 2012
On 22 February 2012 04:04, Michael Gliwinski
<Michael.Gliwinski at henderson-group.com> wrote:
> Hello All,
>
> Not sure what I'm doing wrong but when I create a nested progress bar
> (ProgressTask) like:
>
> ...
> def run(self, ...):
> pb = ui.ui_factory.nested_progress_bar()
> ...
> func(..., pb=pb)
>
> def func(..., pb)
> spb = pb.make_sub_task()
> ...
> spb.finished()
>
> I'm getting a "UserWarning ProgressTask(...) is not in active stack" on that
> call to spb.finished()
>
> AFAICS this is because ProgressTask.make_sub_task does not add the subtask to
> UIFactory's _task_stack.
>
> Is this a bug or am I not using it the way it was intended?
Passing down the 'pb' objects as parameters is deprecated: just call
ui.nested_progress_bar() at each level, then .finished() when you're
done.
(Perhaps not sufficiently obviously deprecated...)
--
Martin
More information about the bazaar
mailing list