ModuleDocumentor: fixed an issue parsing long @signal or @event definitions.

Thu, 17 Dec 2020 17:35:19 +0100

author
Detlev Offenbach <detlev@die-offenbachs.de>
date
Thu, 17 Dec 2020 17:35:19 +0100
changeset 7888
803f811dc466
parent 7887
c1588f5a83e9
child 7889
c6af59ed8c17

ModuleDocumentor: fixed an issue parsing long @signal or @event definitions.

eric6/DocumentationTools/ModuleDocumentor.py file | annotate | diff | comparison | revisions
--- a/eric6/DocumentationTools/ModuleDocumentor.py	Thu Dec 17 14:40:06 2020 +0100
+++ b/eric6/DocumentationTools/ModuleDocumentor.py	Thu Dec 17 17:35:19 2020 +0100
@@ -961,9 +961,17 @@
         while dlist and not dlist[0]:
             del dlist[0]
         lastTag = ""
+        buffer = ""
         for ditem in dlist:
             ditem = self.__processInlineTags(ditem)
             desc = ditem.strip()
+            if buffer:
+                if desc.startswith("@"):
+                    buffer = ""
+                    raise TagError(
+                        "Wrong format in {0} line.\n".format(lastTag))
+                else:
+                    desc = buffer + desc
             if desc:
                 if desc.startswith(("@param", "@keyparam")):
                     inTagSection = True
@@ -1048,36 +1056,39 @@
                     lastTag = desc.split(None, 1)[0]
                     m = _signal(desc, 0)
                     if m is None:
-                        raise TagError("Wrong format in @signal line.\n")
-                    signalName = (
-                        1 and m.group("SignalName1") or m.group("SignalName2")
-                    )
-                    signalDesc = (
-                        1 and m.group("SignalDescription1") or
-                        m.group("SignalDescription2")
-                    )
-                    signalDict[signalName] = []
-                    if signalDesc is not None:
-                        signalDict[signalName].append(signalDesc)
-                    lastItem = signalDict[signalName]
+                        buffer = desc
+                    else:
+                        buffer = ""
+                        signalName = (
+                            m.group("SignalName1") or m.group("SignalName2")
+                        )
+                        signalDesc = (
+                            m.group("SignalDescription1") or
+                            m.group("SignalDescription2")
+                        )
+                        signalDict[signalName] = []
+                        if signalDesc is not None:
+                            signalDict[signalName].append(signalDesc)
+                        lastItem = signalDict[signalName]
                 elif desc.startswith("@event"):
                     inTagSection = True
                     lastTag = desc.split(None, 1)[0]
                     m = _event(desc, 0)
                     if m is None:
-                        raise TagError(
-                            "Wrong format in {0} line.\n".format(parts[0]))
-                    eventName = (
-                        1 and m.group("EventName1") or m.group("EventName2")
-                    )
-                    eventDesc = (
-                        1 and m.group("EventDescription1") or
-                        m.group("EventDescription2")
-                    )
-                    eventDict[eventName] = []
-                    if eventDesc is not None:
-                        eventDict[eventName].append(eventDesc)
-                    lastItem = eventDict[eventName]
+                        buffer = desc
+                    else:
+                        buffer = ""
+                        eventName = (
+                            m.group("EventName1") or m.group("EventName2")
+                        )
+                        eventDesc = (
+                            m.group("EventDescription1") or
+                            m.group("EventDescription2")
+                        )
+                        eventDict[eventName] = []
+                        if eventDesc is not None:
+                            eventDict[eventName].append(eventDesc)
+                        lastItem = eventDict[eventName]
                 elif desc.startswith("@deprecated"):
                     inTagSection = True
                     parts = desc.split(None, 1)

eric ide

mercurial