(operation_name)
return result
Make a google-style docstring.

        This is used to generate help() output.
Make a google-style docstring.
Make a google - style docstring .
def generate_docstring(operation_name):
        """Make a google-style docstring.

        This is used to generate help() output.

        """

        # we cache these to save regeneration
        if operation_name in Operation._docstring_cache:
            return Operation._docstring_cache[operation_name]

        intro = Introspect.get(operation_name)
        if (intro.flags & _OPERATION_DEPRECATED) != 0:
            raise Error('No such operator.',
                        'operator "{0}" is deprecated'.format(operation_name))

        result = intro.description[0].upper() + intro.description[1:] + '.\n\n'
        result += 'Example:\n'

        result += '   ' + ', '.join(intro.required_output) + ' = '
        if intro.member_x is not None:
            result += intro.member_x + '.' + operation_name + '('
        else:
            result += 'pyvips.Image.' + operation_name + '('

        args = []
        args += intro.method_args
        args += [x + '=' + GValue.gtype_to_python(intro.details[x]['type'])
                 for x in intro.doc_optional_input]
        args += [x + '=bool'
                 for x in intro.doc_optional_output]
        result += ", ".join(args) + ')\n'

        def argstr(name):
            details = intro.details[name]
            return (u'    {0} ({1}): {2}\n'.
                    format(name,
                           GValue.gtype_to_python(details['type']),
                           details['blurb']))

        result += '\nReturns:\n'
        for name in intro.required_output:
            result += argstr(name)

        result += '\nArgs:\n'
        if intro.member_x is not None:
            result += argstr(intro.member_x)
        for name in intro.method_args:
            result += argstr(name)

        if len(intro.doc_optional_input) > 0:
            result += '\nKeyword args:\n'
            for name in intro.doc_optional_input:
                result += argstr(name)

        if len(intro.doc_optional_output) > 0:
            result += '\nOther Parameters:\n'
            for name in intro.doc_optional_output:
                result += argstr(name)

        result += '\nRaises:\n    :class:`.Error`\n'

        # add to cache to save building again
        Operation._docstring_cache[operation_name] = result

        return result
def generate_docstring ( operation_name ) : # we cache these to save regeneration if operation_name in Operation . _docstring_cache : return Operation . _docstring_cache [ operation_name ] intro = Introspect . get ( operation_name ) if ( intro . flags & _OPERATION_DEPRECATED ) != 0 : raise Error ( 'No such operator.' , 'operator "{0}" is deprecated' . format ( operation_name ) ) result = intro . description [ 0 ] . upper ( ) + intro . description [ 1 : ] + '.\n\n' result += 'Example:\n' result += '   ' + ', ' . join ( intro . required_output ) + ' = ' if intro . member_x is not None : result += intro . member_x + '.' + operation_name + '(' else : result += 'pyvips.Image.' + operation_name + '(' args = [ ] args += intro . method_args args += [ x + '=' + GValue . gtype_to_python ( intro . details [ x ] [ 'type' ] ) for x in intro . doc_optional_input ] args += [ x + '=bool' for x in intro . doc_optional_output ] result += ", " . join ( args ) + ')\n' def argstr ( name ) : details = intro . details [ name ] return ( u'    {0} ({1}): {2}\n' . format ( name , GValue . gtype_to_python ( details [ 'type' ] ) , details [ 'blurb' ] ) ) result += '\nReturns:\n' for name in intro . required_output : result += argstr ( name ) result += '\nArgs:\n' if intro . member_x is not None : result += argstr ( intro . member_x ) for name in intro . method_args : result += argstr ( name ) if len ( intro . doc_optional_input ) > 0 : result += '\nKeyword args:\n' for name in intro . doc_optional_input : result += argstr ( name ) if len ( intro . doc_optional_output ) > 0 : result += '\nOther Parameters:\n' for name in intro . doc_optional_output : result += argstr ( name ) result += '\nRaises:\n    :class:`.Error`\n' # add to cache to save building again Operation . _docstring_cache [ operation_name ] = result return result