Coding style on core/buddy.pxd
authorRagner Magalhaes <ragner.magalhaes@openbossa.org>
Tue, 2 Dec 2008 20:12:35 +0000 (20:12 +0000)
committerAnderson Briglia <anderson.briglia@openbossa.org>
Sat, 28 Feb 2009 21:11:09 +0000 (17:11 -0400)
Some coding style fixes on core/buddy.pxd

Signed-off-by: Anderson Briglia <anderson.briglia@indt.org.br>

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

core/buddy.pxd

index b09aaca..78aeb3d 100644 (file)
@@ -24,26 +24,24 @@ cdef extern from "libpurple/purple.h":
     cdef struct _PurpleAccount
     ctypedef _PurpleAccount PurpleAccount
 
-    PurpleBuddy *purple_buddy_new(PurpleAccount *account,
+    PurpleBuddy *c_purple_buddy_new "purple_buddy_new" (PurpleAccount *account,
             const_char_ptr screenname, const_char_ptr alias)
 
-    const_char_ptr purple_buddy_get_alias_only(PurpleBuddy *buddy)
-    const_char_ptr purple_buddy_get_name(PurpleBuddy *buddy)
-
+    const_char_ptr c_purple_buddy_get_alias_only "purple_buddy_get_alias_only" (PurpleBuddy *buddy)
+    const_char_ptr c_purple_buddy_get_name "purple_buddy_get_name" (PurpleBuddy *buddy)
 
 cdef class Buddy:
     """ Buddy class """
     cdef PurpleBuddy *__buddy
 
-    def __cinit__(self, acc, const_char_ptr scr, const_char_ptr alias):
-        self.__buddy = purple_buddy_new(<PurpleAccount *>acc.__account, scr, alias)
-        self.acc = acc
+    def __cinit__(self):
+        self.__buddy = NULL
+
+    def new_buddy(self, acc, const_char_ptr scr, const_char_ptr alias):
+        self.__buddy = c_purple_buddy_new(<PurpleAccount *>acc.__account, scr, alias)
 
     def get_alias(self):
-        return purple_buddy_get_alias_only(self.__buddy)
+        return c_purple_buddy_get_alias_only(self.__buddy)
 
     def get_name(self):
-        return purple_buddy_get_name(self.__buddy)
-
-    def get_account(self):
-        return self.acc
+        return c_purple_buddy_get_name(self.__buddy)