summaryrefslogtreecommitdiff
path: root/qpid/python/mllib
diff options
context:
space:
mode:
authorRafael H. Schloming <rhs@apache.org>2008-03-22 23:05:17 +0000
committerRafael H. Schloming <rhs@apache.org>2008-03-22 23:05:17 +0000
commitdca5c9779cf1671156931a7c50641162908b0ce0 (patch)
tree4fe45def019dc3304e3b83411d05fdb0e8cb1e8e /qpid/python/mllib
parentd9b21443f079df3ceabb56af19312c658f2312e6 (diff)
downloadqpid-python-dca5c9779cf1671156931a7c50641162908b0ce0.tar.gz
Made dom query results addable per QPID-870.
git-svn-id: https://svn.apache.org/repos/asf/incubator/qpid/trunk@640117 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'qpid/python/mllib')
-rw-r--r--qpid/python/mllib/dom.py19
1 files changed, 18 insertions, 1 deletions
diff --git a/qpid/python/mllib/dom.py b/qpid/python/mllib/dom.py
index 7c759dbdd5..df2b88322a 100644
--- a/qpid/python/mllib/dom.py
+++ b/qpid/python/mllib/dom.py
@@ -185,7 +185,24 @@ class Comment(Leaf):
## 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