From: Ragner Magalhaes Date: Tue, 2 Dec 2008 20:05:37 +0000 (+0000) Subject: Fix account class X-Git-Url: http://git.maemo.org/git/?p=python-purple;a=commitdiff_plain;h=125a7e4d6fc52ce51e6fc5264f70d61cfc3b339b Fix account class Using cast to encapsulate PurpleAccount into a PyObject. Signed-off-by: Anderson Briglia Signed-off-by: Ragner Magalhaes git-svn-id: https://garage.maemo.org/svn/carman/branches/carman-0.7-beta2/python-purple@1267 596f6dd7-e928-0410-a184-9e12fd12cf7e --- diff --git a/core/account.pxd b/core/account.pxd index 1f11147..93330a1 100644 --- a/core/account.pxd +++ b/core/account.pxd @@ -20,7 +20,7 @@ cdef extern from "libpurple/account.h": ctypedef struct PurpleAccount - cdef PurpleAccount* purple_account_new(const_char_ptr username, const_char_ptr protocol_id) + cdef PurpleAccount *c_purple_account_new "purple_account_new" (const_char_ptr username, const_char_ptr protocol_id) cdef void c_purple_account_set_username "purple_account_set_username" (PurpleAccount *account, const_char_ptr username) cdef void c_purple_account_set_password "purple_account_set_password" (PurpleAccount *account, const_char_ptr password) cdef void c_purple_account_set_enabled "purple_account_set_enabled" (PurpleAccount *account, const_char_ptr ui, gboolean value) @@ -29,7 +29,9 @@ class Account(object): """ Account class """ def __init__(self, username, protocol_id): - cdef PurpleAccount *self.purple_account = purple_account_new(username, protocol_id) + cdef PurpleAccount *acc = c_purple_account_new(username, protocol_id) + self.__acc = acc + acc = self.__acc """ def purple_account_set_password(self, account, password):