~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/ui/text.py

  • Committer: Robert Collins
  • Date: 2006-03-28 14:29:13 UTC
  • mto: (1626.2.1 integration)
  • mto: This revision was merged to the branch mainline in revision 1628.
  • Revision ID: robertc@robertcollins.net-20060328142913-ac5afb37075719c6
Convert log to use the new tsort.merge_sort routine.

Show diffs side-by-side

added added

removed removed

Lines of Context:
28
28
 
29
29
 
30
30
class TextUIFactory(UIFactory):
31
 
    """A UI factory for Text user interefaces."""
32
 
 
33
 
    def __init__(self, bar_type=None):
34
 
        """Create a TextUIFactory.
35
 
 
36
 
        :param bar_type: The type of progress bar to create. It defaults to 
37
 
                         letting the bzrlib.progress.ProgressBar factory auto
38
 
                         select.
39
 
        """
40
 
        super(TextUIFactory, self).__init__()
41
 
        self._bar_type = bar_type
42
31
 
43
32
    @deprecated_method(zero_eight)
44
33
    def progress_bar(self):
71
60
        may return a tty or dots bar depending on the terminal.
72
61
        """
73
62
        if self._progress_bar_stack is None:
74
 
            self._progress_bar_stack = bzrlib.progress.ProgressBarStack(
75
 
                klass=self._bar_type)
 
63
            self._progress_bar_stack = bzrlib.progress.ProgressBarStack()
76
64
        return self._progress_bar_stack.get_nested()
77
 
 
78
 
    def clear_term(self):
79
 
        """Prepare the terminal for output.
80
 
 
81
 
        This will, clear any progress bars, and leave the cursor at the
82
 
        leftmost position."""
83
 
        if self._progress_bar_stack is None:
84
 
            return
85
 
        overall_pb = self._progress_bar_stack.bottom()
86
 
        if overall_pb is not None:
87
 
            overall_pb.clear()