Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
path: root/plotter/view/puzzletree/nodes/addition.py
diff options
context:
space:
mode:
Diffstat (limited to 'plotter/view/puzzletree/nodes/addition.py')
-rwxr-xr-xplotter/view/puzzletree/nodes/addition.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/plotter/view/puzzletree/nodes/addition.py b/plotter/view/puzzletree/nodes/addition.py
new file mode 100755
index 0000000..d6b37dc
--- /dev/null
+++ b/plotter/view/puzzletree/nodes/addition.py
@@ -0,0 +1,19 @@
+
+from .binaryoperator import BinaryOperator as _BinaryOperator
+from gettext import gettext as _
+
+
+class Addition(_BinaryOperator):
+ """Addition is a BinaryOperator that adds its two children together."""
+
+ CLASS = "addition"
+ background = _BinaryOperator.loadbackground("addition.svg")
+ operatorstring = "+"
+ title = _("Addition")
+ description = _("Combines two objects together into a larger collection."
+ " For example, x + x = 2x.")
+
+ def __call__(self, x):
+ """Returns self's leftchild(x) + rightchild(x)."""
+ return self.children[0](x) + self.children[1](x)
+