Tue, 23 May 2023 14:39:14 +0200
Implemented a little enhancement for the Python docstring generator.
--- a/src/eric7/QScintilla/DocstringGenerator/EricdocGenerator.py Tue May 23 13:33:47 2023 +0200 +++ b/src/eric7/QScintilla/DocstringGenerator/EricdocGenerator.py Tue May 23 14:39:14 2023 +0200 @@ -107,7 +107,10 @@ if ( functionInfo.hasYield or functionInfo.returnValueInBody - or functionInfo.returnTypeAnnotated + or ( + functionInfo.returnTypeAnnotated + and functionInfo.returnTypeAnnotated != "None" + ) ): if functionInfo.hasYield: lines.append("@yield DESCRIPTION")
--- a/src/eric7/QScintilla/DocstringGenerator/PyDocstringGenerator.py Tue May 23 13:33:47 2023 +0200 +++ b/src/eric7/QScintilla/DocstringGenerator/PyDocstringGenerator.py Tue May 23 14:39:14 2023 +0200 @@ -340,8 +340,10 @@ @rtype str """ startLine = cursorPosition[0] - 1 - endLine = startLine - min(startLine, 20) + endLine = startLine - min(startLine, 20) - 1 # max. 20 lines of definition allowed + if endLine < -1: + endLine = -1 isFirstLine = True functionTextList = []