diff -r e9e7eca7efee -r bf71ee032bb4 src/eric7/QScintilla/DocstringGenerator/GoogledocGenerator.py --- a/src/eric7/QScintilla/DocstringGenerator/GoogledocGenerator.py Wed Jul 13 11:16:20 2022 +0200 +++ b/src/eric7/QScintilla/DocstringGenerator/GoogledocGenerator.py Wed Jul 13 14:55:47 2022 +0200 @@ -12,10 +12,10 @@ """ Function to generate the docstring line list iaw. Sphinx 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("") @@ -63,7 +64,7 @@ if argValue: argLine += " Defaults to {0}.".format(argValue) lines.append(argLine) - + # add return section lines.append("") if functionInfo.hasYield: @@ -71,18 +72,19 @@ else: lines.append("Returns:") if functionInfo.returnTypeAnnotated: - lines.append("{0}{1}: DESCRIPTION".format( - indent, functionInfo.returnTypeAnnotated)) + lines.append( + "{0}{1}: DESCRIPTION".format(indent, functionInfo.returnTypeAnnotated) + ) elif functionInfo.returnValueInBody: lines.append("{0}TYPE: DESCRIPTION") else: lines.append("{0}None".format(indent)) - + # add an exceptions section, if function raises something if functionInfo.raiseList: lines.append("") lines.append("Raises:") for exc in sorted(functionInfo.raiseList): lines.append("{0}{1}: DESCRIPTION".format(indent, exc)) - + return lines