Package: bambam Version: 0.4.dfsg-2 Severity: wishlist Tags: patch There is a sound (house_lo) that I find very annoying when my son is using the app. The attached patch lets one specify a blacklist of files that should never be played. By default the blacklist is empty.
-- System Information: Debian Release: wheezy/sid APT prefers precise-updates APT policy: (600, 'precise-updates'), (600, 'precise-security'), (600, 'precise'), (400, 'precise-backports') Architecture: amd64 (x86_64) Kernel: Linux 3.5.0-28-generic (SMP w/4 CPU cores) Locale: LANG=pl_PL.UTF-8, LC_CTYPE=pl_PL.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/bash Versions of packages bambam depends on: ii python-pygame 1.9.1release+dfsg-5 bambam recommends no packages. bambam suggests no packages. -- no debconf information
Index: bambam-0.4.dfsg/bambam.py =================================================================== --- bambam-0.4.dfsg.orig/bambam.py 2013-05-13 13:24:35.209105954 +0200 +++ bambam-0.4.dfsg/bambam.py 2013-05-13 13:32:00.944652311 +0200 @@ -15,6 +15,7 @@ import pygame, sys,os, random, string import argparse +import fnmatch from pygame.locals import * # figure out the install base to use with image and sound loading @@ -54,8 +55,12 @@ # Loads a list of sounds def load_sounds(lst): result = [] + global args for name in lst: - result.append(load_sound(name)) + if True in [fnmatch.fnmatch(name, p) for p in args.sound_blacklist]: + print "Skipping blacklisted sound:", name + else: + result.append(load_sound(name)) return result # Processes events @@ -127,6 +132,7 @@ # parser = argparse.ArgumentParser(description='A keyboard mashing game for babies.') parser.add_argument('-u', '--uppercase', action='store_true', help='Whether to show UPPER-CASE letters.') +parser.add_argument('--sound_blacklist', action='append', default=[], help='List of sound filename patterns to never play.') args = parser.parse_args() if not pygame.font: print 'Warning, fonts disabled'