[kupfer] higherorder: Extra actions for triggers and similar



commit 96a6764114e204cac38d9567eaa446b5aa9daec2
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date:   Mon Jan 11 02:49:09 2010 +0100

    higherorder: Extra actions for triggers and similar
    
    We start with an action "Select in Kupfer": it only makes sense in
    Triggers or delayed commands. With it, you can make a trigger to
    show Kupfer, with a particular object selected. It is much like the
    "magic keybinding" for current selection, but for any object.

 kupfer/plugin/higherorder.py |   21 +++++++++++++++++++++
 1 files changed, 21 insertions(+), 0 deletions(-)
---
diff --git a/kupfer/plugin/higherorder.py b/kupfer/plugin/higherorder.py
new file mode 100644
index 0000000..b2ec548
--- /dev/null
+++ b/kupfer/plugin/higherorder.py
@@ -0,0 +1,21 @@
+from kupfer.objects import Action, Leaf
+
+__kupfer_name__ = _("Higher-order Actions")
+__kupfer_actions__ = (
+	"Select",
+)
+__description__ = _("Tools to work with Kupfer commands as objects")
+__version__ = "2010-01-11"
+__author__ = "Ulrik Sverdrup <ulrik sverdrup gmail com>"
+
+class Select (Action):
+	rank_adjust = -15
+	def __init__(self):
+		Action.__init__(self, _("Select in Kupfer"))
+
+	def has_result(self):
+		return True
+	def activate(self, leaf):
+		return leaf
+	def item_types(self):
+		yield Leaf



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]