Module implementing a docstring generator for Python.
None |
PyDocstringGenerator | Class implementing a docstring generator for Python. |
PyFunctionInfo | Class implementing an object to extract and store function information. |
None |
Class implementing a docstring generator for Python.
None |
None |
PyDocstringGenerator | Constructor |
__generateDocstring | Private method to generate the list of docstring lines. |
__generateDocstringFromBelow | Private method to generate a docstring when the given position is on the line below the end of the definition. |
__generateDocstringFromStart | Private method to generate a docstring based on the cursor being placed on the first line of the definition. |
__getFunctionBody | Private method to get the function body. |
__getFunctionDefinitionFromBelow | Private method to extract the function definition based on the cursor being placed on the first line after the definition. |
__getFunctionDefinitionFromStart | Private method to extract the function definition based on the cursor being placed on the first line of the definition. |
__getIndentationInsertString | Private method to create the indentation string for the docstring. |
__isTripleQuotesStart | Private method to test, if the given text is the start of a triple quoted string. |
hasFunctionDefinition | Public method to test, if the cursor is right below a function definition. |
insertDocstring | Public method to insert a docstring for the function at the cursor position. |
insertDocstringFromShortcut | Public method to insert a docstring for the function at the cursor position initiated via a keyboard shortcut. |
isDocstringIntro | Public function to test, if the line up to the cursor position might be introducing a docstring. |
isFunctionStart | Public method to test, if a text is the start of a function or method definition. |
None |
Constructor
Private method to generate the list of docstring lines.
Private method to generate a docstring when the given position is on the line below the end of the definition.
Private method to generate a docstring based on the cursor being placed on the first line of the definition.
Private method to get the function body.
Private method to extract the function definition based on the cursor being placed on the first line after the definition.
Private method to extract the function definition based on the cursor being placed on the first line of the definition.
Private method to create the indentation string for the docstring.
Private method to test, if the given text is the start of a triple quoted string.
Public method to test, if the cursor is right below a function definition.
Public method to insert a docstring for the function at the cursor position.
Public method to insert a docstring for the function at the cursor position initiated via a keyboard shortcut.
Public function to test, if the line up to the cursor position might be introducing a docstring.
Public method to test, if a text is the start of a function or method definition.
Class implementing an object to extract and store function information.
None |
None |
PyFunctionInfo | Constructor |
__findBracketPosition | Private method to find the start and end position of pairs of brackets. |
__findQuotePosition | Private method to find the start and end position of pairs of quotes. |
__isCharInPairs | Private method to test, if the given character position is between pairs of brackets or quotes. |
__splitArgumentToNameTypeValue | Private method to split some argument text to name, type and value. |
__splitArgumentsTextToList | Private method to split the given arguments text into a list of arguments. |
parseBody | Public method to parse the function body text. |
parseDefinition | Public method to parse the function definition text. |
None |
Constructor
Private method to find the start and end position of pairs of brackets.
https://stackoverflow.com/questions/29991917/ indices-of-matching-parentheses-in-python
Private method to find the start and end position of pairs of quotes.
Private method to test, if the given character position is between pairs of brackets or quotes.
Private method to split some argument text to name, type and value.
Private method to split the given arguments text into a list of arguments.
This function uses a comma to separate arguments and ignores a comma in brackets and quotes.
Public method to parse the function body text.
Public method to parse the function definition text.