/b-gtk/fix-viz

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/b-gtk/fix-viz

« back to all changes in this revision

Viewing changes to ui.py

  • Committer: Jelmer Vernooij
  • Date: 2008-07-17 12:46:31 UTC
  • mto: This revision was merged to the branch mainline in revision 551.
  • Revision ID: jelmer@samba.org-20080717124631-3mhq1n7aytf5wc15
Consider 0 a valid value for progress bars.

Show diffs side-by-side

added added

removed removed

Lines of Context:
58
58
        pass
59
59
 
60
60
    def update(self, msg=None, current_cnt=None, total_cnt=None):
61
 
        if current_cnt:
 
61
        if current_cnt is not None:
62
62
            self.current = current_cnt
63
 
        if total_cnt:
 
63
        if total_cnt is not None:
64
64
            self.total = total_cnt
65
65
        if msg is not None:
66
66
            self.set_text(msg)
67
67
        if None not in (self.current, self.total):
68
68
            self.fraction = float(self.current) / self.total
 
69
            if self.fraction < 0.0 or self.fraction > 1.0:
 
70
                raise AssertionError
69
71
            self.set_fraction(self.fraction)
70
72
        while gtk.events_pending():
71
73
            gtk.main_iteration()