[Pkg-privacy-commits] [torbrowser-launcher] 221/476: Made pygame and modem sound optiomal, the option is simply disabled if you do not have pygame installed, and it is no longer a dependecy or a suggested package.

Ximin Luo infinity0 at moszumanska.debian.org
Sat Aug 22 13:21:39 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 486458f04196c9c5ac33f6ba66637b0c1f4ee81a
Author: TBBLER <e47gykt+3rm290 at sharklasers.com>
Date:   Thu Jun 26 15:50:42 2014 +0000

    Made pygame and modem sound optiomal, the option is simply disabled if you do not have pygame installed, and it is no longer a dependecy or a suggested package.
---
 README.md           |  8 ++++++--
 stdeb.cfg           |  2 +-
 torbrowser-launcher | 30 ++++++++++++++++++++++--------
 3 files changed, 29 insertions(+), 11 deletions(-)

diff --git a/README.md b/README.md
index cb0adf8..e77f2b0 100644
--- a/README.md
+++ b/README.md
@@ -20,16 +20,20 @@ Then install dependencies, build a package, and install:
 
 ### Debian, Ubuntu, Linux Mint, etc.
 
-    sudo apt-get install build-essential python-all python-stdeb python-gtk2 python-psutil python-twisted python-pygame python-lzma wmctrl gnupg fakeroot
+    sudo apt-get install build-essential python-all python-stdeb python-gtk2 python-psutil python-twisted python-lzma wmctrl gnupg fakeroot
     ./build_deb.sh
     sudo dpkg -i deb_dist/torbrowser-launcher_*.deb
 
+Optionally you can install python-pygame if you want to play a modem sound while Tor Browser is launching.
+
 ### Red Hat, Fedora, CentOS, etc.
 
-    sudo yum install python-psutil python-twisted pygame wmctrl gnupg fakeroot
+    sudo yum install python-psutil python-twisted wmctrl gnupg fakeroot
     ./build_rpm.sh
     sudo yum install dist/torbrowser-launcher-*.rpm
 
+Optionally you can install pygame if you want to play a modem sound while Tor Browser is launching.
+
 ## Installing in Ubuntu
 
 I've created a PPA where I'm maintaining torbrowser-launcher binaries. You can install in an Ubuntu-based distribution like this:
diff --git a/stdeb.cfg b/stdeb.cfg
index 646e9bf..9e34d6d 100644
--- a/stdeb.cfg
+++ b/stdeb.cfg
@@ -1,4 +1,4 @@
 [DEFAULT]
 Package: torbrowser-launcher
-Depends: python-gtk2, python-psutil, python-twisted, python-lzma, python-pygame, gnupg, wmctrl
+Depends: python-gtk2, python-psutil, python-twisted, python-lzma, gnupg, wmctrl
 Suite: trusty
diff --git a/torbrowser-launcher b/torbrowser-launcher
index 893eb90..8f243e8 100755
--- a/torbrowser-launcher
+++ b/torbrowser-launcher
@@ -415,10 +415,17 @@ class TBLSettings:
         # modem sound
         self.modem_checkbox = gtk.CheckButton(_("Play modem sound, because Tor is slow :]"))
         self.settings_box.pack_start(self.modem_checkbox, True, True, 0)
-        if self.common.settings['modem_sound']:
-            self.modem_checkbox.set_active(True)
-        else:
+
+        try:
+            import pygame
+            if self.common.settings['modem_sound']:
+                self.modem_checkbox.set_active(True)
+            else:
+                self.modem_checkbox.set_active(False)
+        except ImportError:
             self.modem_checkbox.set_active(False)
+            self.modem_checkbox.set_sensitive(False)
+            self.modem_checkbox.set_tooltip_text(_("This option requires python-pygame to be installed"))
         self.modem_checkbox.show()
 
         # labels
@@ -1067,11 +1074,18 @@ class TBLLauncher:
 
         # play modem sound?
         if self.common.settings['modem_sound']:
-            import pygame
-            pygame.mixer.init()
-            sound = pygame.mixer.Sound(self.common.paths['modem_sound'])
-            sound.play()
-            time.sleep(10)
+            try:
+                import pygame
+                pygame.mixer.init()
+                sound = pygame.mixer.Sound(self.common.paths['modem_sound'])
+                sound.play()
+                time.sleep(10)
+            except ImportError:
+                md = gtk.MessageDialog(None, gtk.DIALOG_DESTROY_WITH_PARENT, gtk.MESSAGE_WARNING, gtk.BUTTONS_CLOSE, _("The python-pygame package is missing, the modem sound is unavailable."))
+                md.set_position(gtk.WIN_POS_CENTER)
+                md.run()
+                md.destroy()
+
 
         if run_next_task:
             self.run_task()

-- 
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