Fixed an issue in the module documentor.

Sat, 16 Jan 2016 16:56:59 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Sat, 16 Jan 2016 16:56:59 +0100
changeset 4667
77050ebbdb20
parent 4666
bc52ef526e11
child 4669
d37bfc9ca3b9

Fixed an issue in the module documentor.

DocumentationTools/ModuleDocumentor.py file | annotate | diff | comparison | revisions
diff -r bc52ef526e11 -r 77050ebbdb20 DocumentationTools/ModuleDocumentor.py
--- a/DocumentationTools/ModuleDocumentor.py	Sat Jan 16 16:53:31 2016 +0100
+++ b/DocumentationTools/ModuleDocumentor.py	Sat Jan 16 16:56:59 2016 +0100
@@ -975,12 +975,12 @@
                         paramList.append([paramName, "", []])
                     lastItem = paramList[-1][2]
                 elif desc.startswith("@type"):
+                    parts = desc.split(None, 1)
                     if lastTag not in ["@param", "@keyparam"]:
                         raise TagError(
                             "{0} line must be preceded by a parameter line\n"
                             .format(parts[0]))
                     inTagSection = True
-                    parts = desc.split(None, 1)
                     lastTag = parts[0]
                     if len(parts) < 2:
                         raise TagError(
@@ -1012,8 +1012,12 @@
                     returns = [parts[1]]
                     lastItem = returns
                 elif desc.startswith("@rtype"):
+                    parts = desc.split(None, 1)
+                    if lastTag not in ["@return", "@ireturn"]:
+                        raise TagError(
+                            "{0} line must be preceded by a return line\n"
+                            .format(parts[0]))
                     inTagSection = True
-                    parts = desc.split(None, 1)
                     lastTag = parts[0]
                     if len(parts) < 2:
                         raise TagError(

eric ide

mercurial