[Pkg-bazaar-commits] ./bzr-gtk/unstable r551: Merge progress bar regression fix.

Jelmer Vernooij jelmer at samba.org
Fri Apr 10 07:50:20 UTC 2009


------------------------------------------------------------
revno: 551
committer: Jelmer Vernooij <jelmer at samba.org>
branch nick: trunk
timestamp: Fri 2008-07-18 14:40:00 +0200
message:
  Merge progress bar regression fix.
modified:
  ui.py
    ------------------------------------------------------------
    revno: 533.10.1
    committer: Jelmer Vernooij <jelmer at samba.org>
    branch nick: progressbars
    timestamp: Thu 2008-07-17 14:46:31 +0200
    message:
      Consider 0 a valid value for progress bars.
    modified:
      ui.py
-------------- next part --------------
=== modified file 'ui.py'
--- a/ui.py	2008-06-30 20:32:25 +0000
+++ b/ui.py	2008-07-17 12:46:31 +0000
@@ -58,14 +58,16 @@
         pass
 
     def update(self, msg=None, current_cnt=None, total_cnt=None):
-        if current_cnt:
+        if current_cnt is not None:
             self.current = current_cnt
-        if total_cnt:
+        if total_cnt is not None:
             self.total = total_cnt
         if msg is not None:
             self.set_text(msg)
         if None not in (self.current, self.total):
             self.fraction = float(self.current) / self.total
+            if self.fraction < 0.0 or self.fraction > 1.0:
+                raise AssertionError
             self.set_fraction(self.fraction)
         while gtk.events_pending():
             gtk.main_iteration()



More information about the Pkg-bazaar-commits mailing list