def parse_option(self, option, block_name, *values):
        """ Parse options for play, end_play, and timer_play.
            """

        if len(values) != 1:
            raise TypeError
        value = os.path.realpath(os.path.expanduser(values[0]))

        if not os.path.isfile(value) and not os.path.islink(value):
            raise ValueError(u'Sound file "{0}" does not exist'
                             .format(value))

        # special extension check for aplay player
        ext = os.path.splitext(value)[1].lower()
        if ext != 'wav' and self._get_external_player() == 'aplay':
            raise ValueError(u"Only WAV sound file "
                             "supported for 'aplay'")

        if option == 'play':
            option = 'start_' + option

        key = option.split('_', 1)[0]
        self.files[key] = value
def parse_option ( self , option , block_name , * values ) : if len ( values ) != 1 : raise TypeError value = os . path . realpath ( os . path . expanduser ( values [ 0 ] ) ) if not os . path . isfile ( value ) and not os . path . islink ( value ) : raise ValueError ( u'Sound file "{0}" does not exist' . format ( value ) ) ext = os . path . splitext ( value ) [ 1 ] . lower ( ) if ext != 'wav' and self . _get_external_player ( ) == 'aplay' : raise ValueError ( u"Only WAV sound file " "supported for 'aplay'" ) if option == 'play' : option = 'start_' + option key = option . split ( '_' , 1 ) [ 0 ] self . files [ key ] = value
Parse options for play, end_play, and timer_play.