[kupfer] core: Register search hit (for learning) before carrying it out



commit 4b123e7b65d2b0e30852af73ca12d2b944726ffc
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date:   Tue Apr 12 00:46:45 2011 +0200

    core: Register search hit (for learning) before carrying it out

 kupfer/core/data.py |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)
---
diff --git a/kupfer/core/data.py b/kupfer/core/data.py
index 5fc0d32..652835f 100644
--- a/kupfer/core/data.py
+++ b/kupfer/core/data.py
@@ -786,7 +786,13 @@ class DataController (gobject.GObject, pretty.OutputMixin):
 		@ui_ctx: GUI environment context object
 		"""
 		leaf, action, sobject = self._get_current_command_objects()
-		mode = self.mode
+
+		# register search to learning database
+		learn.record_search_hit(leaf, self.source_pane.get_latest_key())
+		learn.record_search_hit(action, self.action_pane.get_latest_key())
+		if sobject and self.mode is SourceActionObjectMode:
+			learn.record_search_hit(sobject, self.object_pane.get_latest_key())
+
 		try:
 			ctx = self._execution_context
 			res, ret = ctx.run(leaf, action, sobject, ui_ctx=ui_ctx)
@@ -794,11 +800,6 @@ class DataController (gobject.GObject, pretty.OutputMixin):
 			self.output_exc()
 			return
 
-		# register search to learning database
-		learn.record_search_hit(leaf, self.source_pane.get_latest_key())
-		learn.record_search_hit(action, self.action_pane.get_latest_key())
-		if sobject and mode is SourceActionObjectMode:
-			learn.record_search_hit(sobject, self.object_pane.get_latest_key())
 		if res not in commandexec.RESULTS_SYNC:
 			self.emit("launched-action")
 



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