~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/ui/__init__.py

  • Committer: Martin Pool
  • Date: 2009-01-21 05:30:44 UTC
  • mto: This revision was merged to the branch mainline in revision 3956.
  • Revision ID: mbp@sourcefrog.net-20090121053044-mhynfsubozjh9wol
Corrections to finishing progress bars

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
# Copyright (C) 2005, 2006, 2007, 2008 Canonical Ltd
 
1
# Copyright (C) 2005, 2006, 2007, 2008, 2009 Canonical Ltd
2
2
#
3
3
# This program is free software; you can redistribute it and/or modify
4
4
# it under the terms of the GNU General Public License as published by
83
83
 
84
84
    def progress_finished(self, task):
85
85
        if task != self._task_stack[-1]:
86
 
            warnings.warn("%r is not currently active" % (task,))
 
86
            warnings.warn("%r is not the active task %r" 
 
87
                % (task, self._task_stack[-1]))
87
88
        else:
88
89
            del self._task_stack[-1]
89
90
 
92
93
 
93
94
        This will, for example, clear text progress bars, and leave the
94
95
        cursor at the leftmost position."""
95
 
        raise NotImplementedError(self.clear_term)
 
96
        pass
96
97
 
97
98
    def get_boolean(self, prompt):
98
99
        """Get a boolean question answered from the user. 
173
174
    def prompt(self, prompt):
174
175
        """Emit prompt on the CLI."""
175
176
 
176
 
    def clear_term(self):
177
 
        pass
178
 
 
179
 
    def show_progress(self, task):
180
 
        pass
181
 
 
182
 
    def progress_finished(self, task):
183
 
        pass
184
 
 
185
177
 
186
178
class SilentUIFactory(CLIUIFactory):
187
179
    """A UI Factory which never prints anything.
195
187
    def get_password(self, prompt='', **kwargs):
196
188
        return None
197
189
 
 
190
    def show_progress(self, task):
 
191
        pass
198
192
 
199
193
    def note(self, msg):
200
194
        pass