~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/ui/__init__.py

Fixup pb usage to use nested_progress_bar.

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
    layer different applications can choose the style of UI.
41
41
    """
42
42
 
 
43
    def __init__(self):
 
44
        super(UIFactory, self).__init__()
 
45
        self._progress_bar_stack = None
 
46
 
43
47
    @deprecated_method(zero_eight)
44
48
    def progress_bar(self):
45
49
        """See UIFactory.nested_progress_bar()."""
81
85
        return None
82
86
 
83
87
    def nested_progress_bar(self):
84
 
        return bzrlib.progress.DummyProgress()
 
88
        if self._progress_bar_stack is None:
 
89
            self._progress_bar_stack = bzrlib.progress.ProgressBarStack(
 
90
                klass=bzrlib.progress.DummyProgress)
 
91
        return self._progress_bar_stack.get_nested()
85
92
 
86
93
 
87
94
ui_factory = SilentUIFactory()