def OnSelectSound(self, evt): """ """ dlg = wx.FileDialog( wx.GetTopLevelParent(self), _("Choose a sound file"), defaultDir=os.path.join(HOME_PATH, 'sounds'), wildcard=_("MP3 files (*.mp3)|*.mp3| WAV files (*.wav)|*.wav"), style=wx.OPEN) if dlg.ShowModal() == wx.ID_OK: val = dlg.GetPath() name = evt.GetEventObject().GetName() try: playSound(val) if name == 'success': self.sim_success_sound_path = val elif name == 'error': self.sim_error_sound_path = val else: pass except NotImplementedError, v: wx.MessageBox(str(v), _("Exception Message"))
def OnSelectSound(self, evt): """ """ dlg = wx.FileDialog(wx.GetTopLevelParent(self), _("Choose a sound file"), defaultDir = os.path.join(HOME_PATH,'sounds'), wildcard = _("MP3 files (*.mp3)|*.mp3| WAV files (*.wav)|*.wav"), style = wx.OPEN) if dlg.ShowModal() == wx.ID_OK: val = dlg.GetPath() name = evt.GetEventObject().GetName() try: playSound(val) if name == 'success': self.sim_success_sound_path = val elif name == 'error': self.sim_error_sound_path = val else: pass except NotImplementedError, v: wx.MessageBox(str(v), _("Exception Message"))