From: Ragner Magalhaes Date: Tue, 2 Dec 2008 20:57:24 +0000 (+0000) Subject: Adding function get_protocol_id to Account class X-Git-Url: http://git.maemo.org/git/?p=python-purple;a=commitdiff_plain;h=4d20f8e41546818f08ce52c748889e10f96345e8;ds=sidebyside Adding function get_protocol_id to Account class Adding functin get_protocol_id to return account's protocol id Signed-off-by: Ragner Magalhaes git-svn-id: https://garage.maemo.org/svn/carman/branches/carman-0.7-beta2/python-purple@1380 596f6dd7-e928-0410-a184-9e12fd12cf7e --- diff --git a/account.pyx b/account.pyx index ce40bd1..f700016 100644 --- a/account.pyx +++ b/account.pyx @@ -379,3 +379,14 @@ cdef class Account: if c_account: account.c_purple_account_set_protocol_id(c_account, protocol_id) + def get_protocol_id(self, acc): + ''' @param acc Tuple (username, protocol id) ''' + ''' @return account's protocol id ''' + cdef account.PurpleAccount *c_account + + c_account = account.c_purple_accounts_find(acc[0], acc[1]) + if c_account: + return account.c_purple_account_get_protocol_id(c_account) + else: + return None +