Author: rhs
Date: Sat Mar 22 16:05:17 2008
New Revision: 640117
URL: http://svn.apache.org/viewvc?rev=640117&view=rev
Log:
Made dom query results addable per QPID-870.
Modified:
incubator/qpid/trunk/qpid/python/mllib/dom.py
Modified: incubator/qpid/trunk/qpid/python/mllib/dom.py
URL:
http://svn.apache.org/viewvc/incubator/qpid/trunk/qpid/python/mllib/dom.py?rev=640117&r1=640116&r2=640117&view=diff
==============================================================================
--- incubator/qpid/trunk/qpid/python/mllib/dom.py (original)
+++ incubator/qpid/trunk/qpid/python/mllib/dom.py Sat Mar 22 16:05:17 2008
@@ -185,7 +185,24 @@
## Query Classes ##
###########################################################################
-class View:
+class Adder:
+
+ def __add__(self, other):
+ return Sum(self, other)
+
+class Sum(Adder):
+
+ def __init__(self, left, right):
+ self.left = left
+ self.right = right
+
+ def __iter__(self):
+ for x in self.left:
+ yield x
+ for x in self.right:
+ yield x
+
+class View(Adder):
def __init__(self, source):
self.source = source