/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to bzrlib/ui/text.py

  • Committer: Robert Collins
  • Date: 2006-03-03 02:09:49 UTC
  • mto: (1594.2.4 integration)
  • mto: This revision was merged to the branch mainline in revision 1596.
  • Revision ID: robertc@robertcollins.net-20060303020949-0ddc6f33d0a43943
Smoke test for RevisionStore factories creating revision stores.

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
import sys
24
24
 
25
25
import bzrlib.progress
26
 
from bzrlib.symbol_versioning import *
27
26
from bzrlib.ui import UIFactory
28
27
 
29
28
 
30
29
class TextUIFactory(UIFactory):
31
 
 
32
 
    @deprecated_method(zero_eight)
33
30
    def progress_bar(self):
34
 
        """See UIFactory.nested_progress_bar()."""
 
31
 
35
32
        # this in turn is abstract, and creates either a tty or dots
36
33
        # bar depending on what we think of the terminal
37
34
        return bzrlib.progress.ProgressBar()
53
50
        except KeyboardInterrupt:
54
51
            return None
55
52
 
56
 
    def nested_progress_bar(self):
57
 
        """Return a nested progress bar.
58
 
        
59
 
        The actual bar type returned depends on the progress module which
60
 
        may return a tty or dots bar depending on the terminal.
61
 
        """
62
 
        if self._progress_bar_stack is None:
63
 
            self._progress_bar_stack = bzrlib.progress.ProgressBarStack()
64
 
        return self._progress_bar_stack.get_nested()
65
 
 
66
 
    def clear_term(self):
67
 
        """Prepare the terminal for output.
68
 
 
69
 
        This will, clear any progress bars, and leave the cursor at the
70
 
        leftmost position."""
71
 
        if self._progress_bar_stack is None:
72
 
            return
73
 
        overall_pb = self._progress_bar_stack.bottom()
74
 
        if overall_pb is not None:
75
 
            overall_pb.clear()