From 8f354ae73817e5b444ed2cd0a2f541eb3e0abe42 Mon Sep 17 00:00:00 2001 From: Philipp Hahn Date: Tue, 20 Nov 2018 11:42:58 +0100 Subject: generator: Use splitlines() instead of hand-coded implementation. Signed-off-by: Philipp Hahn --- generator.py | 13 ++----------- 1 file changed, 2 insertions(+), 11 deletions(-) (limited to 'generator.py') diff --git a/generator.py b/generator.py index 9dd16ef..9f59cef 100755 --- a/generator.py +++ b/generator.py @@ -1342,17 +1342,8 @@ def writeDoc(module, name, args, indent, output): return val = funcs[name][0] val = val.replace("NULL", "None") - output.write(indent) - output.write('"""') - i = val.find("\n") - while i >= 0: - str = val[0:i + 1] - val = val[i + 1:] - output.write(str) - i = val.find("\n") - output.write(indent) - output.write(val) - output.write(' """\n') + sep = '\n%s' % (indent,) + output.write('%s"""%s """\n' % (indent, sep.join(val.splitlines()))) def buildWrappers(module): -- cgit v1.2.1