def browse_down(self, pane, alternate=False): """Browse into @leaf if it's possible and save away the previous sources in the stack if @alternate, use the Source's alternate method""" if pane is ActionPane: return # record used object if we browse down panectl = self._panectl_table[pane] sel, key = panectl.get_selection(), panectl.get_latest_key() if panectl.browse_down(alternate=alternate): learn.record_search_hit(sel, key)
def activate(self): """ Activate current selection """ leaf, action, sobject = self._get_current_command_objects() mode = self.mode try: ctx = self._execution_context res, ret = ctx.run(leaf, action, sobject) except commandexec.ActionExecutionError: 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")
def activate(self, ui_ctx): """ Activate current selection @ui_ctx: GUI environment context object """ leaf, action, sobject = self._get_current_command_objects() # 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) except commandexec.ActionExecutionError: self.output_exc() return if res not in commandexec.RESULTS_SYNC: self.emit("launched-action")