3
0
Fork 0
mirror of https://github.com/Z3Prover/z3 synced 2025-05-01 21:05:52 +00:00

renamed script

Signed-off-by: Leonardo de Moura <leonardo@microsoft.com>
This commit is contained in:
Leonardo de Moura 2012-11-20 00:19:44 -08:00
parent e0f5c0bd8e
commit d226d2f381
2 changed files with 1 additions and 1 deletions

45
doc/mk_doc.py Normal file
View file

@ -0,0 +1,45 @@
import os
import shutil
import re
import pydoc
import sys
import subprocess
def mk_dir(d):
if not os.path.exists(d):
os.makedirs(d)
# Eliminate def_API and extra_API directives from file 'inf'.
# The result is stored in 'outf'.
def cleanup_API(inf, outf):
pat1 = re.compile(".*def_API.*")
pat2 = re.compile(".*extra_API.*")
_inf = open(inf, 'r')
_outf = open(outf, 'w')
for line in _inf:
if not pat1.match(line) and not pat2.match(line):
_outf.write(line)
try:
mk_dir('html')
cleanup_API('../src/api/z3_api.h', 'z3_api.h')
print "Removed annotations from z3_api.h."
DEVNULL = open(os.devnull, 'wb')
if subprocess.call(['doxygen', 'z3.dox'], stdout=DEVNULL, stderr=DEVNULL) != 0:
print "ERROR: failed to execute doxygen z3.dox"
exit(1)
print "Generated C and .NET API documentation."
os.remove('z3_api.h')
print "Removed temporary file z3_api.h."
shutil.copy('z3.css', 'html/z3.css')
print "Copied z3.css."
shutil.copy('z3.png', 'html/z3.png')
print "Copied z3.png."
sys.path.append('../src/api/python')
pydoc.writedoc('z3')
shutil.move('z3.html', 'html/z3.html')
print "Generated Python documentation."
print "Documentation was successfully generated at subdirectory './html'."
except:
print "ERROR: failed to generate documentation"
exit(1)