~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/ui/text.py

Update test support, and remove deprecated functions pullable_revisions and get_intervening_revisions.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
 
25
25
import bzrlib.progress
26
26
from bzrlib.symbol_versioning import *
27
 
from bzrlib.ui import UIFactory
28
 
 
29
 
 
30
 
class TextUIFactory(UIFactory):
 
27
from bzrlib.ui import CLIUIFactory
 
28
 
 
29
 
 
30
class TextUIFactory(CLIUIFactory):
31
31
    """A UI factory for Text user interefaces."""
32
32
 
33
 
    def __init__(self, bar_type=None):
 
33
    def __init__(self,
 
34
                 bar_type=None,
 
35
                 stdout=None,
 
36
                 stderr=None):
34
37
        """Create a TextUIFactory.
35
38
 
36
39
        :param bar_type: The type of progress bar to create. It defaults to 
39
42
        """
40
43
        super(TextUIFactory, self).__init__()
41
44
        self._bar_type = bar_type
 
45
        if stdout is None:
 
46
            self.stdout = sys.stdout
 
47
        else:
 
48
            self.stdout = stdout
 
49
        if stderr is None:
 
50
            self.stderr = sys.stderr
 
51
        else:
 
52
            self.stderr = stderr
42
53
 
 
54
    def prompt(self, prompt):
 
55
        """Emit prompt on the CLI."""
 
56
        self.stdout.write(prompt + "? [y/n]:")
 
57
        
43
58
    @deprecated_method(zero_eight)
44
59
    def progress_bar(self):
45
60
        """See UIFactory.nested_progress_bar()."""