--- a/src/eric7/QScintilla/DocstringGenerator/NumpydocGenerator.py Wed Jul 13 11:16:20 2022 +0200 +++ b/src/eric7/QScintilla/DocstringGenerator/NumpydocGenerator.py Wed Jul 13 14:55:47 2022 +0200 @@ -12,10 +12,10 @@ """ Function to generate the docstring line list iaw. NumPy documentation style. - + Note: Text is created with DESCRIPTION placeholders for descriptions and TYPE placeholders for type information - + @param functionInfo object containing the function information to base the docstring on @type FunctionInfo @@ -26,23 +26,24 @@ """ # __IGNORE_WARNING_D202__ lines = [] - + # function description lines.append("") - + # remove 'self', 'this' or 'cls' from arguments list - if ( - len(functionInfo.argumentsList) > 0 and - functionInfo.argumentsList[0][0] in ("self", "cls", "this") + if len(functionInfo.argumentsList) > 0 and functionInfo.argumentsList[0][0] in ( + "self", + "cls", + "this", ): del functionInfo.argumentsList[0] - + # determine additional indentation string indentWidth = editor.indentationWidth() if indentWidth == 0: indentWidth = editor.tabWidth() indent = indentWidth * " " - + # add the parameters section if functionInfo.argumentsList: lines.append("") @@ -61,7 +62,7 @@ if argValue: argLine += " The default is {0}".format(argValue) lines.append(argLine) - + # add an exceptions section, if function raises something if functionInfo.raiseList: lines.append("") @@ -70,7 +71,7 @@ for exc in sorted(functionInfo.raiseList): lines.append("{0}".format(exc)) lines.append("{0}DESCRIPTION".format(indent)) - + # add return section lines.append("") if functionInfo.hasYield: @@ -87,5 +88,5 @@ lines.append("{0}DESCRIPTION.".format(indent)) else: lines.append("{0}None".format(indent)) - + return lines