From 4588a49e12675a0d74407d846cf763ecd941abec Mon Sep 17 00:00:00 2001 From: "Daniel P. Berrange" Date: Fri, 25 Sep 2009 13:24:40 +0100 Subject: Fix API doc extractor to stop munging comment formatting The python method help docs are copied across from the C funtion comments, but in the process all line breaks and indentation was being lost. This made the resulting text and code examples completely unreadable. Both the API doc extractor and the python generator were destroying whitespace & this fixes them to preserve it exactly. * docs/apibuild.py: Preserve all whitespace when extracting function comments. Print function comment inside a 60: - if val[0] == " ": - val = val[1:] - continue - str = val[0:60] - i = string.rfind(str, " "); - if i < 0: - i = 60 - str = val[0:i] - val = val[i:] + i = string.find(val, "\n") + while i >= 0: + str = val[0:i+1] + val = val[i+1:] output.write(str) - output.write('\n '); + i = string.find(val, "\n") output.write(indent) - output.write(val); + output.write(val) output.write(' """\n') def buildWrappers(): -- cgit