(self, sep)
return raw
Set the output raw return section

        :param sep: the separator of current style
Set the output raw return section
Set the output raw return section
def _set_raw_return(self, sep):
        """Set the output raw return section

        :param sep: the separator of current style

        """
        raw = ''
        if self.dst.style['out'] == 'numpydoc':
            raw += '\n'
            spaces = ' ' * 4
            with_space = lambda s: '\n'.join([self.docs['out']['spaces'] + spaces + l.lstrip() if i > 0 else l for i, l in enumerate(s.splitlines())])
            raw += self.dst.numpydoc.get_key_section_header('return', self.docs['out']['spaces'])
            if self.docs['out']['rtype']:
                rtype = self.docs['out']['rtype']
            else:
                rtype = 'type'
            # case of several returns
            if type(self.docs['out']['return']) is list:
                for ret_elem in self.docs['out']['return']:
                    # if tuple (name, desc, rtype) else string desc
                    if type(ret_elem) is tuple and len(ret_elem) == 3:
                        rtype = ret_elem[2]
                        if rtype is None:
                            rtype = ''
                        raw += self.docs['out']['spaces']
                        if ret_elem[0]:
                            raw += ret_elem[0] + ' : '
                        raw += rtype + '\n' + self.docs['out']['spaces'] + spaces + with_space(ret_elem[1]).strip() + '\n'
                    else:
                        # There can be a problem
                        raw += self.docs['out']['spaces'] + rtype + '\n'
                        raw += self.docs['out']['spaces'] + spaces + with_space(str(ret_elem)).strip() + '\n'
            # case of a unique return
            elif self.docs['out']['return'] is not None:
                raw += self.docs['out']['spaces'] + rtype
                raw += '\n' + self.docs['out']['spaces'] + spaces + with_space(self.docs['out']['return']).strip() + '\n'
        elif self.dst.style['out'] == 'google':
            raw += '\n'
            spaces = ' ' * 2
            with_space = lambda s: '\n'.join([self.docs['out']['spaces'] + spaces +\
                                                    l.lstrip() if i > 0 else\
                                                    l for i, l in enumerate(s.splitlines())])
            raw += self.dst.googledoc.get_key_section_header('return', self.docs['out']['spaces'])
            if self.docs['out']['rtype']:
                rtype = self.docs['out']['rtype']
            else:
                rtype = None
            # case of several returns
            if type(self.docs['out']['return']) is list:
                for ret_elem in self.docs['out']['return']:
                    # if tuple (name=None, desc, rtype) else string desc
                    if type(ret_elem) is tuple and len(ret_elem) == 3:
                        rtype = ret_elem[2]
                        if rtype is None:
                            rtype = ''
                        raw += self.docs['out']['spaces'] + spaces
                        raw += rtype + ': ' + with_space(ret_elem[1]).strip() + '\n'
                    else:
                        # There can be a problem
                        if rtype:
                            raw += self.docs['out']['spaces'] + spaces + rtype + ': '
                            raw += with_space(str(ret_elem)).strip() + '\n'
                        else:
                            raw += self.docs['out']['spaces'] + spaces + with_space(str(ret_elem)).strip() + '\n'
            # case of a unique return
            elif self.docs['out']['return'] is not None:
                if rtype:
                    raw += self.docs['out']['spaces'] + spaces + rtype + ': '
                    raw += with_space(self.docs['out']['return']).strip() + '\n'
                else:
                    raw += self.docs['out']['spaces'] + spaces + with_space(self.docs['out']['return']).strip() + '\n'
        elif self.dst.style['out'] == 'groups':
            pass
        else:
            with_space = lambda s: '\n'.join([self.docs['out']['spaces'] + l if i > 0 else l for i, l in enumerate(s.splitlines())])
            if self.docs['out']['return']:
                if not self.docs['out']['params']:
                    raw += '\n'
                raw += self.docs['out']['spaces'] + self.dst.get_key('return', 'out') + sep + with_space(self.docs['out']['return'].rstrip()).strip() + '\n'
            if self.docs['out']['rtype']:
                if not self.docs['out']['params']:
                    raw += '\n'
                raw += self.docs['out']['spaces'] + self.dst.get_key('rtype', 'out') + sep + self.docs['out']['rtype'].rstrip() + '\n'
        return raw
def _set_raw_return ( self , sep ) : raw = '' if self . dst . style [ 'out' ] == 'numpydoc' : raw += '\n' spaces = ' ' * 4 with_space = lambda s : '\n' . join ( [ self . docs [ 'out' ] [ 'spaces' ] + spaces + l . lstrip ( ) if i > 0 else l for i , l in enumerate ( s . splitlines ( ) ) ] ) raw += self . dst . numpydoc . get_key_section_header ( 'return' , self . docs [ 'out' ] [ 'spaces' ] ) if self . docs [ 'out' ] [ 'rtype' ] : rtype = self . docs [ 'out' ] [ 'rtype' ] else : rtype = 'type' # case of several returns if type ( self . docs [ 'out' ] [ 'return' ] ) is list : for ret_elem in self . docs [ 'out' ] [ 'return' ] : # if tuple (name, desc, rtype) else string desc if type ( ret_elem ) is tuple and len ( ret_elem ) == 3 : rtype = ret_elem [ 2 ] if rtype is None : rtype = '' raw += self . docs [ 'out' ] [ 'spaces' ] if ret_elem [ 0 ] : raw += ret_elem [ 0 ] + ' : ' raw += rtype + '\n' + self . docs [ 'out' ] [ 'spaces' ] + spaces + with_space ( ret_elem [ 1 ] ) . strip ( ) + '\n' else : # There can be a problem raw += self . docs [ 'out' ] [ 'spaces' ] + rtype + '\n' raw += self . docs [ 'out' ] [ 'spaces' ] + spaces + with_space ( str ( ret_elem ) ) . strip ( ) + '\n' # case of a unique return elif self . docs [ 'out' ] [ 'return' ] is not None : raw += self . docs [ 'out' ] [ 'spaces' ] + rtype raw += '\n' + self . docs [ 'out' ] [ 'spaces' ] + spaces + with_space ( self . docs [ 'out' ] [ 'return' ] ) . strip ( ) + '\n' elif self . dst . style [ 'out' ] == 'google' : raw += '\n' spaces = ' ' * 2 with_space = lambda s : '\n' . join ( [ self . docs [ 'out' ] [ 'spaces' ] + spaces + l . lstrip ( ) if i > 0 else l for i , l in enumerate ( s . splitlines ( ) ) ] ) raw += self . dst . googledoc . get_key_section_header ( 'return' , self . docs [ 'out' ] [ 'spaces' ] ) if self . docs [ 'out' ] [ 'rtype' ] : rtype = self . docs [ 'out' ] [ 'rtype' ] else : rtype = None # case of several returns if type ( self . docs [ 'out' ] [ 'return' ] ) is list : for ret_elem in self . docs [ 'out' ] [ 'return' ] : # if tuple (name=None, desc, rtype) else string desc if type ( ret_elem ) is tuple and len ( ret_elem ) == 3 : rtype = ret_elem [ 2 ] if rtype is None : rtype = '' raw += self . docs [ 'out' ] [ 'spaces' ] + spaces raw += rtype + ': ' + with_space ( ret_elem [ 1 ] ) . strip ( ) + '\n' else : # There can be a problem if rtype : raw += self . docs [ 'out' ] [ 'spaces' ] + spaces + rtype + ': ' raw += with_space ( str ( ret_elem ) ) . strip ( ) + '\n' else : raw += self . docs [ 'out' ] [ 'spaces' ] + spaces + with_space ( str ( ret_elem ) ) . strip ( ) + '\n' # case of a unique return elif self . docs [ 'out' ] [ 'return' ] is not None : if rtype : raw += self . docs [ 'out' ] [ 'spaces' ] + spaces + rtype + ': ' raw += with_space ( self . docs [ 'out' ] [ 'return' ] ) . strip ( ) + '\n' else : raw += self . docs [ 'out' ] [ 'spaces' ] + spaces + with_space ( self . docs [ 'out' ] [ 'return' ] ) . strip ( ) + '\n' elif self . dst . style [ 'out' ] == 'groups' : pass else : with_space = lambda s : '\n' . join ( [ self . docs [ 'out' ] [ 'spaces' ] + l if i > 0 else l for i , l in enumerate ( s . splitlines ( ) ) ] ) if self . docs [ 'out' ] [ 'return' ] : if not self . docs [ 'out' ] [ 'params' ] : raw += '\n' raw += self . docs [ 'out' ] [ 'spaces' ] + self . dst . get_key ( 'return' , 'out' ) + sep + with_space ( self . docs [ 'out' ] [ 'return' ] . rstrip ( ) ) . strip ( ) + '\n' if self . docs [ 'out' ] [ 'rtype' ] : if not self . docs [ 'out' ] [ 'params' ] : raw += '\n' raw += self . docs [ 'out' ] [ 'spaces' ] + self . dst . get_key ( 'rtype' , 'out' ) + sep + self . docs [ 'out' ] [ 'rtype' ] . rstrip ( ) + '\n' return raw