[kupfer: 7/11] compose: Descriptions for ProxyDo and TimedDo actions
- From: Ulrik Sverdrup <usverdrup src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [kupfer: 7/11] compose: Descriptions for ProxyDo and TimedDo actions
- Date: Mon, 14 Dec 2009 20:10:56 +0000 (UTC)
commit e08711266fa0ccb5a0e0743eaa5e7e584c61c688
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date: Mon Dec 14 20:42:06 2009 +0100
compose: Descriptions for ProxyDo and TimedDo actions
Make proxy do a subclass of Do as part of this.
kupfer/objects.py | 12 ++++++------
1 files changed, 6 insertions(+), 6 deletions(-)
---
diff --git a/kupfer/objects.py b/kupfer/objects.py
index ebade57..86473f1 100644
--- a/kupfer/objects.py
+++ b/kupfer/objects.py
@@ -1049,7 +1049,7 @@ class Do (Action):
if not name: name = _("Do")
super(Do, self).__init__(name=name)
def activate(self, leaf):
- leaf.run()
+ return leaf.run()
def get_description(self):
return _("Perform action")
@@ -1111,18 +1111,15 @@ class TextSource (KupferObject):
"""A seq of the types of items it provides"""
yield Leaf
-class ProxyDo (Action):
+class ProxyDo (Do):
"""A proxy version of Do
Proxy factory/result/async from a delegate action
"""
def __init__(self, action):
- Action.__init__(self, _("Do"))
+ Do.__init__(self, _("Do"))
self.action = action
- def activate(self, leaf, obj=None):
- return leaf.run()
-
def is_factory(self):
return self.action.is_factory()
def has_result(self):
@@ -1159,6 +1156,9 @@ class TimedDo (Do):
interval = utils.parse_time_interval(iobj.object)
return interval > 0
+ def get_description(self):
+ return _("Perform command after a specified time interval")
+
class ComposedLeaf (RunnableLeaf):
def __init__(self, obj, action, iobj=None):
object_ = (obj, action, iobj)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]