~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/progress.py

  • Committer: Robert Collins
  • Date: 2005-09-30 02:54:51 UTC
  • mfrom: (1395)
  • mto: This revision was merged to the branch mainline in revision 1397.
  • Revision ID: robertc@robertcollins.net-20050930025451-47b9e412202be44b
symlink and weaves, whaddya know

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)