def item(self): return ShortcutResultItem('kw', 'name', 'http://site/?q=%s', 'icon_path', is_default_search=True, run_without_argument=False)
def handle_query(self, query): """ @return Action object """ shortcut = self._get_active_shortcut(query) if not shortcut: raise Exception('No active shortcut. This line should not be entered') return RenderResultListAction([ShortcutResultItem(**shortcut)])
def test_on_enter__run_file(self, ActionList, RunScriptAction): item = ShortcutResultItem('kw', 'name', '/usr/bin/something', 'icon_path') assert item.on_enter(Query('kw query')) is ActionList.return_value RunScriptAction.assert_called_once_with('/usr/bin/something', 'query')
def item(self): return ShortcutResultItem('kw', 'name', 'http://site/?q=%s', 'icon_path', is_default_search=True)
def _create_items(self, shortcuts, default_search=False): return [ShortcutResultItem(default_search=default_search, **s) for s in shortcuts]