[pypy-svn] r55314 - pypy/dist/pypy/lib
fijal at codespeak.net
fijal at codespeak.net
Tue May 27 19:57:53 CEST 2008
Author: fijal
Date: Tue May 27 19:57:52 2008
New Revision: 55314
Modified:
pypy/dist/pypy/lib/pyexpat.py
Log:
Few constants and one method
Modified: pypy/dist/pypy/lib/pyexpat.py
==============================================================================
--- pypy/dist/pypy/lib/pyexpat.py (original)
+++ pypy/dist/pypy/lib/pyexpat.py Tue May 27 19:57:52 2008
@@ -16,10 +16,14 @@
XML_Char = configure.SimpleType('XML_Char', ctypes.c_char)
XML_COMBINED_VERSION = configure.ConstantInteger('XML_COMBINED_VERSION')
+ for name in ['XML_PARAM_ENTITY_PARSING_NEVER',
+ 'XML_PARAM_ENTITY_PARSING_UNLESS_STANDALONE',
+ 'XML_PARAM_ENTITY_PARSING_ALWAYS']:
+ locals()[name] = configure.ConstantInteger(name)
info = configure.configure(CConfigure)
-XML_Char = info['XML_Char']
-XML_COMBINED_VERSION = info['XML_COMBINED_VERSION']
+for k, v in info.items():
+ globals()[k] = v
XML_Parser = ctypes.c_void_p # an opaque pointer
assert XML_Char is ctypes.c_char # this assumption is everywhere in
# cpython's expat, let's explode
@@ -45,6 +49,9 @@
XML_GetSpecifiedAttributeCount = lib.XML_GetSpecifiedAttributeCount
XML_GetSpecifiedAttributeCount.args = [XML_Parser]
XML_GetSpecifiedAttributeCount.result = c_int
+XML_SetParamEntityParsing = lib.XML_SetParamEntityParsing
+XML_SetParamEntityParsing.args = [XML_Parser, c_int]
+XML_SetParamEntityParsing.result = None
handler_names = [
'StartElement',
@@ -254,6 +261,7 @@
('XmlDeclHandler', [None, c_void_p, c_char_p, c_char_p, c_int]),
('AttlistDeclHandler', [None, c_void_p] + [c_char_p] * 4 + [c_int]),
('EndDoctypeDeclHandler', 0),
+ ('SkippedEntityHandler', [None, c_void_p, c_char_p, c_int]),
]:
if isinstance(num_or_sign, int):
sign = [None, c_void_p] + [c_char_p] * num_or_sign
@@ -299,6 +307,9 @@
else:
self.__dict__[name] = value
+ def SetParamEntityParsing(self, arg):
+ XML_SetParamEntityParsing(self.itself, arg)
+
def __getattr__(self, name):
if name == 'buffer_text':
return self.buffer is not None
@@ -312,7 +323,7 @@
def ErrorString(errno):
xxx
-def ParserCreate(encoding=None, namespace_separator=None):
+def ParserCreate(encoding=None, namespace_separator=None, intern=None):
if (not isinstance(namespace_separator, str) and
not namespace_separator is None):
raise TypeError("ParserCreate() argument 2 must be string or None, not %s" % namespace_separator.__class__.__name__)
More information about the Pypy-commit
mailing list