[kupfer] Define repr_key for factory actions' returned sources
- From: Ulrik Sverdrup <usverdrup src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [kupfer] Define repr_key for factory actions' returned sources
- Date: Wed, 31 Mar 2010 02:25:00 +0000 (UTC)
commit e2583545c779b12a101cf08397882220c3b7546f
Author: Ulrik Sverdrup <ulrik sverdrup gmail com>
Date: Wed Mar 31 02:22:22 2010 +0200
Define repr_key for factory actions' returned sources
If the sources have defined repr_keys' they won't be de-duplicated
when being used with many inputs (comma trick).
kupfer/plugin/apt_tools.py | 3 +++
kupfer/plugin/google_search.py | 3 +++
kupfer/plugin/locate.py | 3 +++
kupfer/plugin/tracker.py | 3 +++
4 files changed, 12 insertions(+), 0 deletions(-)
---
diff --git a/kupfer/plugin/apt_tools.py b/kupfer/plugin/apt_tools.py
index 0c551de..847b083 100644
--- a/kupfer/plugin/apt_tools.py
+++ b/kupfer/plugin/apt_tools.py
@@ -101,6 +101,9 @@ class PackageSearchSource (Source):
self.query = query
Source.__init__(self, _('Packages matching "%s"') % query)
+ def repr_key(self):
+ return self.query
+
def get_items(self):
package = self.query
P = subprocess.PIPE
diff --git a/kupfer/plugin/google_search.py b/kupfer/plugin/google_search.py
index fd07ff4..3c4abde 100644
--- a/kupfer/plugin/google_search.py
+++ b/kupfer/plugin/google_search.py
@@ -46,6 +46,9 @@ class SearchResults (Source):
Source.__init__(self, _('Results for "%s"') % query)
self.query = query
+ def repr_key(self):
+ return self.query
+
def get_items(self):
query = urllib.urlencode({'q': self.query})
search_response = urllib.urlopen(SEARCH_URL + query)
diff --git a/kupfer/plugin/locate.py b/kupfer/plugin/locate.py
index 89e2441..d4d0763 100644
--- a/kupfer/plugin/locate.py
+++ b/kupfer/plugin/locate.py
@@ -48,6 +48,9 @@ class LocateQuerySource (Source):
self.query = query
self.max_items = 500
+ def repr_key(self):
+ return self.query
+
def get_items(self):
ignore_case = '--ignore-case' if __kupfer_settings__["ignore_case"] else ''
# Start two processes, one to take the first hits, one
diff --git a/kupfer/plugin/tracker.py b/kupfer/plugin/tracker.py
index c3d1de6..4e81198 100644
--- a/kupfer/plugin/tracker.py
+++ b/kupfer/plugin/tracker.py
@@ -69,6 +69,9 @@ class TrackerQuerySource (Source):
self.query = query
self.max_items = 50
+ def repr_key(self):
+ return self.query
+
def get_items(self):
try:
import dbus
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]