lxml 6.0.0__cp313-cp313-manylinux_2_31_armv7l.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- lxml/ElementInclude.py +244 -0
- lxml/__init__.py +22 -0
- lxml/_elementpath.cpython-313-arm-linux-gnueabihf.so +0 -0
- lxml/_elementpath.py +343 -0
- lxml/apihelpers.pxi +1801 -0
- lxml/builder.cpython-313-arm-linux-gnueabihf.so +0 -0
- lxml/builder.py +243 -0
- lxml/classlookup.pxi +580 -0
- lxml/cleanup.pxi +215 -0
- lxml/cssselect.py +101 -0
- lxml/debug.pxi +36 -0
- lxml/docloader.pxi +178 -0
- lxml/doctestcompare.py +488 -0
- lxml/dtd.pxi +479 -0
- lxml/etree.cpython-313-arm-linux-gnueabihf.so +0 -0
- lxml/etree.h +244 -0
- lxml/etree.pyx +3853 -0
- lxml/etree_api.h +204 -0
- lxml/extensions.pxi +830 -0
- lxml/html/ElementSoup.py +10 -0
- lxml/html/__init__.py +1927 -0
- lxml/html/_diffcommand.py +86 -0
- lxml/html/_difflib.cpython-313-arm-linux-gnueabihf.so +0 -0
- lxml/html/_difflib.py +2106 -0
- lxml/html/_html5builder.py +100 -0
- lxml/html/_setmixin.py +56 -0
- lxml/html/builder.py +173 -0
- lxml/html/clean.py +21 -0
- lxml/html/defs.py +135 -0
- lxml/html/diff.cpython-313-arm-linux-gnueabihf.so +0 -0
- lxml/html/diff.py +972 -0
- lxml/html/formfill.py +299 -0
- lxml/html/html5parser.py +260 -0
- lxml/html/soupparser.py +314 -0
- lxml/html/usedoctest.py +13 -0
- lxml/includes/__init__.pxd +0 -0
- lxml/includes/__init__.py +0 -0
- lxml/includes/c14n.pxd +25 -0
- lxml/includes/config.pxd +3 -0
- lxml/includes/dtdvalid.pxd +18 -0
- lxml/includes/etree_defs.h +379 -0
- lxml/includes/etreepublic.pxd +237 -0
- lxml/includes/extlibs/__init__.py +0 -0
- lxml/includes/extlibs/libcharset.h +45 -0
- lxml/includes/extlibs/localcharset.h +137 -0
- lxml/includes/extlibs/zconf.h +543 -0
- lxml/includes/extlibs/zlib.h +1938 -0
- lxml/includes/htmlparser.pxd +56 -0
- lxml/includes/libexslt/__init__.py +0 -0
- lxml/includes/libexslt/exslt.h +108 -0
- lxml/includes/libexslt/exsltconfig.h +70 -0
- lxml/includes/libexslt/exsltexports.h +63 -0
- lxml/includes/libxml/HTMLparser.h +339 -0
- lxml/includes/libxml/HTMLtree.h +148 -0
- lxml/includes/libxml/SAX.h +18 -0
- lxml/includes/libxml/SAX2.h +170 -0
- lxml/includes/libxml/__init__.py +0 -0
- lxml/includes/libxml/c14n.h +115 -0
- lxml/includes/libxml/catalog.h +183 -0
- lxml/includes/libxml/chvalid.h +230 -0
- lxml/includes/libxml/debugXML.h +79 -0
- lxml/includes/libxml/dict.h +82 -0
- lxml/includes/libxml/encoding.h +307 -0
- lxml/includes/libxml/entities.h +147 -0
- lxml/includes/libxml/globals.h +25 -0
- lxml/includes/libxml/hash.h +251 -0
- lxml/includes/libxml/list.h +137 -0
- lxml/includes/libxml/nanoftp.h +16 -0
- lxml/includes/libxml/nanohttp.h +98 -0
- lxml/includes/libxml/parser.h +1633 -0
- lxml/includes/libxml/parserInternals.h +591 -0
- lxml/includes/libxml/relaxng.h +224 -0
- lxml/includes/libxml/schemasInternals.h +959 -0
- lxml/includes/libxml/schematron.h +143 -0
- lxml/includes/libxml/threads.h +81 -0
- lxml/includes/libxml/tree.h +1326 -0
- lxml/includes/libxml/uri.h +106 -0
- lxml/includes/libxml/valid.h +485 -0
- lxml/includes/libxml/xinclude.h +141 -0
- lxml/includes/libxml/xlink.h +193 -0
- lxml/includes/libxml/xmlIO.h +419 -0
- lxml/includes/libxml/xmlautomata.h +163 -0
- lxml/includes/libxml/xmlerror.h +962 -0
- lxml/includes/libxml/xmlexports.h +96 -0
- lxml/includes/libxml/xmlmemory.h +188 -0
- lxml/includes/libxml/xmlmodule.h +61 -0
- lxml/includes/libxml/xmlreader.h +444 -0
- lxml/includes/libxml/xmlregexp.h +116 -0
- lxml/includes/libxml/xmlsave.h +111 -0
- lxml/includes/libxml/xmlschemas.h +254 -0
- lxml/includes/libxml/xmlschemastypes.h +152 -0
- lxml/includes/libxml/xmlstring.h +140 -0
- lxml/includes/libxml/xmlunicode.h +15 -0
- lxml/includes/libxml/xmlversion.h +332 -0
- lxml/includes/libxml/xmlwriter.h +489 -0
- lxml/includes/libxml/xpath.h +569 -0
- lxml/includes/libxml/xpathInternals.h +639 -0
- lxml/includes/libxml/xpointer.h +48 -0
- lxml/includes/libxslt/__init__.py +0 -0
- lxml/includes/libxslt/attributes.h +39 -0
- lxml/includes/libxslt/documents.h +93 -0
- lxml/includes/libxslt/extensions.h +262 -0
- lxml/includes/libxslt/extra.h +72 -0
- lxml/includes/libxslt/functions.h +78 -0
- lxml/includes/libxslt/imports.h +75 -0
- lxml/includes/libxslt/keys.h +53 -0
- lxml/includes/libxslt/namespaces.h +68 -0
- lxml/includes/libxslt/numbersInternals.h +73 -0
- lxml/includes/libxslt/pattern.h +84 -0
- lxml/includes/libxslt/preproc.h +43 -0
- lxml/includes/libxslt/security.h +104 -0
- lxml/includes/libxslt/templates.h +77 -0
- lxml/includes/libxslt/transform.h +207 -0
- lxml/includes/libxslt/variables.h +118 -0
- lxml/includes/libxslt/xslt.h +110 -0
- lxml/includes/libxslt/xsltInternals.h +1995 -0
- lxml/includes/libxslt/xsltconfig.h +146 -0
- lxml/includes/libxslt/xsltexports.h +64 -0
- lxml/includes/libxslt/xsltlocale.h +44 -0
- lxml/includes/libxslt/xsltutils.h +343 -0
- lxml/includes/lxml-version.h +3 -0
- lxml/includes/relaxng.pxd +64 -0
- lxml/includes/schematron.pxd +34 -0
- lxml/includes/tree.pxd +492 -0
- lxml/includes/uri.pxd +5 -0
- lxml/includes/xinclude.pxd +22 -0
- lxml/includes/xmlerror.pxd +852 -0
- lxml/includes/xmlparser.pxd +303 -0
- lxml/includes/xmlschema.pxd +35 -0
- lxml/includes/xpath.pxd +136 -0
- lxml/includes/xslt.pxd +190 -0
- lxml/isoschematron/__init__.py +348 -0
- lxml/isoschematron/resources/rng/iso-schematron.rng +709 -0
- lxml/isoschematron/resources/xsl/RNG2Schtrn.xsl +75 -0
- lxml/isoschematron/resources/xsl/XSD2Schtrn.xsl +77 -0
- lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_abstract_expand.xsl +313 -0
- lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_dsdl_include.xsl +1160 -0
- lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_message.xsl +55 -0
- lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_schematron_skeleton_for_xslt1.xsl +1796 -0
- lxml/isoschematron/resources/xsl/iso-schematron-xslt1/iso_svrl_for_xslt1.xsl +588 -0
- lxml/isoschematron/resources/xsl/iso-schematron-xslt1/readme.txt +84 -0
- lxml/iterparse.pxi +438 -0
- lxml/lxml.etree.h +244 -0
- lxml/lxml.etree_api.h +204 -0
- lxml/nsclasses.pxi +281 -0
- lxml/objectify.cpython-313-arm-linux-gnueabihf.so +0 -0
- lxml/objectify.pyx +2149 -0
- lxml/objectpath.pxi +332 -0
- lxml/parser.pxi +2059 -0
- lxml/parsertarget.pxi +180 -0
- lxml/proxy.pxi +619 -0
- lxml/public-api.pxi +178 -0
- lxml/pyclasslookup.py +3 -0
- lxml/readonlytree.pxi +565 -0
- lxml/relaxng.pxi +165 -0
- lxml/sax.cpython-313-arm-linux-gnueabihf.so +0 -0
- lxml/sax.py +286 -0
- lxml/saxparser.pxi +875 -0
- lxml/schematron.pxi +173 -0
- lxml/serializer.pxi +1849 -0
- lxml/usedoctest.py +13 -0
- lxml/xinclude.pxi +67 -0
- lxml/xmlerror.pxi +1654 -0
- lxml/xmlid.pxi +179 -0
- lxml/xmlschema.pxi +215 -0
- lxml/xpath.pxi +487 -0
- lxml/xslt.pxi +957 -0
- lxml/xsltext.pxi +242 -0
- lxml-6.0.0.dist-info/METADATA +163 -0
- lxml-6.0.0.dist-info/RECORD +174 -0
- lxml-6.0.0.dist-info/WHEEL +5 -0
- lxml-6.0.0.dist-info/licenses/LICENSE.txt +31 -0
- lxml-6.0.0.dist-info/licenses/LICENSES.txt +29 -0
- lxml-6.0.0.dist-info/top_level.txt +1 -0
lxml/parsertarget.pxi
ADDED
@@ -0,0 +1,180 @@
|
|
1
|
+
# Parser target context (ET target interface)
|
2
|
+
|
3
|
+
cdef object inspect_getargspec
|
4
|
+
try:
|
5
|
+
from inspect import getfullargspec as inspect_getargspec
|
6
|
+
except ImportError:
|
7
|
+
from inspect import getargspec as inspect_getargspec
|
8
|
+
|
9
|
+
|
10
|
+
class _TargetParserResult(Exception):
|
11
|
+
# Admittedly, this is somewhat ugly, but it's the easiest way
|
12
|
+
# to push the Python level parser result through the parser
|
13
|
+
# machinery towards the API level functions
|
14
|
+
def __init__(self, result):
|
15
|
+
self.result = result
|
16
|
+
|
17
|
+
|
18
|
+
@cython.final
|
19
|
+
@cython.internal
|
20
|
+
cdef class _PythonSaxParserTarget(_SaxParserTarget):
|
21
|
+
cdef object _target_start
|
22
|
+
cdef object _target_end
|
23
|
+
cdef object _target_data
|
24
|
+
cdef object _target_start_ns
|
25
|
+
cdef object _target_end_ns
|
26
|
+
cdef object _target_doctype
|
27
|
+
cdef object _target_pi
|
28
|
+
cdef object _target_comment
|
29
|
+
cdef bint _start_takes_nsmap
|
30
|
+
|
31
|
+
def __cinit__(self, target):
|
32
|
+
cdef int event_filter
|
33
|
+
event_filter = 0
|
34
|
+
self._start_takes_nsmap = 0
|
35
|
+
try:
|
36
|
+
self._target_start = target.start
|
37
|
+
if self._target_start is not None:
|
38
|
+
event_filter |= SAX_EVENT_START
|
39
|
+
except AttributeError:
|
40
|
+
pass
|
41
|
+
else:
|
42
|
+
try:
|
43
|
+
arguments = inspect_getargspec(self._target_start)
|
44
|
+
if len(arguments[0]) > 3 or arguments[1] is not None:
|
45
|
+
self._start_takes_nsmap = 1
|
46
|
+
except TypeError:
|
47
|
+
pass
|
48
|
+
try:
|
49
|
+
self._target_end = target.end
|
50
|
+
if self._target_end is not None:
|
51
|
+
event_filter |= SAX_EVENT_END
|
52
|
+
except AttributeError:
|
53
|
+
pass
|
54
|
+
try:
|
55
|
+
self._target_start_ns = target.start_ns
|
56
|
+
if self._target_start_ns is not None:
|
57
|
+
event_filter |= SAX_EVENT_START_NS
|
58
|
+
except AttributeError:
|
59
|
+
pass
|
60
|
+
try:
|
61
|
+
self._target_end_ns = target.end_ns
|
62
|
+
if self._target_end_ns is not None:
|
63
|
+
event_filter |= SAX_EVENT_END_NS
|
64
|
+
except AttributeError:
|
65
|
+
pass
|
66
|
+
try:
|
67
|
+
self._target_data = target.data
|
68
|
+
if self._target_data is not None:
|
69
|
+
event_filter |= SAX_EVENT_DATA
|
70
|
+
except AttributeError:
|
71
|
+
pass
|
72
|
+
try:
|
73
|
+
self._target_doctype = target.doctype
|
74
|
+
if self._target_doctype is not None:
|
75
|
+
event_filter |= SAX_EVENT_DOCTYPE
|
76
|
+
except AttributeError:
|
77
|
+
pass
|
78
|
+
try:
|
79
|
+
self._target_pi = target.pi
|
80
|
+
if self._target_pi is not None:
|
81
|
+
event_filter |= SAX_EVENT_PI
|
82
|
+
except AttributeError:
|
83
|
+
pass
|
84
|
+
try:
|
85
|
+
self._target_comment = target.comment
|
86
|
+
if self._target_comment is not None:
|
87
|
+
event_filter |= SAX_EVENT_COMMENT
|
88
|
+
except AttributeError:
|
89
|
+
pass
|
90
|
+
self._sax_event_filter = event_filter
|
91
|
+
|
92
|
+
cdef _handleSaxStart(self, tag, attrib, nsmap):
|
93
|
+
if self._start_takes_nsmap:
|
94
|
+
return self._target_start(tag, attrib, nsmap)
|
95
|
+
else:
|
96
|
+
return self._target_start(tag, attrib)
|
97
|
+
|
98
|
+
cdef _handleSaxEnd(self, tag):
|
99
|
+
return self._target_end(tag)
|
100
|
+
|
101
|
+
cdef _handleSaxStartNs(self, prefix, uri):
|
102
|
+
return self._target_start_ns(prefix, uri)
|
103
|
+
|
104
|
+
cdef _handleSaxEndNs(self, prefix):
|
105
|
+
return self._target_end_ns(prefix)
|
106
|
+
|
107
|
+
cdef int _handleSaxData(self, data) except -1:
|
108
|
+
self._target_data(data)
|
109
|
+
|
110
|
+
cdef int _handleSaxDoctype(self, root_tag, public_id, system_id) except -1:
|
111
|
+
self._target_doctype(root_tag, public_id, system_id)
|
112
|
+
|
113
|
+
cdef _handleSaxPi(self, target, data):
|
114
|
+
return self._target_pi(target, data)
|
115
|
+
|
116
|
+
cdef _handleSaxComment(self, comment):
|
117
|
+
return self._target_comment(comment)
|
118
|
+
|
119
|
+
|
120
|
+
@cython.final
|
121
|
+
@cython.internal
|
122
|
+
@cython.no_gc_clear # Required because parent class uses it - Cython bug.
|
123
|
+
cdef class _TargetParserContext(_SaxParserContext):
|
124
|
+
"""This class maps SAX2 events to the ET parser target interface.
|
125
|
+
"""
|
126
|
+
cdef object _python_target
|
127
|
+
cdef int _setTarget(self, target) except -1:
|
128
|
+
self._python_target = target
|
129
|
+
if not isinstance(target, _SaxParserTarget) or \
|
130
|
+
hasattr(target, '__dict__'):
|
131
|
+
target = _PythonSaxParserTarget(target)
|
132
|
+
self._setSaxParserTarget(target)
|
133
|
+
return 0
|
134
|
+
|
135
|
+
cdef _ParserContext _copy(self):
|
136
|
+
cdef _TargetParserContext context
|
137
|
+
context = _ParserContext._copy(self)
|
138
|
+
context._setTarget(self._python_target)
|
139
|
+
return context
|
140
|
+
|
141
|
+
cdef void _cleanupTargetParserContext(self, xmlDoc* result) noexcept:
|
142
|
+
if self._c_ctxt.myDoc is not NULL:
|
143
|
+
if self._c_ctxt.myDoc is not result and \
|
144
|
+
self._c_ctxt.myDoc._private is NULL:
|
145
|
+
# no _Document proxy => orphen
|
146
|
+
tree.xmlFreeDoc(self._c_ctxt.myDoc)
|
147
|
+
self._c_ctxt.myDoc = NULL
|
148
|
+
|
149
|
+
cdef object _handleParseResult(self, _BaseParser parser, xmlDoc* result,
|
150
|
+
filename):
|
151
|
+
cdef bint recover
|
152
|
+
recover = parser._parse_options & xmlparser.XML_PARSE_RECOVER
|
153
|
+
try:
|
154
|
+
if self._has_raised():
|
155
|
+
self._cleanupTargetParserContext(result)
|
156
|
+
self._raise_if_stored()
|
157
|
+
if not self._c_ctxt.wellFormed and not recover:
|
158
|
+
_raiseParseError(self._c_ctxt, filename, self._error_log)
|
159
|
+
except:
|
160
|
+
self._python_target.close()
|
161
|
+
raise
|
162
|
+
return self._python_target.close()
|
163
|
+
|
164
|
+
cdef xmlDoc* _handleParseResultDoc(self, _BaseParser parser,
|
165
|
+
xmlDoc* result, filename) except NULL:
|
166
|
+
cdef bint recover
|
167
|
+
recover = parser._parse_options & xmlparser.XML_PARSE_RECOVER
|
168
|
+
if result is not NULL and result._private is NULL:
|
169
|
+
# no _Document proxy => orphen
|
170
|
+
tree.xmlFreeDoc(result)
|
171
|
+
try:
|
172
|
+
self._cleanupTargetParserContext(result)
|
173
|
+
self._raise_if_stored()
|
174
|
+
if not self._c_ctxt.wellFormed and not recover:
|
175
|
+
_raiseParseError(self._c_ctxt, filename, self._error_log)
|
176
|
+
except:
|
177
|
+
self._python_target.close()
|
178
|
+
raise
|
179
|
+
parse_result = self._python_target.close()
|
180
|
+
raise _TargetParserResult(parse_result)
|