From 5cf9ef61f1ac6ccb0b3eaea65988873baf0a483a Mon Sep 17 00:00:00 2001 From: Ragner Magalhaes Date: Tue, 2 Dec 2008 20:46:22 +0000 Subject: [PATCH] More fixes to account.pyx and buddy.pyx. FIXES: - Removed ; from account.pyx. - gboolean returning functions can be translated to python boolean values automatically. Signed-off-by: Bruno Abinader git-svn-id: https://garage.maemo.org/svn/carman/branches/carman-0.7-beta2/python-purple@1349 596f6dd7-e928-0410-a184-9e12fd12cf7e --- account.pyx | 7 +++---- buddy.pyx | 6 +----- 2 files changed, 4 insertions(+), 9 deletions(-) diff --git a/account.pyx b/account.pyx index 033b6bd..5438d24 100644 --- a/account.pyx +++ b/account.pyx @@ -107,21 +107,21 @@ cdef class Account: if self.c_account != NULL: str_value = account.c_purple_account_get_string(self.c_account, setting, str_value) - account.c_purple_account_set_string(self.c_account, setting, str_value ); + account.c_purple_account_set_string(self.c_account, setting, str_value) elif type == prefs.PURPLE_PREF_INT: int_value = accountopt.c_purple_account_option_get_default_int(option) if self.c_account != NULL: int_value = account.c_purple_account_get_int(self.c_account, setting, int_value) if str( setting) == "port": - account.c_purple_account_set_int(self.c_account, setting, 443); + account.c_purple_account_set_int(self.c_account, setting, 443) elif type == prefs.PURPLE_PREF_BOOLEAN: bool_value = accountopt.c_purple_account_option_get_default_bool(option) if self.c_account != NULL: bool_value = account.c_purple_account_get_bool(self.c_account, setting, bool_value) if str( setting) == "old_ssl": - account.c_purple_account_set_bool(self.c_account, setting, True); + account.c_purple_account_set_bool(self.c_account, setting, True) elif type == prefs.PURPLE_PREF_STRING_LIST: str_value = accountopt.c_purple_account_option_get_default_list_value(option) @@ -129,4 +129,3 @@ cdef class Account: str_value = account.c_purple_account_get_string(self.c_account, setting, str_value) iter = iter.next - diff --git a/buddy.pyx b/buddy.pyx index 29c56b8..1c3be6c 100644 --- a/buddy.pyx +++ b/buddy.pyx @@ -43,9 +43,5 @@ cdef class Buddy: def __get_online(self): name = self.name self.c_buddy = blist.c_purple_find_buddy(self.__acc.c_account, name) - if status.c_purple_presence_is_online(blist.c_purple_buddy_get_presence(self.c_buddy)): - return True - else: - return False + return status.c_purple_presence_is_online(blist.c_purple_buddy_get_presence(self.c_buddy)) online = property(__get_online) - -- 1.7.9.5