[Apply patch #500457 from the PyXML tracker]

Add iterator support to pulldom.DOMEventStream

New feature, so not a bugfix candidate (though it should be safe for inclusion)
This commit is contained in:
Andrew M. Kuchling 2002-03-20 23:56:34 +00:00
parent 3afb2d2bba
commit bdf1f19fee
1 changed files with 9 additions and 0 deletions

View File

@ -227,6 +227,15 @@ class DOMEventStream:
return rc
raise IndexError
def next(self):
rc = self.getEvent()
if rc:
return rc
raise StopIteration
def __iter__(self):
return self
def expandNode(self, node):
event = self.getEvent()
parents = [node]