(self, data, key, starting=True)
return idx
Get from a docstring the next option with a given key.

        :param data: string to parse
        :param starting: does the key element must start the line (Default value = True)
        :type starting: boolean
        :param key: the key category. Can be 'param', 'type', 'return', ...
        :returns: index of found element else -1
        :rtype: integer
Get from a docstring the next option with a given key.
Get from a docstring the next option with a given key .
def get_key_index(self, data, key, starting=True):
        """Get from a docstring the next option with a given key.

        :param data: string to parse
        :param starting: does the key element must start the line (Default value = True)
        :type starting: boolean
        :param key: the key category. Can be 'param', 'type', 'return', ...
        :returns: index of found element else -1
        :rtype: integer

        """
        key = self.opt[key][self.style['in']]['name']
        if key.startswith(':returns'):
            data = data.replace(':return:', ':returns:')  # see issue 9
        idx = len(data)
        ini = 0
        loop = True
        if key in data:
            while loop:
                i = data.find(key)
                if i != -1:
                    if starting:
                        if not data[:i].rstrip(' \t').endswith('\n') and len(data[:i].strip()) > 0:
                            ini = i + 1
                            data = data[ini:]
                        else:
                            idx = ini + i
                            loop = False
                    else:
                        idx = ini + i
                        loop = False
                else:
                    loop = False
        if idx == len(data):
            idx = -1
        return idx
def get_key_index ( self , data , key , starting = True ) : key = self . opt [ key ] [ self . style [ 'in' ] ] [ 'name' ] if key . startswith ( ':returns' ) : data = data . replace ( ':return:' , ':returns:' ) # see issue 9 idx = len ( data ) ini = 0 loop = True if key in data : while loop : i = data . find ( key ) if i != - 1 : if starting : if not data [ : i ] . rstrip ( ' \t' ) . endswith ( '\n' ) and len ( data [ : i ] . strip ( ) ) > 0 : ini = i + 1 data = data [ ini : ] else : idx = ini + i loop = False else : idx = ini + i loop = False else : loop = False if idx == len ( data ) : idx = - 1 return idx