~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/ui/__init__.py

remove all trailing whitespace from bzr source

Show diffs side-by-side

added added

removed removed

Lines of Context:
95
95
        raise NotImplementedError(self.clear_term)
96
96
 
97
97
    def get_boolean(self, prompt):
98
 
        """Get a boolean question answered from the user. 
 
98
        """Get a boolean question answered from the user.
99
99
 
100
100
        :param prompt: a message to prompt the user with. Should be a single
101
101
        line without terminating \n.
118
118
 
119
119
    def report_transport_activity(self, transport, byte_count, direction):
120
120
        """Called by transports as they do IO.
121
 
        
 
121
 
122
122
        This may update a progress bar, spinner, or similar display.
123
123
        By default it does nothing.
124
124
        """
128
128
 
129
129
class CLIUIFactory(UIFactory):
130
130
    """Common behaviour for command line UI factories.
131
 
    
 
131
 
132
132
    This is suitable for dumb terminals that can't repaint existing text."""
133
133
 
134
134
    def __init__(self, stdin=None, stdout=None, stderr=None):
161
161
        :param kwargs: Arguments which will be expanded into the prompt.
162
162
                       This lets front ends display different things if
163
163
                       they so choose.
164
 
        :return: The password string, return None if the user 
 
164
        :return: The password string, return None if the user
165
165
                 canceled the request.
166
166
        """
167
167
        prompt += ': '
207
207
 
208
208
 
209
209
ui_factory = SilentUIFactory()
210
 
"""IMPORTANT: never import this symbol directly. ONLY ever access it as 
 
210
"""IMPORTANT: never import this symbol directly. ONLY ever access it as
211
211
ui.ui_factory."""
212
212
 
213
213
 
214
214
def make_ui_for_terminal(stdin, stdout, stderr):
215
215
    """Construct and return a suitable UIFactory for a text mode program.
216
216
 
217
 
    If stdout is a smart terminal, this gets a smart UIFactory with 
 
217
    If stdout is a smart terminal, this gets a smart UIFactory with
218
218
    progress indicators, etc.  If it's a dumb terminal, just plain text output.
219
219
    """
220
220
    isatty = getattr(stdin, 'isatty', None)