Rev 551: Merge progress bar regression fix. in file:///data/jelmer/bzr-gtk/trunk/

Jelmer Vernooij jelmer at samba.org
Fri Jul 18 13:40:02 BST 2008


At file:///data/jelmer/bzr-gtk/trunk/

------------------------------------------------------------
revno: 551
revision-id: jelmer at samba.org-20080718124000-wlz62eeu7z3hjer0
parent: jelmer at samba.org-20080718123756-f3xq9fj20mcuk311
parent: jelmer at samba.org-20080717124631-3mhq1n7aytf5wc15
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                          ui.py-20060716163355-owuqwa9uhnlfsojs-1
    ------------------------------------------------------------
    revno: 533.10.1
    revision-id: jelmer at samba.org-20080717124631-3mhq1n7aytf5wc15
    parent: jelmer at samba.org-20080717115103-djh5sb0pvpse2zkb
    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                          ui.py-20060716163355-owuqwa9uhnlfsojs-1
=== 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 bazaar-commits mailing list