/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: Martin Pool
  • Date: 2006-05-12 06:59:47 UTC
  • mfrom: (1706 +trunk)
  • mto: This revision was merged to the branch mainline in revision 1707.
  • Revision ID: mbp@sourcefrog.net-20060512065947-60e259ffea0bf4fb
[merge] bzr.dev

Show diffs side-by-side

added added

removed removed

Lines of Context:
30
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
42
 
        self.stdout = sys.stdout
 
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
43
53
 
44
54
    def prompt(self, prompt):
45
55
        """Emit prompt on the CLI."""