On Mon, 2009-11-09 at 02:29 +1100, Jiri Baum wrote:

> I suspect it won't quite be the new API, because telepathy-python doesn't 
> have 
> AccountManager bindings but does have a little function that scans the bus 
> for 
> names beginning with "org.freedesktop.Telepathy.Connection." but that's minor.

Don't do that. Talk to the AccountManager.

Here is a trivial binding for AccountManager, you could easily flesh
this out and submit it to Telepathy-Python.

-- 
Danielle Madeley

Collabora Ltd., Melbourne, Australia
http://www.collabora.co.uk/
from telepathy.client.interfacefactory import InterfaceFactory
from telepathy.interfaces import ACCOUNT_MANAGER
import dbus

DBUS_PROPERTIES = 'org.freedesktop.DBus.Properties'

class AccountManager(InterfaceFactory):
    service_name = 'org.freedesktop.Telepathy.AccountManager'
    object_path = '/org/freedesktop/Telepathy/AccountManager'

    def __init__(self, bus=None):
        if not bus:
            bus = dbus.Bus()

        object = bus.get_object(self.service_name, self.object_path)
        InterfaceFactory.__init__(self, object, ACCOUNT_MANAGER)

        # FIXME: make this async
        self.get_valid_interfaces().update(self[DBUS_PROPERTIES].Get(ACCOUNT_MANAGER, 'Interfaces'))

if __name__ == '__main__':
    am = AccountManager()
    print am[DBUS_PROPERTIES].Get(ACCOUNT_MANAGER, 'ValidAccounts')
_______________________________________________
telepathy mailing list
telepathy@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/telepathy

Reply via email to