From: Ragner Magalhaes Date: Tue, 2 Dec 2008 21:10:33 +0000 (+0000) Subject: Added set/get enabled Account class methods. X-Git-Url: http://git.maemo.org/git/?p=python-purple;a=commitdiff_plain;h=ec407c00d228a08dc0c0a2fb4f87d447dd15b3d7;ds=sidebyside Added set/get enabled Account class methods. FIXES: - Added set/get enabled Account class methods. Signed-off-by: Bruno Abinader Acked-by: Ragner Magalhaes Acked-by: Ricardo Guimaraes git-svn-id: https://garage.maemo.org/svn/carman/branches/carman-0.7-beta2/python-purple@1417 596f6dd7-e928-0410-a184-9e12fd12cf7e --- diff --git a/account.pyx b/account.pyx index 90f09b1..78fac03 100644 --- a/account.pyx +++ b/account.pyx @@ -116,6 +116,14 @@ cdef class Account: return None remember_password = property(__get_remember_password) + def __get_enabled(self): + if self.__exists: + return account.purple_account_get_enabled(self._get_structure(), \ + self.core.ui_name) + else: + return None + enabled = property(__get_enabled) + def set_username(self, username): """ Sets the account's username. @@ -200,6 +208,20 @@ cdef class Account: else: return False + def set_enabled(self, value): + """ + Sets wheter or not this account is enabled. + + @param value True if it is enabled, or False otherwise + @return True if successful, False if account doesn't exists + """ + if self.__exists: + account.purple_account_set_enabled(self._get_structure(), \ + self.core.ui_name, bool(value)) + return True + else: + return False + def new(self): """ Creates a new account.