From a4e18cf9c5b3a27b52ee7d96530660d75056ae98 Mon Sep 17 00:00:00 2001 From: Guillaume Desmottes Date: Mon, 16 Apr 2007 16:41:00 +0200 Subject: [PATCH] add get_preferred_connection method to PresenceService --- sugar/presence/presenceservice.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/sugar/presence/presenceservice.py b/sugar/presence/presenceservice.py index 78f51e6b..e61c8d74 100644 --- a/sugar/presence/presenceservice.py +++ b/sugar/presence/presenceservice.py @@ -337,6 +337,19 @@ class PresenceService(gobject.GObject): reply_handler=lambda *args: self._share_activity_cb(activity, *args), error_handler=lambda *args: self._share_activity_error_cb(activity, *args)) + def get_preferred_connection(self): + """Gets the preferred telepathy connection object that an activity + should use when talking directly to telepathy + + returns the bus name and the object path of the Telepathy connection""" + + try: + bus_name, object_path = self._ps.GetPreferredConnection() + except dbus.exceptions.DBusException: + return None + + return bus_name, object_path + class _MockPresenceService(gobject.GObject): """Test fixture allowing testing of items that use PresenceService