fix for bug #18

This commit is contained in:
Nathan Fritz 2010-03-24 16:03:16 -07:00
parent d4a490e3f0
commit 95d2614f21

View file

@ -44,7 +44,6 @@ class ElementBase(tostring.ToString):
subitem = None subitem = None
def __init__(self, xml=None, parent=None): def __init__(self, xml=None, parent=None):
self.attrib = self # backwards compatibility hack
self.parent = parent self.parent = parent
self.xml = xml self.xml = xml
self.plugins = {} self.plugins = {}
@ -57,6 +56,11 @@ class ElementBase(tostring.ToString):
if self.subitem is not None and child.tag == "{%s}%s" % (self.subitem.namespace, self.subitem.name): if self.subitem is not None and child.tag == "{%s}%s" % (self.subitem.namespace, self.subitem.name):
self.iterables.append(self.subitem(xml=child, parent=self)) self.iterables.append(self.subitem(xml=child, parent=self))
def _getattrib(self):
return self
attrib = property(_getattrib) # backwards compatibility
def __iter__(self): def __iter__(self):
self.idx = 0 self.idx = 0
return self return self