From 504a382b26ddeb5e6d3ffcc8693bc336a6ec68d5 Mon Sep 17 00:00:00 2001 From: Ragner Magalhaes Date: Tue, 2 Dec 2008 21:10:17 +0000 Subject: [PATCH] Added connect/disconnect Account class methods. FIXES: - Added connect/disconnect 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@1416 596f6dd7-e928-0410-a184-9e12fd12cf7e --- account.pyx | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/account.pyx b/account.pyx index 1a62140..90f09b1 100644 --- a/account.pyx +++ b/account.pyx @@ -212,3 +212,27 @@ cdef class Account: account.purple_account_new(self.username, self.protocol_id) self.__exists = True return True + + def connect(self): + """ + Connects to an account. + + @return True if successful, False if account doesn't exists + """ + if self.__exists: + account.purple_account_connect(self._get_structure()) + return True + else: + return False + + def disconnect(self): + """ + Disconnects from an account. + + @return True if successful, False if account doesn't exists + """ + if self.__exists: + account.purple_account_disconnect(self._get_structure()) + return True + else: + return False -- 1.7.9.5