(self)
Extract return description and type
Extract return description and type
Extract return description and type
def _extract_docs_return(self):
        """Extract return description and type"""
        if self.dst.style['in'] == 'numpydoc':
            data = '\n'.join([d.rstrip().replace(self.docs['out']['spaces'], '', 1) for d in self.docs['in']['raw'].splitlines()])
            self.docs['in']['return'] = self.dst.numpydoc.get_return_list(data)
            self.docs['in']['rtype'] = None
# TODO: fix this
        elif self.dst.style['in'] == 'google':
            data = '\n'.join([d.rstrip().replace(self.docs['out']['spaces'], '', 1) for d in self.docs['in']['raw'].splitlines()])
            self.docs['in']['return'] = self.dst.googledoc.get_return_list(data)
            self.docs['in']['rtype'] = None
        elif self.dst.style['in'] == 'groups':
            self._extract_groupstyle_docs_return()
        elif self.dst.style['in'] in ['javadoc', 'reST']:
            self._extract_tagstyle_docs_return()
def _extract_docs_return ( self ) : if self . dst . style [ 'in' ] == 'numpydoc' : data = '\n' . join ( [ d . rstrip ( ) . replace ( self . docs [ 'out' ] [ 'spaces' ] , '' , 1 ) for d in self . docs [ 'in' ] [ 'raw' ] . splitlines ( ) ] ) self . docs [ 'in' ] [ 'return' ] = self . dst . numpydoc . get_return_list ( data ) self . docs [ 'in' ] [ 'rtype' ] = None # TODO: fix this elif self . dst . style [ 'in' ] == 'google' : data = '\n' . join ( [ d . rstrip ( ) . replace ( self . docs [ 'out' ] [ 'spaces' ] , '' , 1 ) for d in self . docs [ 'in' ] [ 'raw' ] . splitlines ( ) ] ) self . docs [ 'in' ] [ 'return' ] = self . dst . googledoc . get_return_list ( data ) self . docs [ 'in' ] [ 'rtype' ] = None elif self . dst . style [ 'in' ] == 'groups' : self . _extract_groupstyle_docs_return ( ) elif self . dst . style [ 'in' ] in [ 'javadoc' , 'reST' ] : self . _extract_tagstyle_docs_return ( )