#
# Indexes the examples and build an XML description
#
import string
import glob
import sys
try:
import libxml2
except:
examples = []
tests = []
sections = {}
symbols = {}
api_dict = None
api_doc = None
def load_api():
global api_dict
global api_doc
if api_dict != None:
return
api_dict = {}
try:
print "loading ../libxml2-api.xml"
except:
print "failed to parse ../libxml2-api.xml"
global api_dict
global api_doc
if api_doc == None:
load_api()
if name == None:
return
else:
print "Reference %s not found in the API" % (name)
return None
return ret
res = {}
item = None
try:
else:
except:
if item != None:
else:
return res
global symbols
global sections
try:
except:
print "Example %s lacks a synopsis description" % (filename)
try:
except:
print "Example %s lacks a purpose description" % (filename)
try:
except:
print "Example %s lacks an usage description" % (filename)
try:
except:
pass
try:
except:
print "Example %s lacks an author description" % (filename)
try:
except:
print "Example %s lacks a copyright description" % (filename)
try:
else:
except:
print "Example %s lacks a section description" % (filename)
# gather at most 5 references per symbols
if refs > 5:
continue
else:
if info != None:
else:
return idx
global symbols
i = 1
i = i + 1
global sections
i = 0
i = i + 1
def dump_Makefile():
INCLUDES = -I$(top_builddir)/include -I$(top_srcdir)/include -I@srcdir@/include @THREAD_CFLAGS@ @Z_CFLAGS@
DEPS = $(top_builddir)/libxml2.la
LDADDS = @STATIC_BINARIES@ $(top_builddir)/libxml2.la @THREAD_LIBS@ @Z_LIBS@ $(ICONV_LIBS) -lm @WIN32_EXTRA_LIBADD@
rebuild: examples.xml index.html
examples.xml: index.py *.c
-@($(srcdir)/index.py)
index.html: examples.xml examples.xsl
-@(xsltproc examples.xsl examples.xml && echo "Rebuilt web page" && xmllint --valid --noout index.html)
install-data-local:
$(mkinstalldirs) $(DESTDIR)$(HTML_DIR)
-@INSTALL@ -m 0644 $(srcdir)/*.html $(srcdir)/*.c $(srcdir)/*.xml $(srcdir)/*.xsl $(srcdir)/*.res $(DESTDIR)$(HTML_DIR)
"""
EXTRA_DIST=""
Makefile = Makefile + "%s_SOURCES=%s.c\n%s_LDFLAGS=\n%s_DEPENDENCIES= $(DEPS)\n%s_LDADD= @RDL_LIBS@ $(LDADDS)\n\n" % (example, example, example,
try:
print "Updated Makefile.am"
except:
print "Failed to read or save Makefile.am"
#
# Autogenerate the .cvsignore too ...
#
ignore = """.memdump
Makefile.in
Makefile
"""
try:
print "Updated .cvsignore"
except:
print "Failed to read or save .cvsignore"
if __name__ == "__main__":
load_api()