X-Git-Url: http://git.maemo.org/git/?p=python-purple;a=blobdiff_plain;f=purple.pyx;h=6a269cd1a2c8de4a5f69e33ce40180bda1844d75;hp=96a52416370cb6b6f169b8ab1098dbce328c50e0;hb=90f6e43b25dd3932fcc71a4f7afa5ecfcf2e3dc4;hpb=96dcc1db5e3f04349ef4ce92efd3d71d5d1623b5;ds=sidebyside diff --git a/purple.pyx b/purple.pyx index 96a5241..6a269cd 100644 --- a/purple.pyx +++ b/purple.pyx @@ -352,6 +352,28 @@ cdef class Purple: else: return None + def accounts_get_all(self): + cdef glib.GList *iter + cdef account.PurpleAccount *acc + cdef char *username + cdef char *protocol_id + + iter = account.purple_accounts_get_all() + account_list = [] + + while iter: + acc = iter.data + + if acc: + username = account.purple_account_get_username(acc) + protocol_id = account.purple_account_get_protocol_id(acc) + + if username != NULL and protocol_id != NULL: + account_list.append(Account(username, protocol_id)) + iter = iter.next + + return account_list + include "plugin.pyx" include "proxy.pyx" #include "protocol.pyx"