[Python-apps-commits] r464 - in packages/lightyears/trunk/debian (3 files)

rainct-guest at users.alioth.debian.org rainct-guest at users.alioth.debian.org
Sun Dec 30 12:15:45 UTC 2007


    Date: Sunday, December 30, 2007 @ 12:15:44
  Author: rainct-guest
Revision: 464

add patches/work_with_no_sound.patch, closes #458286

Added:
  packages/lightyears/trunk/debian/patches/work_with_no_sound.patch
Modified:
  packages/lightyears/trunk/debian/changelog
  packages/lightyears/trunk/debian/patches/remove_startup_checks.patch

Modified: packages/lightyears/trunk/debian/changelog
===================================================================
--- packages/lightyears/trunk/debian/changelog	2007-12-29 14:57:22 UTC (rev 463)
+++ packages/lightyears/trunk/debian/changelog	2007-12-30 12:15:44 UTC (rev 464)
@@ -1,3 +1,11 @@
+lightyears (1.3a-2) hardy; urgency=low
+
+  * patches/work_with_no_sound.patch:
+     - make lightyears work on computers with no available
+       audio device (Closes: #458286)
+
+ -- Siegfried-Angel Gevatter Pujals (RainCT) <rainct at ubuntu.com>  Sun, 30 Dec 2007 12:28:14 +0100
+
 lightyears (1.3a-1) unstable; urgency=low
 
   * Initial release (Closes: #451421) (LP: #162635)
@@ -18,4 +26,5 @@
   * patches/remove_startup_checks.patch:
      - remove unnecessary versions checks from startup (that's what
        dpkg is for)
+
  -- Siegfried-Angel Gevatter Pujals (RainCT) <sgevatter at ubuntu.cat>  Sat, 17 Nov 2007 19:06:43 +0100

Modified: packages/lightyears/trunk/debian/patches/remove_startup_checks.patch
===================================================================
--- packages/lightyears/trunk/debian/patches/remove_startup_checks.patch	2007-12-29 14:57:22 UTC (rev 463)
+++ packages/lightyears/trunk/debian/patches/remove_startup_checks.patch	2007-12-30 12:15:44 UTC (rev 464)
@@ -87,7 +87,7 @@
 +        import psyco
 +        psyco.profile()
 +    except Exception, r:
-+        print 'Note: If the game runs too slow you can try installing package «python-psyco».'
++        print 'Note: If the game runs too slow you can try installing package "python-psyco".'
 +    
      import main
 -

Added: packages/lightyears/trunk/debian/patches/work_with_no_sound.patch
===================================================================
--- packages/lightyears/trunk/debian/patches/work_with_no_sound.patch	                        (rev 0)
+++ packages/lightyears/trunk/debian/patches/work_with_no_sound.patch	2007-12-30 12:15:44 UTC (rev 464)
@@ -0,0 +1,32 @@
+diff -Nur lightyears-1.3a/code/main.py lightyears-1.3a.new/code/main.py
+--- lightyears-1.3a/code/main.py	2007-12-30 12:34:40.000000000 +0100
++++ lightyears-1.3a.new/code/main.py	2007-12-30 13:04:07.000000000 +0100
+@@ -35,8 +35,13 @@
+     bufsize = 2048
+ 
+     no_sound = ( "--no-sound" in sys.argv )
+-    if ( not no_sound ):
+-        pygame.mixer.pre_init(22050,-16,2,bufsize)
++    if not no_sound:
++        try:
++            pygame.mixer.pre_init(22050, -16, 2, bufsize)
++            pygame.mixer.init()
++        except pygame.error, message:
++            print 'Sound initialization failed. %s' % message
++            no_sound = True
+ 
+     pygame.init()
+     pygame.font.init()
+
+diff -Nur lightyears-1.3a/code/resource.py lightyears-1.3a.new/code/resource.py
+--- lightyears-1.3a/code/resource.py	2007-12-30 12:34:40.000000000 +0100
++++ lightyears-1.3a.new/code/resource.py	2007-12-30 12:34:42.000000000 +0100
+@@ -14,6 +14,9 @@
+ __snd_cache = dict()
+ __snd_disabled = False
+ 
++if not pygame.mixer or not pygame.mixer.get_init():
++	__snd__disabled = True
++
+ DATA_DIR = os.path.abspath(os.path.join(
+                 os.path.dirname(sys.argv[ 0 ]), "data"))




More information about the Python-apps-commits mailing list