Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Autogenerate dummy documentation in the source code for Python in eclipse

At the time I am documenting a lot of my code (Python) and I was wondering if there is a plugin to Eclipse that can automatically generate a doc string for my functions, like visual studio does it for C# when writing /// over a method.

I have been searching around for a solution, but I had no luck - do any of you know a solution?

Example:

From my parameter list on a method the "dummy" documentation will be created under my method definition as shown below:

def myFunction(self, a, b):
    """

    :param a:
    :type a:
    :param b:
    :type b:
    :return:
    :rtype:
    """
    return 'Hello, world'
like image 335
aweis Avatar asked Sep 21 '11 13:09

aweis


1 Answers

Well, according to this doc, if you press Ctrl + 1 on a method name, you will get what you need.

For your example (EDIT : if you set the option PyDev>Editor>Code Style>Docstrings>Doctag generation to always to get the type of the param), you will get :

def myFunction(self, a, b):
    '''

    @param a:
    @type a:
    @param b:
    @type b:
    '''
    return 'Hello, world'
like image 93
Cédric Julien Avatar answered Oct 24 '22 03:10

Cédric Julien