From 2491093a6b435f34eb5ba929ec404bf2aee87709 Mon Sep 17 00:00:00 2001 From: Ragner Magalhaes Date: Tue, 2 Dec 2008 20:57:41 +0000 Subject: [PATCH 1/1] Fixing get/set_enabled to Account Fixing get/set_enabled to set the status to account Signed-off-by: Ragner Magalhaes git-svn-id: https://garage.maemo.org/svn/carman/branches/carman-0.7-beta2/python-purple@1381 596f6dd7-e928-0410-a184-9e12fd12cf7e --- account.pyx | 32 ++++++++++++++++++++++---------- 1 file changed, 22 insertions(+), 10 deletions(-) diff --git a/account.pyx b/account.pyx index f700016..9c36757 100644 --- a/account.pyx +++ b/account.pyx @@ -259,16 +259,6 @@ cdef class Account: else: return None - def get_enabled(self, ui): - if self.c_account: - return account.c_purple_account_get_enabled(self.c_account, ui) - else: - return None - - def set_enabled(self, ui, value): - if self.c_account: - account.c_purple_account_set_enabled(self.c_account, ui, value) - def set_status(self): self.__sstatus = savedstatuses.c_purple_savedstatus_new(NULL, status.PURPLE_STATUS_AVAILABLE) savedstatuses.c_purple_savedstatus_activate(self.__sstatus) @@ -390,3 +380,25 @@ cdef class Account: else: return None + def set_enabled(self, acc, ui, value): + ''' @param acc Tuple (username, protocol id) ''' + ''' @param ui The UI ''' + ''' @param value True to enabled or False to disabled ''' + cdef account.PurpleAccount *c_account + + c_account = account.c_purple_accounts_find(acc[0], acc[1]) + if c_account: + account.c_purple_account_set_enabled(c_account, ui, bool(value)) + + def get_enabled(self, acc, ui): + ''' @param acc Tuple (username, protocol id) ''' + ''' @param ui The UI ''' + 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_enabled(c_account, ui) + else: + return None + + -- 1.7.9.5