~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/progress.py

  • Committer: Aaron Bentley
  • Date: 2005-09-29 21:07:17 UTC
  • mfrom: (1393.1.6)
  • mto: (1185.25.1)
  • mto: This revision was merged to the branch mainline in revision 1419.
  • Revision ID: abentley@panoramicfeedback.com-20050929210717-cd73981590f17017
Merged the weave changes

Show diffs side-by-side

added added

removed removed

Lines of Context:
191
191
    def update(self, msg, current_cnt=None, total_cnt=None):
192
192
        """Update and redraw progress bar."""
193
193
 
 
194
        if current_cnt < 0:
 
195
            current_cnt = 0
 
196
            
 
197
        if current_cnt > total_cnt:
 
198
            total_cnt = current_cnt
 
199
 
194
200
        # save these for the tick() function
195
201
        self.last_msg = msg
196
202
        self.last_cnt = current_cnt
199
205
        if self.throttle():
200
206
            return 
201
207
        
202
 
        if total_cnt:
203
 
            assert current_cnt <= total_cnt
204
 
        if current_cnt:
205
 
            assert current_cnt >= 0
206
 
        
207
208
        if self.show_eta and self.start_time and total_cnt:
208
209
            eta = get_eta(self.start_time, current_cnt, total_cnt)
209
210
            eta_str = " " + str_tdelta(eta)