More fixes to account.pyx and buddy.pyx.
authorRagner Magalhaes <ragner.magalhaes@openbossa.org>
Tue, 2 Dec 2008 20:46:22 +0000 (20:46 +0000)
committerAnderson Briglia <anderson.briglia@openbossa.org>
Sat, 28 Feb 2009 21:11:13 +0000 (17:11 -0400)
FIXES:
 - Removed ; from account.pyx.
 - gboolean returning functions can be translated to python boolean values automatically.

Signed-off-by: Bruno Abinader <bruno.abinader@indt.org.br>

git-svn-id: https://garage.maemo.org/svn/carman/branches/carman-0.7-beta2/python-purple@1349 596f6dd7-e928-0410-a184-9e12fd12cf7e

account.pyx
buddy.pyx

index 033b6bd..5438d24 100644 (file)
@@ -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(<char *> 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(<char *> 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
-
index 29c56b8..1c3be6c 100644 (file)
--- 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)
-