def find_sound_file (self, file): #Check if the session has a soundpack and if so play the sound from that if not 'soundPack' in self.config['sounds']: sound_file = paths.sounds_path('standard\\%s' % file) else: if not os.path.exists(paths.sounds_path(self.config['sounds']['soundPack'])): logging.warning("Unable to find soundpack %s" % self.config['sounds']['soundPack']) return sound_file = paths.sounds_path(r'%s\%s' % (self.config['sounds']['soundPack'], file)) if not os.path.exists(sound_file): logging.warning('Unable to find sound file %r' % file) raise IOError, "Unable to find sound file" return sound_file
def SetDefaultValues (self): self.sounds.mute.SetValue(self.config['sounds']['mute']) soundpacks = os.listdir(paths.sounds_path()) self.sounds.SoundPack.SetItems(soundpacks) self.sounds.SoundPack.SetValue(self.config['sounds']['soundPack']) self.templates.default_followers_friends.SetValue(self.config['templates']['default_followers_friends']) self.templates.default_template.SetValue(self.config['templates']['default_template']) self.templates.reply.SetValue(self.config['templates']['reply']) self.templates.retweet.SetValue(self.config['templates']['retweet']) self.templates.search.SetValue(self.config['templates']['search']) self.templates.user_info.SetValue(self.config['templates']['user_info']) self.misc.DMSafeMode.SetValue(self.config['UI']['DMSafeMode']) self.misc.confirmRemovePost.SetValue(self.config['UI']['confirmRemovePost']) self.misc.RTStyle.SetItems([_("Ask whether comments are to be added (recommended)"), _("Never add comments (automatically retweet)"), _("Always add comments (old style)")]) self.misc.RTStyle.SetValue(self.misc.RTStyle.GetItems()[self.config['UI']['RTStyle']]) self.misc.replyToSelf.SetValue( self.config['UI']['replyToSelf']) self.misc.WorkOffline.SetValue(self.config['security']['workOffline']) self.misc.Fit() self.sizer.Fit(self) self.SetSizer(self.sizer)