comparison genshi/path.py @ 958:6fc92535c888 experimental-performance-improvement-exploration

Be more careful about what is passed into streams as events and remove many uses of _ensure as a result. An ATTRS event is added for handling Attributes returned by gensh.path.select().
author hodgestar
date Tue, 13 Mar 2012 03:03:02 +0000
parents 16d55698006a
children
comparison
equal deleted inserted replaced
957:51ab60299647 958:6fc92535c888
591 elif subevent[0] is END: 591 elif subevent[0] is END:
592 depth -= 1 592 depth -= 1
593 yield subevent 593 yield subevent
594 test(subevent, ns, vs, updateonly=True) 594 test(subevent, ns, vs, updateonly=True)
595 elif result: 595 elif result:
596 # check for Attrs and wrap them in an ATTRS event
597 # if found
598 if hasattr(result, 'toevent'):
599 result = result.toevent()
596 yield result 600 yield result
597 return Stream(_generate(), 601 return Stream(_generate(),
598 serializer=getattr(stream, 'serializer', None)) 602 serializer=getattr(stream, 'serializer', None))
599 603
600 def test(self, ignore_context=False): 604 def test(self, ignore_context=False):
Copyright (C) 2012-2017 Edgewall Software