SRC="docs/xml-raw"
+classMap = {
+ 'wxString' : 'String',
+ 'void' : '',
+ }
+
def getModuleNames():
"""
return None
-
+def fixType(typeStr):
+ """
+ Fixup type string, dropping the swig pointer and other flags
+ """
+ pos = typeStr.rfind('.')
+ if pos != -1:
+ typeStr = typeStr[pos+1:]
+ return classMap.get(typeStr, typeStr)
def processModule(newDocNode, modulename):
# make a module element
name = getAttr(topNode, "module")
- assert name == modulename # sanity check
+ ##assert name == modulename # sanity check
moduleNode = libxml2.newNode("module")
moduleNode.setProp("name", name)
func = libxml2.newNode("method")
func.setProp("name", getAttr(node, "sym_name"))
func.setProp("oldname", getAttr(node, "name"))
- func.setProp("type", getAttr(node, "type"))
+ func.setProp("type", fixType(getAttr(node, "type")))
doCheckOverloaded(func, node)
doDocStrings(func, node)
doParamList(func, node)
"""
# make class element
klass = libxml2.newNode("class")
- klass.setProp("name", getAttr(classNode, "sym_name"))
- klass.setProp("oldname", getAttr(classNode, "name"))
+ name = getAttr(classNode, "sym_name")
+ oldname = getAttr(classNode, "name")
+ classMap[oldname] = name
+ klass.setProp("name", name)
+ klass.setProp("oldname", oldname)
klass.setProp("module", getAttr(classNode, "module"))
doDocStrings(klass, classNode)
parentNode.addChild(klass)
# check for baseclass(es)
for node in classNode.xpathEval2("attributelist/baselist/base"):
baseclass = libxml2.newNode("baseclass")
- baseclass.setProp("name", node.prop("name"))
+ basename = node.prop("name")
+ baseclass.setProp("name", classMap.get(basename, basename))
klass.addChild(baseclass)
# check for constructors/destructors
if view == "memberfunctionHandler":
func = libxml2.newNode("method")
func.setProp("name", getAttr(node, "sym_name"))
- func.setProp("type", getAttr(node, "type"))
+ func.setProp("type", fixType(getAttr(node, "type")))
doCheckOverloaded(func, node)
doDocStrings(func, node)
doParamList(func, node)
elif view == "staticmemberfunctionHandler":
func = libxml2.newNode("staticmethod")
func.setProp("name", getAttr(node, "sym_name"))
- func.setProp("type", getAttr(node, "type"))
+ func.setProp("type", fixType(getAttr(node, "type")))
doCheckOverloaded(func, node)
doDocStrings(func, node)
doParamList(func, node)
elif view == "variableHandler":
prop = libxml2.newNode("property")
prop.setProp("name", getAttr(node, "sym_name"))
- prop.setProp("type", getAttr(node, "type"))
+ prop.setProp("type", fixType(getAttr(node, "type")))
if getAttr(node, "feature_immutable"):
prop.setProp("readonly", "yes")
else:
plist = libxml2.newNode("paramlist")
for p in params:
pnode = libxml2.newNode("param")
- pnode.setProp("name", getAttr(p, "name"))
- pnode.setProp("type", getAttr(p, "type"))
+ pnode.setProp("name", getAttr(p, "name"))
+ pnode.setProp("type", fixType(getAttr(p, "type")))
pnode.setProp("default", getAttr(p, "value"))
plist.addChild(pnode)
parentNode.addChild(plist)
autodoc = getAttr(srcNode, "python_autodoc")
docstr = getAttr(srcNode, "feature_docstring")
- refdoc = getAttr(srcNode, "feature_refdoc")
if autodoc:
parentNode.addChild(makeDocElement("autodoc", autodoc))
if docstr:
parentNode.addChild(makeDocElement("docstring", docstr))
- if refdoc:
- parentNode.addChild(makeDocElement("refdoc", refdoc))
processModule(newTopNode, m)
newDoc.saveFormatFile(DEST, True)
-
+ print "Wrote simplified metadata to", DEST
#---------------------------------------------------------------------------