~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to progress.py

  • Committer: Aaron Bentley
  • Date: 2005-06-14 16:22:39 UTC
  • Revision ID: abentley@panoramicfeedback.com-20050614162239-df8a3bd4abf7489f
Auto-determined percent

Show diffs side-by-side

added added

removed removed

Lines of Context:
23
23
        self.units = units
24
24
        self.current = current
25
25
        self.total = total
26
 
        self.percent = None
27
 
        if self.total is not None:
28
 
            self.percent = 100.0 * current / total
 
26
 
 
27
    def _get_percent(self):
 
28
        if self.total is None:
 
29
            return None
 
30
        return 100.0 * self.current / self.total
 
31
 
 
32
    percent = property(_get_percent)
29
33
 
30
34
    def __str__(self):
31
35
        if self.total is not None: