1
0
mirror of https://gitlab.gnome.org/GNOME/libxslt synced 2025-06-15 10:41:43 +03:00

fixup the script and rebuid the API cleanup provided accessors for a lot

* doc/libxslt-api.xml doc/libxslt-decl.txt doc/libxslt-refs.xml
  doc/parsedecl.py: fixup the script and rebuid the API
* libxslt/extensions.h: cleanup
* python/generator.py python/libxslt-python-api.xml python/libxslt.c
  python/libxsltclass.txt: provided accessors for a lot of the
  tructures involved in the transformation. Stylesheet and
  transformation python object don't free automatically the
  encapsulated object when deallocated.
* python/tests/Makefile.am python/tests/basic.py
  python/tests/extfunc.py python/tests/pyxsltproc.py:
  updated the examples
Daniel
This commit is contained in:
Daniel Veillard
2002-02-07 22:34:59 +00:00
parent 9de2bd46fc
commit 3146d5356f
14 changed files with 277 additions and 40 deletions

View File

@ -526,8 +526,7 @@ classes_ancestor = {
"xpathParserContext" : "libxml2.xpathParserContext",
}
classes_destructors = {
"stylesheet": "xsltFreeStylesheet",
"transformCtxt": "xsltFreeTransformContext",
"xpathContext" : "pass"
}
function_classes = {}
@ -578,6 +577,24 @@ def nameFixup(function, classe, type, file):
elif name[0:10] == "xmlNodeGet" and file == "python_accessor":
func = name[10:]
func = string.lower(func[0:1]) + func[1:]
elif name[0:18] == "xsltXPathParserGet" and file == "python_accessor":
func = name[18:]
func = string.lower(func[0:1]) + func[1:]
elif name[0:12] == "xsltXPathGet" and file == "python_accessor":
func = name[12:]
func = string.lower(func[0:1]) + func[1:]
elif name[0:16] == "xsltTransformGet" and file == "python_accessor":
func = name[16:]
func = string.lower(func[0:1]) + func[1:]
elif name[0:16] == "xsltTransformSet" and file == "python_accessor":
func = name[13:]
func = string.lower(func[0:1]) + func[1:]
elif name[0:17] == "xsltStylesheetGet" and file == "python_accessor":
func = name[17:]
func = string.lower(func[0:1]) + func[1:]
elif name[0:17] == "xsltStylesheetSet" and file == "python_accessor":
func = name[14:]
func = string.lower(func[0:1]) + func[1:]
elif name[0:l] == classe:
func = name[l:]
func = string.lower(func[0:1]) + func[1:]
@ -784,10 +801,13 @@ for classname in classes_list:
classes.write(" self._o = None\n\n");
if classes_destructors.has_key(classname):
classes.write(" def __del__(self):\n")
classes.write(" if self._o != None:\n")
classes.write(" _libxslt.%s(self._o)\n" %
classes_destructors[classname]);
classes.write(" self._o = None\n\n");
if classes_destructors[classname] == "pass":
classes.write(" pass\n")
else:
classes.write(" if self._o != None:\n")
classes.write(" _libxslt.%s(self._o)\n" %
classes_destructors[classname]);
classes.write(" self._o = None\n\n");
flist = function_classes[classname]
flist.sort(functionCompare)
oldfile = ""