From a464d9993e2acd5b8e1089b218ba74c6fcf215c5 Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Mon, 5 Sep 2005 17:10:35 +0000 Subject: Load /usr/tmp/tmp.CMoFff/libxml2-2.6.21 into packages/libxml2/branches/upstream/current. --- python/Makefile.in | 2 + python/generator.py | 2 +- python/libxml.c | 7 +- python/libxml2-py.c | 369 ++++++++++++++++++++++--------------------- python/setup.py | 2 +- python/tests/Makefile.in | 2 + python/tests/tstLastError.py | 12 +- 7 files changed, 215 insertions(+), 181 deletions(-) (limited to 'python') diff --git a/python/Makefile.in b/python/Makefile.in index 08a5540..36cac59 100644 --- a/python/Makefile.in +++ b/python/Makefile.in @@ -192,6 +192,7 @@ TEST_PUSH = @TEST_PUSH@ TEST_REGEXPS = @TEST_REGEXPS@ TEST_SAX = @TEST_SAX@ TEST_SCHEMAS = @TEST_SCHEMAS@ +TEST_SCHEMATRON = @TEST_SCHEMATRON@ TEST_THREADS = @TEST_THREADS@ TEST_VALID = @TEST_VALID@ TEST_VTIME = @TEST_VTIME@ @@ -227,6 +228,7 @@ WITH_REGEXPS = @WITH_REGEXPS@ WITH_RUN_DEBUG = @WITH_RUN_DEBUG@ WITH_SAX1 = @WITH_SAX1@ WITH_SCHEMAS = @WITH_SCHEMAS@ +WITH_SCHEMATRON = @WITH_SCHEMATRON@ WITH_THREADS = @WITH_THREADS@ WITH_TREE = @WITH_TREE@ WITH_TRIO = @WITH_TRIO@ diff --git a/python/generator.py b/python/generator.py index f9a8930..642b8d1 100755 --- a/python/generator.py +++ b/python/generator.py @@ -1055,7 +1055,7 @@ def buildWrappers(): classes_ancestor[classname] == "xmlNode": classes.write(" def __repr__(self):\n") format = "<%s (%%s) object at 0x%%x>" % (classname) - classes.write(" return \"%s\" %% (self.name, id (self))\n\n" % ( + classes.write(" return \"%s\" %% (self.name, long(id (self)))\n\n" % ( format)) else: txt.write("Class %s()\n" % (classname)) diff --git a/python/libxml.c b/python/libxml.c index 8fc63f8..ad8ac7c 100644 --- a/python/libxml.c +++ b/python/libxml.c @@ -681,8 +681,12 @@ pythonExternalEntityLoader(const char *URL, const char *ID, result = xmlNewIOInputStream(ctxt, buf, XML_CHAR_ENCODING_NONE); } +#if 0 } else { - printf("pythonExternalEntityLoader: can't read\n"); + if (URL != NULL) + printf("pythonExternalEntityLoader: can't read %s\n", + URL); +#endif } if (result == NULL) { Py_DECREF(ret); @@ -2529,6 +2533,7 @@ libxml_parent(ATTRIBUTE_UNUSED PyObject * self, PyObject * args) res = attr->parent; } + break; case XML_ENTITY_DECL: case XML_NAMESPACE_DECL: case XML_XINCLUDE_START: diff --git a/python/libxml2-py.c b/python/libxml2-py.c index 598f238..b656d7f 100644 --- a/python/libxml2-py.c +++ b/python/libxml2-py.c @@ -951,22 +951,18 @@ libxml_xmlTextReaderGetParserLineNumber(PyObject *self ATTRIBUTE_UNUSED, PyObjec } #endif /* defined(LIBXML_READER_ENABLED) */ -#if defined(LIBXML_UNICODE_ENABLED) PyObject * -libxml_xmlUCSIsKhmerSymbols(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { - PyObject *py_retval; - int c_retval; - int code; +libxml_xmlCheckVersion(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { + int version; - if (!PyArg_ParseTuple(args, (char *)"i:xmlUCSIsKhmerSymbols", &code)) + if (!PyArg_ParseTuple(args, (char *)"i:xmlCheckVersion", &version)) return(NULL); - c_retval = xmlUCSIsKhmerSymbols(code); - py_retval = libxml_intWrap((int) c_retval); - return(py_retval); + xmlCheckVersion(version); + Py_INCREF(Py_None); + return(Py_None); } -#endif /* defined(LIBXML_UNICODE_ENABLED) */ PyObject * libxml_xmlParseMarkupDecl(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { xmlParserCtxtPtr ctxt; @@ -1198,22 +1194,28 @@ libxml_xmlIOHTTPMatch(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { } #endif /* defined(LIBXML_HTTP_ENABLED) */ -#if defined(LIBXML_XPATH_ENABLED) PyObject * -libxml_xmlXPathNewFloat(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { +libxml_xmlStringLenDecodeEntities(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { PyObject *py_retval; - xmlXPathObjectPtr c_retval; - double val; + xmlChar * c_retval; + xmlParserCtxtPtr ctxt; + PyObject *pyobj_ctxt; + xmlChar * str; + int len; + int what; + xmlChar end; + xmlChar end2; + xmlChar end3; - if (!PyArg_ParseTuple(args, (char *)"d:xmlXPathNewFloat", &val)) + if (!PyArg_ParseTuple(args, (char *)"Oziiccc:xmlStringLenDecodeEntities", &pyobj_ctxt, &str, &len, &what, &end, &end2, &end3)) return(NULL); + ctxt = (xmlParserCtxtPtr) PyparserCtxt_Get(pyobj_ctxt); - c_retval = xmlXPathNewFloat(val); - py_retval = libxml_xmlXPathObjectPtrWrap((xmlXPathObjectPtr) c_retval); + c_retval = xmlStringLenDecodeEntities(ctxt, str, len, what, end, end2, end3); + py_retval = libxml_xmlCharPtrWrap((xmlChar *) c_retval); return(py_retval); } -#endif /* defined(LIBXML_XPATH_ENABLED) */ #if defined(LIBXML_UNICODE_ENABLED) PyObject * libxml_xmlUCSIsCatCc(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { @@ -2943,13 +2945,17 @@ libxml_htmlCtxtUseOptions(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { #endif /* defined(LIBXML_HTML_ENABLED) */ #if defined(LIBXML_CATALOG_ENABLED) PyObject * -libxml_xmlCatalogConvert(PyObject *self ATTRIBUTE_UNUSED, PyObject *args ATTRIBUTE_UNUSED) { - PyObject *py_retval; - int c_retval; +libxml_xmlFreeCatalog(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { + xmlCatalogPtr catal; + PyObject *pyobj_catal; - c_retval = xmlCatalogConvert(); - py_retval = libxml_intWrap((int) c_retval); - return(py_retval); + if (!PyArg_ParseTuple(args, (char *)"O:xmlFreeCatalog", &pyobj_catal)) + return(NULL); + catal = (xmlCatalogPtr) Pycatalog_Get(pyobj_catal); + + xmlFreeCatalog(catal); + Py_INCREF(Py_None); + return(Py_None); } #endif /* defined(LIBXML_CATALOG_ENABLED) */ @@ -3334,20 +3340,6 @@ libxml_htmlParseElement(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { } #endif /* defined(LIBXML_HTML_ENABLED) */ -PyObject * -libxml_xmlSubstituteEntitiesDefault(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { - PyObject *py_retval; - int c_retval; - int val; - - if (!PyArg_ParseTuple(args, (char *)"i:xmlSubstituteEntitiesDefault", &val)) - return(NULL); - - c_retval = xmlSubstituteEntitiesDefault(val); - py_retval = libxml_intWrap((int) c_retval); - return(py_retval); -} - #if defined(LIBXML_UNICODE_ENABLED) PyObject * libxml_xmlUCSIsGreek(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { @@ -3501,22 +3493,16 @@ libxml_xmlNanoHTTPScanProxy(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { } #endif /* defined(LIBXML_HTTP_ENABLED) */ -#if defined(LIBXML_UNICODE_ENABLED) +#if defined(LIBXML_SCHEMAS_ENABLED) PyObject * -libxml_xmlUCSIsCatMc(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { - PyObject *py_retval; - int c_retval; - int code; - - if (!PyArg_ParseTuple(args, (char *)"i:xmlUCSIsCatMc", &code)) - return(NULL); +libxml_xmlRelaxNGCleanupTypes(PyObject *self ATTRIBUTE_UNUSED, PyObject *args ATTRIBUTE_UNUSED) { - c_retval = xmlUCSIsCatMc(code); - py_retval = libxml_intWrap((int) c_retval); - return(py_retval); + xmlRelaxNGCleanupTypes(); + Py_INCREF(Py_None); + return(Py_None); } -#endif /* defined(LIBXML_UNICODE_ENABLED) */ +#endif /* defined(LIBXML_SCHEMAS_ENABLED) */ PyObject * libxml_xmlStringLenGetNodeList(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { PyObject *py_retval; @@ -4290,6 +4276,23 @@ libxml_xmlHasProp(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { return(py_retval); } +#if defined(LIBXML_XPATH_ENABLED) +PyObject * +libxml_xmlXPathNamespaceURIFunction(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { + xmlXPathParserContextPtr ctxt; + PyObject *pyobj_ctxt; + int nargs; + + if (!PyArg_ParseTuple(args, (char *)"Oi:xmlXPathNamespaceURIFunction", &pyobj_ctxt, &nargs)) + return(NULL); + ctxt = (xmlXPathParserContextPtr) PyxmlXPathParserContext_Get(pyobj_ctxt); + + xmlXPathNamespaceURIFunction(ctxt, nargs); + Py_INCREF(Py_None); + return(Py_None); +} + +#endif /* defined(LIBXML_XPATH_ENABLED) */ PyObject * libxml_xmlURISetScheme(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { xmlURIPtr URI; @@ -4995,18 +4998,22 @@ libxml_xmlDocSetRootElement(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { } #endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_WRITER_ENABLED) */ +#if defined(LIBXML_UNICODE_ENABLED) PyObject * -libxml_xmlCheckVersion(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { - int version; +libxml_xmlUCSIsKhmerSymbols(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { + PyObject *py_retval; + int c_retval; + int code; - if (!PyArg_ParseTuple(args, (char *)"i:xmlCheckVersion", &version)) + if (!PyArg_ParseTuple(args, (char *)"i:xmlUCSIsKhmerSymbols", &code)) return(NULL); - xmlCheckVersion(version); - Py_INCREF(Py_None); - return(Py_None); + c_retval = xmlUCSIsKhmerSymbols(code); + py_retval = libxml_intWrap((int) c_retval); + return(py_retval); } +#endif /* defined(LIBXML_UNICODE_ENABLED) */ #if defined(LIBXML_REGEXP_ENABLED) PyObject * libxml_xmlRegFreeRegexp(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { @@ -5396,6 +5403,20 @@ libxml_htmlDocDump(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { } #endif /* defined(LIBXML_HTML_ENABLED) && defined(LIBXML_OUTPUT_ENABLED) */ +PyObject * +libxml_xmlCheckFilename(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { + PyObject *py_retval; + int c_retval; + char * path; + + if (!PyArg_ParseTuple(args, (char *)"z:xmlCheckFilename", &path)) + return(NULL); + + c_retval = xmlCheckFilename(path); + py_retval = libxml_intWrap((int) c_retval); + return(py_retval); +} + #if defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED) PyObject * libxml_xmlTextReaderRelaxNGValidate(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { @@ -5546,16 +5567,22 @@ libxml_xmlUCSIsCatMn(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { } #endif /* defined(LIBXML_UNICODE_ENABLED) */ -#if defined(LIBXML_SCHEMAS_ENABLED) +#if defined(LIBXML_UNICODE_ENABLED) PyObject * -libxml_xmlRelaxNGCleanupTypes(PyObject *self ATTRIBUTE_UNUSED, PyObject *args ATTRIBUTE_UNUSED) { +libxml_xmlUCSIsCatMc(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { + PyObject *py_retval; + int c_retval; + int code; - xmlRelaxNGCleanupTypes(); - Py_INCREF(Py_None); - return(Py_None); + if (!PyArg_ParseTuple(args, (char *)"i:xmlUCSIsCatMc", &code)) + return(NULL); + + c_retval = xmlUCSIsCatMc(code); + py_retval = libxml_intWrap((int) c_retval); + return(py_retval); } -#endif /* defined(LIBXML_SCHEMAS_ENABLED) */ +#endif /* defined(LIBXML_UNICODE_ENABLED) */ #if defined(LIBXML_UNICODE_ENABLED) PyObject * libxml_xmlUCSIsCatMe(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { @@ -5642,23 +5669,6 @@ libxml_xmlStrdup(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { return(py_retval); } -#if defined(LIBXML_XPATH_ENABLED) -PyObject * -libxml_xmlXPathNamespaceURIFunction(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { - xmlXPathParserContextPtr ctxt; - PyObject *pyobj_ctxt; - int nargs; - - if (!PyArg_ParseTuple(args, (char *)"Oi:xmlXPathNamespaceURIFunction", &pyobj_ctxt, &nargs)) - return(NULL); - ctxt = (xmlXPathParserContextPtr) PyxmlXPathParserContext_Get(pyobj_ctxt); - - xmlXPathNamespaceURIFunction(ctxt, nargs); - Py_INCREF(Py_None); - return(Py_None); -} - -#endif /* defined(LIBXML_XPATH_ENABLED) */ PyObject * libxml_xmlCtxtReadDoc(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { PyObject *py_retval; @@ -5679,6 +5689,20 @@ libxml_xmlCtxtReadDoc(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { return(py_retval); } +PyObject * +libxml_xmlSubstituteEntitiesDefault(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { + PyObject *py_retval; + int c_retval; + int val; + + if (!PyArg_ParseTuple(args, (char *)"i:xmlSubstituteEntitiesDefault", &val)) + return(NULL); + + c_retval = xmlSubstituteEntitiesDefault(val); + py_retval = libxml_intWrap((int) c_retval); + return(py_retval); +} + #if defined(LIBXML_READER_ENABLED) PyObject * libxml_xmlTextReaderQuoteChar(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { @@ -5817,20 +5841,6 @@ libxml_xmlErrorGetDomain(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { return(py_retval); } -PyObject * -libxml_xmlCheckFilename(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { - PyObject *py_retval; - int c_retval; - char * path; - - if (!PyArg_ParseTuple(args, (char *)"z:xmlCheckFilename", &path)) - return(NULL); - - c_retval = xmlCheckFilename(path); - py_retval = libxml_intWrap((int) c_retval); - return(py_retval); -} - #if defined(LIBXML_XPATH_ENABLED) PyObject * libxml_xmlXPathFloorFunction(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { @@ -7403,6 +7413,22 @@ libxml_xmlXPathNextAncestorOrSelf(PyObject *self ATTRIBUTE_UNUSED, PyObject *arg return(py_retval); } +#endif /* defined(LIBXML_XPATH_ENABLED) */ +#if defined(LIBXML_XPATH_ENABLED) +PyObject * +libxml_xmlXPathNewFloat(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { + PyObject *py_retval; + xmlXPathObjectPtr c_retval; + double val; + + if (!PyArg_ParseTuple(args, (char *)"d:xmlXPathNewFloat", &val)) + return(NULL); + + c_retval = xmlXPathNewFloat(val); + py_retval = libxml_xmlXPathObjectPtrWrap((xmlXPathObjectPtr) c_retval); + return(py_retval); +} + #endif /* defined(LIBXML_XPATH_ENABLED) */ #if defined(LIBXML_XPATH_ENABLED) PyObject * @@ -7982,28 +8008,6 @@ libxml_xmlNanoFTPProxy(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { } #endif /* defined(LIBXML_FTP_ENABLED) */ -PyObject * -libxml_xmlStringLenDecodeEntities(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { - PyObject *py_retval; - xmlChar * c_retval; - xmlParserCtxtPtr ctxt; - PyObject *pyobj_ctxt; - xmlChar * str; - int len; - int what; - xmlChar end; - xmlChar end2; - xmlChar end3; - - if (!PyArg_ParseTuple(args, (char *)"Oziiccc:xmlStringLenDecodeEntities", &pyobj_ctxt, &str, &len, &what, &end, &end2, &end3)) - return(NULL); - ctxt = (xmlParserCtxtPtr) PyparserCtxt_Get(pyobj_ctxt); - - c_retval = xmlStringLenDecodeEntities(ctxt, str, len, what, end, end2, end3); - py_retval = libxml_xmlCharPtrWrap((xmlChar *) c_retval); - return(py_retval); -} - #if defined(LIBXML_UNICODE_ENABLED) PyObject * libxml_xmlUCSIsCJKUnifiedIdeographsExtensionA(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { @@ -8421,20 +8425,28 @@ libxml_xmlTextReaderSetSchema(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { } #endif /* defined(LIBXML_READER_ENABLED) && defined(LIBXML_SCHEMAS_ENABLED) */ +#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) PyObject * -libxml_xmlCharStrdup(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { +libxml_xmlUnsetNsProp(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { PyObject *py_retval; - xmlChar * c_retval; - char * cur; + int c_retval; + xmlNodePtr node; + PyObject *pyobj_node; + xmlNsPtr ns; + PyObject *pyobj_ns; + xmlChar * name; - if (!PyArg_ParseTuple(args, (char *)"z:xmlCharStrdup", &cur)) + if (!PyArg_ParseTuple(args, (char *)"OOz:xmlUnsetNsProp", &pyobj_node, &pyobj_ns, &name)) return(NULL); + node = (xmlNodePtr) PyxmlNode_Get(pyobj_node); + ns = (xmlNsPtr) PyxmlNode_Get(pyobj_ns); - c_retval = xmlCharStrdup(cur); - py_retval = libxml_xmlCharPtrWrap((xmlChar *) c_retval); + c_retval = xmlUnsetNsProp(node, ns, name); + py_retval = libxml_intWrap((int) c_retval); return(py_retval); } +#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) */ #if defined(LIBXML_OUTPUT_ENABLED) PyObject * libxml_xmlElemDump(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { @@ -9319,22 +9331,22 @@ libxml_xmlEncodeSpecialChars(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { return(py_retval); } +#if defined(LIBXML_UNICODE_ENABLED) PyObject * -libxml_namePop(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { +libxml_xmlUCSIsEthiopic(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { PyObject *py_retval; - const xmlChar * c_retval; - xmlParserCtxtPtr ctxt; - PyObject *pyobj_ctxt; + int c_retval; + int code; - if (!PyArg_ParseTuple(args, (char *)"O:namePop", &pyobj_ctxt)) + if (!PyArg_ParseTuple(args, (char *)"i:xmlUCSIsEthiopic", &code)) return(NULL); - ctxt = (xmlParserCtxtPtr) PyparserCtxt_Get(pyobj_ctxt); - c_retval = namePop(ctxt); - py_retval = libxml_xmlCharPtrConstWrap((const xmlChar *) c_retval); + c_retval = xmlUCSIsEthiopic(code); + py_retval = libxml_intWrap((int) c_retval); return(py_retval); } +#endif /* defined(LIBXML_UNICODE_ENABLED) */ PyObject * libxml_xmlParseContent(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { xmlParserCtxtPtr ctxt; @@ -9733,22 +9745,6 @@ libxml_xmlNodeAddContent(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { return(Py_None); } -PyObject * -libxml_xmlErrorGetLevel(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { - PyObject *py_retval; - int c_retval; - xmlErrorPtr Error; - PyObject *pyobj_Error; - - if (!PyArg_ParseTuple(args, (char *)"O:xmlErrorGetLevel", &pyobj_Error)) - return(NULL); - Error = (xmlErrorPtr) PyError_Get(pyobj_Error); - - c_retval = Error->level; - py_retval = libxml_intWrap((int) c_retval); - return(py_retval); -} - #if defined(LIBXML_XPATH_ENABLED) PyObject * libxml_xmlXPathNewParserContext(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { @@ -11866,22 +11862,22 @@ libxml_xmlInitGlobals(PyObject *self ATTRIBUTE_UNUSED, PyObject *args ATTRIBUTE_ return(Py_None); } -#if defined(LIBXML_UNICODE_ENABLED) PyObject * -libxml_xmlUCSIsEthiopic(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { +libxml_namePop(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { PyObject *py_retval; - int c_retval; - int code; + const xmlChar * c_retval; + xmlParserCtxtPtr ctxt; + PyObject *pyobj_ctxt; - if (!PyArg_ParseTuple(args, (char *)"i:xmlUCSIsEthiopic", &code)) + if (!PyArg_ParseTuple(args, (char *)"O:namePop", &pyobj_ctxt)) return(NULL); + ctxt = (xmlParserCtxtPtr) PyparserCtxt_Get(pyobj_ctxt); - c_retval = xmlUCSIsEthiopic(code); - py_retval = libxml_intWrap((int) c_retval); + c_retval = namePop(ctxt); + py_retval = libxml_xmlCharPtrConstWrap((const xmlChar *) c_retval); return(py_retval); } -#endif /* defined(LIBXML_UNICODE_ENABLED) */ #if defined(LIBXML_HTML_ENABLED) PyObject * libxml_htmlParseFile(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { @@ -12479,6 +12475,21 @@ libxml_xmlBuildRelativeURI(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { return(py_retval); } +PyObject * +libxml_xmlParseURIRaw(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { + PyObject *py_retval; + xmlURIPtr c_retval; + char * str; + int raw; + + if (!PyArg_ParseTuple(args, (char *)"zi:xmlParseURIRaw", &str, &raw)) + return(NULL); + + c_retval = xmlParseURIRaw(str, raw); + py_retval = libxml_xmlURIPtrWrap((xmlURIPtr) c_retval); + return(py_retval); +} + #if defined(LIBXML_CATALOG_ENABLED) PyObject * libxml_xmlACatalogResolvePublic(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { @@ -12514,17 +12525,13 @@ libxml_xmlThrDefParserDebugEntities(PyObject *self ATTRIBUTE_UNUSED, PyObject *a #if defined(LIBXML_CATALOG_ENABLED) PyObject * -libxml_xmlFreeCatalog(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { - xmlCatalogPtr catal; - PyObject *pyobj_catal; - - if (!PyArg_ParseTuple(args, (char *)"O:xmlFreeCatalog", &pyobj_catal)) - return(NULL); - catal = (xmlCatalogPtr) Pycatalog_Get(pyobj_catal); +libxml_xmlCatalogConvert(PyObject *self ATTRIBUTE_UNUSED, PyObject *args ATTRIBUTE_UNUSED) { + PyObject *py_retval; + int c_retval; - xmlFreeCatalog(catal); - Py_INCREF(Py_None); - return(Py_None); + c_retval = xmlCatalogConvert(); + py_retval = libxml_intWrap((int) c_retval); + return(py_retval); } #endif /* defined(LIBXML_CATALOG_ENABLED) */ @@ -13445,28 +13452,20 @@ libxml_xmlUTF8Strpos(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { return(py_retval); } -#if defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) PyObject * -libxml_xmlUnsetNsProp(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { +libxml_xmlCharStrdup(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { PyObject *py_retval; - int c_retval; - xmlNodePtr node; - PyObject *pyobj_node; - xmlNsPtr ns; - PyObject *pyobj_ns; - xmlChar * name; + xmlChar * c_retval; + char * cur; - if (!PyArg_ParseTuple(args, (char *)"OOz:xmlUnsetNsProp", &pyobj_node, &pyobj_ns, &name)) + if (!PyArg_ParseTuple(args, (char *)"z:xmlCharStrdup", &cur)) return(NULL); - node = (xmlNodePtr) PyxmlNode_Get(pyobj_node); - ns = (xmlNsPtr) PyxmlNode_Get(pyobj_ns); - c_retval = xmlUnsetNsProp(node, ns, name); - py_retval = libxml_intWrap((int) c_retval); + c_retval = xmlCharStrdup(cur); + py_retval = libxml_xmlCharPtrWrap((xmlChar *) c_retval); return(py_retval); } -#endif /* defined(LIBXML_TREE_ENABLED) || defined(LIBXML_SCHEMAS_ENABLED) */ #if defined(LIBXML_XPATH_ENABLED) PyObject * libxml_xmlXPathRegisterNs(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { @@ -13932,6 +13931,22 @@ libxml_xmlUCSIsAegeanNumbers(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { } #endif /* defined(LIBXML_UNICODE_ENABLED) */ +PyObject * +libxml_xmlErrorGetLevel(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { + PyObject *py_retval; + int c_retval; + xmlErrorPtr Error; + PyObject *pyobj_Error; + + if (!PyArg_ParseTuple(args, (char *)"O:xmlErrorGetLevel", &pyobj_Error)) + return(NULL); + Error = (xmlErrorPtr) PyError_Get(pyobj_Error); + + c_retval = Error->level; + py_retval = libxml_intWrap((int) c_retval); + return(py_retval); +} + PyObject * libxml_xmlCheckUTF8(PyObject *self ATTRIBUTE_UNUSED, PyObject *args) { PyObject *py_retval; diff --git a/python/setup.py b/python/setup.py index fd3154d..a02d80b 100755 --- a/python/setup.py +++ b/python/setup.py @@ -226,7 +226,7 @@ else: setup (name = "libxml2-python", # On *nix, the version number is created from setup.py.in # On windows, it is set by configure.js - version = "2.6.20", + version = "2.6.21", description = descr, author = "Daniel Veillard", author_email = "veillard@redhat.com", diff --git a/python/tests/Makefile.in b/python/tests/Makefile.in index a344e07..60338e4 100644 --- a/python/tests/Makefile.in +++ b/python/tests/Makefile.in @@ -152,6 +152,7 @@ TEST_PUSH = @TEST_PUSH@ TEST_REGEXPS = @TEST_REGEXPS@ TEST_SAX = @TEST_SAX@ TEST_SCHEMAS = @TEST_SCHEMAS@ +TEST_SCHEMATRON = @TEST_SCHEMATRON@ TEST_THREADS = @TEST_THREADS@ TEST_VALID = @TEST_VALID@ TEST_VTIME = @TEST_VTIME@ @@ -187,6 +188,7 @@ WITH_REGEXPS = @WITH_REGEXPS@ WITH_RUN_DEBUG = @WITH_RUN_DEBUG@ WITH_SAX1 = @WITH_SAX1@ WITH_SCHEMAS = @WITH_SCHEMAS@ +WITH_SCHEMATRON = @WITH_SCHEMATRON@ WITH_THREADS = @WITH_THREADS@ WITH_TREE = @WITH_TREE@ WITH_TRIO = @WITH_TRIO@ diff --git a/python/tests/tstLastError.py b/python/tests/tstLastError.py index 442609c..d26e82c 100755 --- a/python/tests/tstLastError.py +++ b/python/tests/tstLastError.py @@ -5,6 +5,10 @@ import libxml2 class TestCase(unittest.TestCase): + def runTest(self): + self.test1() + self.test2() + def setUp(self): libxml2.debugMemory(1) @@ -13,6 +17,8 @@ class TestCase(unittest.TestCase): if libxml2.debugMemory(1) != 0: libxml2.dumpMemory() self.fail("Memory leak %d bytes" % (libxml2.debugMemory(1),)) + else: + print "OK" def failUnlessXmlError(self,f,args,exc,domain,code,message,level,file,line): """Run function f, with arguments args and expect an exception exc; @@ -69,4 +75,8 @@ class TestCase(unittest.TestCase): line=3) if __name__ == "__main__": - unittest.main() + test = TestCase() + test.setUp() + test.test1() + test.test2() + test.tearDown() -- cgit v1.2.3