tracker r3024 - in trunk: . python/deskbar-handler
- From: mbiebl svn gnome org
- To: svn-commits-list gnome org
- Subject: tracker r3024 - in trunk: . python/deskbar-handler
- Date: Fri, 6 Mar 2009 12:31:27 +0000 (UTC)
Author: mbiebl
Date: Fri Mar 6 12:31:27 2009
New Revision: 3024
URL: http://svn.gnome.org/viewvc/tracker?rev=3024&view=rev
Log:
2009-03-06 Michael Biebl <mbiebl gmail com>
* python/deskbar-handler/tracker-module.py: Update deskbar module to
the new D-Bus API, fix a small typo (recieve->receive) while at it.
Modified:
trunk/ChangeLog
trunk/python/deskbar-handler/tracker-module.py
Modified: trunk/python/deskbar-handler/tracker-module.py
==============================================================================
--- trunk/python/deskbar-handler/tracker-module.py (original)
+++ trunk/python/deskbar-handler/tracker-module.py Fri Mar 6 12:31:27 2009
@@ -333,7 +333,7 @@
def __init__(self):
deskbar.interfaces.Module.__init__(self)
# initing on search request, see self.query
- self.tracker = self.search_iface = self.keywords_iface = self.files_iface = None
+ self.tracker = self.tracker_search = self.tracker_keywords = self.tracker_files = self.search_iface = self.keywords_iface = self.files_iface = None
self.conv_re = re.compile (r'^.*?/logs/([^/]+)/([^/]+)/([^/]+)/(.+?)\.(:?txt|html)$') # all, proto, account, to-whom, time
def handle_email_hits (self, info, output):
@@ -392,7 +392,7 @@
output['desktop'] = desktop
return 1
- def recieve_hits (self, qstring, hits, max):
+ def receive_hits (self, qstring, hits, max):
matches = []
for info in hits:
@@ -433,7 +433,7 @@
print 'Tracker response for %s; %d hits returned, %d shown' % \
(qstring, len(hits), len(matches))
- def recieve_error (self, error):
+ def receive_error (self, error):
print >> sys.stderr, '*** Tracker dbus error:', error
def query (self, qstring):
@@ -447,18 +447,21 @@
print "Connecting to Tracker (first search or trackerd restarted)"
import dbus
bus = dbus.SessionBus()
- self.tracker = bus.get_object('org.freedesktop.Tracker', '/org/freedesktop/tracker')
- self.search_iface = dbus.Interface(self.tracker, 'org.freedesktop.Tracker.Search')
- self.keywords_iface = dbus.Interface(self.tracker, 'org.freedesktop.Tracker.Keywords')
- self.files_iface = dbus.Interface(self.tracker, 'org.freedesktop.Tracker.Files')
+ self.tracker = bus.get_object('org.freedesktop.Tracker', '/org/freedesktop/Tracker')
+ self.tracker_search = bus.get_object('org.freedesktop.Tracker', '/org/freedesktop/Tracker/Search')
+ self.search_iface = dbus.Interface(self.tracker_search, 'org.freedesktop.Tracker.Search')
+ self.tracker_keywords = bus.get_object('org.freedesktop.Tracker', '/org/freedesktop/Tracker/Keywords')
+ self.keywords_iface = dbus.Interface(self.tracker_keywords, 'org.freedesktop.Tracker.Keywords')
+ self.tracker_files = bus.get_object('org.freedesktop.Tracker', '/org/freedesktop/Tracker/Files')
+ self.files_iface = dbus.Interface(self.tracker_files, 'org.freedesktop.Tracker.Files')
except:
print >> sys.stderr, 'DBus connection to tracker failed, check your settings.'
return
for service in [key for key in TYPES.iterkeys () if key != 'Extra']:
print 'Searching %s' % service
self.search_iface.TextDetailed (-1, service, qstring, 0, max, \
- reply_handler = lambda hits: self.recieve_hits(qstring, hits, max),
- error_handler = self.recieve_error)
+ reply_handler = lambda hits: self.receive_hits(qstring, hits, max),
+ error_handler = self.receive_error)
print 'Tracker query:', qstring
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]