diff --git a/etgtools/generators.py b/etgtools/generators.py index 7b164c88..ba94a662 100644 --- a/etgtools/generators.py +++ b/etgtools/generators.py @@ -81,12 +81,15 @@ def nci(text, numSpaces=0, stripLeading=True): return newText -def wrapText(text): +def wrapText(text, dontWrap: str = ''): import textwrap lines = [] tw = textwrap.TextWrapper(width=70, break_long_words=False) for line in text.split('\n'): - lines.append(tw.fill(line)) + if dontWrap and line.lstrip().startswith(dontWrap): + lines.append(line) + else: + lines.append(tw.fill(line)) return '\n'.join(lines) diff --git a/etgtools/sip_generator.py b/etgtools/sip_generator.py index 38db80b1..56b8e9bf 100644 --- a/etgtools/sip_generator.py +++ b/etgtools/sip_generator.py @@ -610,7 +610,7 @@ from .%s import * # get the docstring text text = nci(extractors.flattenNode(item.briefDoc, False)) - text = wrapText(text) + text = wrapText(text, item.pyName or item.name) #if isinstance(item, extractors.ClassDef):