126
126
raise NotImplementedError(self.get_password)
128
def make_output_stream(self, encoding=None, encoding_type=None):
129
"""Get a stream for sending out bulk text data.
131
This is used for commands that produce bulk text, such as log or diff
132
output, as opposed to user interaction. This should work even for
133
non-interactive user interfaces. Typically this goes to a decorated
134
version of stdout, but in a GUI it might be appropriate to send it to a
135
window displaying the text.
137
:param encoding: Unicode encoding for output; default is the
138
terminal encoding, which may be different from the user encoding.
139
(See get_terminal_encoding.)
141
:param encoding_type: How to handle encoding errors:
142
replace/strict/escape/exact. Default is replace.
144
# XXX: is the caller supposed to close the resulting object?
146
encoding = osutils.get_terminal_encoding()
147
if encoding_type is None:
148
encoding_type = 'replace'
149
out_stream = self._make_output_stream_explicit(encoding, encoding_type)
152
def _make_output_stream_explicit(self, encoding, encoding_type):
153
raise NotImplementedError("%s doesn't support make_output_stream"
154
% (self.__class__.__name__))
128
156
def nested_progress_bar(self):
129
157
"""Return a nested progress bar.