Commit 2180ad2b authored by Lasse Karstensen's avatar Lasse Karstensen

Output autogen-msg to .rst; pythonify a bit.

Write a header in generated .rst files that it was generated from the
.vcc file.

Also softly sprinkled with some python formatting:
* use a python 2.5 context manager for the filepointer
* and make the output easier to read by avoiding concatination.
parent 7a2a9836
......@@ -799,16 +799,19 @@ fc.close()
fh.close()
for suf in ("", ".man"):
fr = open("vmod_" + vx[0].nam + suf + ".rst", "w")
vx[0].doc_dump(fr, suf)
if len(copyright) > 0:
fr.write("\n")
fr.write("COPYRIGHT\n")
fr.write("=========\n")
fr.write("\n::\n\n")
for i in copyright:
fr.write(" " + i + "\n")
fr.write("\n")
fr.close()
with open("vmod_%s%s.rst" % (vx[0].nam, suf), "w") as fp:
fp.write("..\n")
fp.write(".. This file was autogenerated by %s. DO NOT EDIT!\n" %
basename(__file__))
fp.write("..\n")
vx[0].doc_dump(fp, suf)
if len(copyright) > 0:
fp.write("\n")
fp.write("COPYRIGHT\n")
fp.write("=========\n")
fp.write("\n::\n\n")
for i in copyright:
fp.write(" %s\n" % i)
fp.write("\n")
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment