diff options
author | Philipp Hahn <hahn@univention.de> | 2018-11-20 11:42:58 +0100 |
---|---|---|
committer | Jano Tomko <jtomko@redhat.com> | 2020-09-01 13:26:01 +0000 |
commit | 8f354ae73817e5b444ed2cd0a2f541eb3e0abe42 (patch) | |
tree | 747ea21055d17d726efb65523eb9c604bc11a107 /generator.py | |
parent | f36643acacaa80b017820fa746cce636c2607371 (diff) | |
download | libvirt-python-8f354ae73817e5b444ed2cd0a2f541eb3e0abe42.tar.gz |
generator: Use splitlines()
instead of hand-coded implementation.
Signed-off-by: Philipp Hahn <hahn@univention.de>
Diffstat (limited to 'generator.py')
-rwxr-xr-x | generator.py | 13 |
1 files changed, 2 insertions, 11 deletions
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): |