def __init__(self): super(DataController, self).__init__() self.source_pane = LeafPane() self.object_pane = SecondaryObjectPane() self.source_pane.connect("new-source", self._new_source) self.object_pane.connect("new-source", self._new_source) self.action_pane = PrimaryActionPane() self._panectl_table = { SourcePane: self.source_pane, ActionPane: self.action_pane, ObjectPane: self.object_pane, } for pane, ctl in self._panectl_table.items(): ctl.connect("search-result", self._pane_search_result, pane) self.mode = None self._search_ids = itertools.count(1) self._latest_interaction = -1 self._execution_context = commandexec.DefaultActionExecutionContext() self._execution_context.connect("command-result", self._command_execution_result) self._execution_context.connect("late-command-result", self._late_command_execution_result) self._save_data_timer = scheduler.Timer() sch = scheduler.GetScheduler() sch.connect("load", self._load) sch.connect("display", self._display) sch.connect("finish", self._finish)
def keybinding_callback(self, keyobj, target, display, event_time): if not self.has_trigger(target): return ui_ctx = uievents.gui_context_from_keyevent(event_time, display) ctx = commandexec.DefaultActionExecutionContext() exec_token = ctx.make_execution_token(ui_ctx) self.perform_trigger(exec_token, target)
def get_items(self): ctx = commandexec.DefaultActionExecutionContext() for x in reversed(ctx.last_results): yield x try: leaf = ctx.last_results[-1] except IndexError: return yield _make_first_result_object(leaf)
def get_items(self): ctx = commandexec.DefaultActionExecutionContext() if ctx.last_command is None: return yield LastCommand(ctx.last_command)