fixed bug from duplicate append methods in stanzabase

This commit is contained in:
Nathan Fritz 2010-01-14 07:37:44 -08:00
parent 6e1aa0690f
commit 5345e9a46b

View file

@ -2,6 +2,8 @@ from xml.etree import cElementTree as ET
import logging
import traceback
xmltester = type(ET.Element('xml'))
class JID(object):
def __init__(self, jid):
self.jid = jid
@ -62,7 +64,10 @@ class ElementBase(object):
def append(self, item):
if not isinstance(item, ElementBase):
raise TypeError
if type(item) == xmltester:
return self.appendxml(item)
else:
raise TypeError
self.xml.append(item.xml)
self.iterables.append(item)
return self