[Pkg-privacy-commits] [torbrowser-launcher] 62/476: forced refresh during each update of the progress bar when downloading

Ximin Luo infinity0 at moszumanska.debian.org
Sat Aug 22 13:21:23 UTC 2015


This is an automated email from the git hooks/post-receive script.

infinity0 pushed a commit to branch debian
in repository torbrowser-launcher.

commit b709cbbb33200f3916d6a8e5304c3850a50cbbb9
Author: Micah Lee <micahflee at riseup.net>
Date:   Tue Feb 19 23:09:57 2013 -0800

    forced refresh during each update of the progress bar when downloading
---
 torbrowser-launcher | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/torbrowser-launcher b/torbrowser-launcher
index a178be6..c8372f9 100755
--- a/torbrowser-launcher
+++ b/torbrowser-launcher
@@ -248,6 +248,7 @@ class TorBrowserLauncher:
     self.progressbar.set_fraction(0) 
     self.progressbar.set_text('Downloading '+name)
     self.progressbar.show()
+    self.refresh_gtk()
 
     # start the download
     self.dl_response = urllib2.urlopen(url)
@@ -277,6 +278,7 @@ class TorBrowserLauncher:
     self.progressbar.set_fraction(percent)
     percent = round(percent*100, 2)
     self.progressbar.set_text("Downloaded %d%% of %s" % (percent, name))
+    self.refresh_gtk()
     
     sys.stdout.write("Downloaded %d of %d bytes (%0.2f%%)\r" % (self.dl_bytes_so_far, self.dl_total_size, percent))
 
@@ -326,9 +328,7 @@ class TorBrowserLauncher:
     while p.poll() == None:
       time.sleep(0.01)
       self.progressbar.pulse()
-      # redraw gtk
-      while gtk.events_pending():
-         gtk.main_iteration(False)
+      self.refresh_gtk()
 
   # start over and download TBB again
   def start_over(self):
@@ -337,6 +337,11 @@ class TorBrowserLauncher:
     self.gui_task_i = 0
     self.start(None)
   
+  # refresh gtk
+  def refresh_gtk(self):
+    while gtk.events_pending():
+       gtk.main_iteration(False)
+
   # exit
   def delete_event(self, widget, event, data=None):
     return False

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/torbrowser-launcher.git



More information about the Pkg-privacy-commits mailing list