~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/progress.py

  • Committer: Martin Pool
  • Date: 2010-01-15 03:44:06 UTC
  • mto: This revision was merged to the branch mainline in revision 5019.
  • Revision ID: mbp@sourcefrog.net-20100115034406-79xikyzboyysiat3
Delete deprecated ProgressBar constructor

Show diffs side-by-side

added added

removed removed

Lines of Context:
184
184
            self.ui_factory.clear_term()
185
185
 
186
186
 
187
 
@deprecated_function(deprecated_in((1, 16, 0)))
188
 
def ProgressBar(to_file=None, **kwargs):
189
 
    """Construct a progress bar.
190
 
 
191
 
    Deprecated; ask the ui_factory for a progress task instead.
192
 
    """
193
 
    if to_file is None:
194
 
        to_file = sys.stderr
195
 
    requested_bar_type = os.environ.get('BZR_PROGRESS_BAR')
196
 
    # An value of '' or not set reverts to standard processing
197
 
    if requested_bar_type in (None, ''):
198
 
        if _supports_progress(to_file):
199
 
            return TTYProgressBar(to_file=to_file, **kwargs)
200
 
        else:
201
 
            return DummyProgress(to_file=to_file, **kwargs)
202
 
    else:
203
 
        # Minor sanitation to prevent spurious errors
204
 
        requested_bar_type = requested_bar_type.lower().strip()
205
 
        # TODO: jam 20060710 Arguably we shouldn't raise an exception
206
 
        #       but should instead just disable progress bars if we
207
 
        #       don't recognize the type
208
 
        if requested_bar_type not in _progress_bar_types:
209
 
            raise errors.InvalidProgressBarType(requested_bar_type,
210
 
                                                _progress_bar_types.keys())
211
 
        return _progress_bar_types[requested_bar_type](to_file=to_file, **kwargs)
212
 
 
213
 
 
214
187
# NOTE: This is also deprecated; you should provide a ProgressView instead.
215
188
class _BaseProgressBar(object):
216
189