From 09deb06614c3408ec0816a3c88920138bae2083c Mon Sep 17 00:00:00 2001 From: Mike Hommey Date: Fri, 10 Sep 2004 05:26:00 +0000 Subject: Load /tmp/tmp.BmUFjT/libxml2-2.6.13 into packages/libxml2/branches/upstream/current. --- python/libxml.py | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) (limited to 'python/libxml.py') diff --git a/python/libxml.py b/python/libxml.py index 5980974..1036bd9 100644 --- a/python/libxml.py +++ b/python/libxml.py @@ -82,19 +82,19 @@ class ioWriteWrapper(ioWrapper): def __init__(self, _obj, enc = ""): # print "ioWriteWrapper.__init__", _obj if type(_obj) == type(''): - print "write io from a string" - self.o = None - elif type(_obj) == types.InstanceType: - print "write io from instance of %s" % (_obj.__class__) - ioWrapper.__init__(self, _obj) - self._o = libxml2mod.xmlCreateOutputBuffer(self, enc) - else: - file = libxml2mod.outputBufferGetPythonFile(_obj) - if file != None: - ioWrapper.__init__(self, file) - else: - ioWrapper.__init__(self, _obj) - self._o = _obj + print "write io from a string" + self.o = None + elif type(_obj) == types.InstanceType: + print "write io from instance of %s" % (_obj.__class__) + ioWrapper.__init__(self, _obj) + self._o = libxml2mod.xmlCreateOutputBuffer(self, enc) + else: + file = libxml2mod.outputBufferGetPythonFile(_obj) + if file != None: + ioWrapper.__init__(self, file) + else: + ioWrapper.__init__(self, _obj) + self._o = _obj def __del__(self): # print "__del__" @@ -488,19 +488,19 @@ class xmlCoreBreadthFirstItertor: # def nodeWrap(o): # TODO try to cast to the most appropriate node class - name = libxml2mod.name(o) + name = libxml2mod.type(o) if name == "element" or name == "text": return xmlNode(_obj=o) if name == "attribute": return xmlAttr(_obj=o) if name[0:8] == "document": return xmlDoc(_obj=o) - if name[0:8] == "namespace": + if name == "namespace": return xmlNs(_obj=o) if name == "elem_decl": return xmlElement(_obj=o) if name == "attribute_decl": - return xmlAtribute(_obj=o) + return xmlAttribute(_obj=o) if name == "entity_decl": return xmlEntity(_obj=o) if name == "dtd": -- cgit v1.2.3