[kupfer] higherorder: Use commandexec functions
- From: Ulrik Sverdrup <usverdrup src gnome org>
- To: svn-commits-list gnome org
- Cc:
- Subject: [kupfer] higherorder: Use commandexec functions
- Date: Tue, 12 Jan 2010 15:50:06 +0000 (UTC)
commit c60066a3067cbdfa48de5c25952d5c5ce97d2a8f
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date: Tue Jan 12 16:09:00 2010 +0100
higherorder: Use commandexec functions
kupfer/plugin/higherorder.py | 12 ++++--------
1 files changed, 4 insertions(+), 8 deletions(-)
---
diff --git a/kupfer/plugin/higherorder.py b/kupfer/plugin/higherorder.py
index 4e37299..8ceac92 100644
--- a/kupfer/plugin/higherorder.py
+++ b/kupfer/plugin/higherorder.py
@@ -28,15 +28,11 @@ class Select (Action):
def _exec_no_show_result(composedleaf):
pretty.print_debug(__name__, "Evaluating command", composedleaf)
obj, action, iobj = composedleaf.object
- if iobj is None:
- ret = action.activate(obj)
- else:
- ret = action.activate(obj, iobj)
- if not ret:
- return None
- if action.has_result():
+ ret = commandexec.activate_action(*composedleaf.object)
+ result_type = commandexec.parse_action_result(action, ret)
+ if result_type == commandexec.RESULT_OBJECT:
return ret
- elif action.is_factory():
+ if result_type == commandexec.RESULT_SOURCE:
try:
return iter(ret.get_leaves()).next()
except StopIteration:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]