From: Ragner Magalhaes Date: Tue, 2 Dec 2008 20:05:13 +0000 (+0000) Subject: Initial account class implementation X-Git-Url: http://git.maemo.org/git/?p=python-purple;a=commitdiff_plain;h=c2250da2a909481d87209e028fa5079377ba3519;ds=sidebyside Initial account class implementation Signed-off-by: Anderson Briglia Signed-off-by: Ragner Magalhaes Signed-off-by: Ricardo Guimaraes Signed-off-by: Bruno Abinader Signed-off-by: Dinorah Monteiro git-svn-id: https://garage.maemo.org/svn/carman/branches/carman-0.7-beta2/python-purple@1266 596f6dd7-e928-0410-a184-9e12fd12cf7e --- diff --git a/core/account.pxd b/core/account.pxd index 50830e5..1f11147 100644 --- a/core/account.pxd +++ b/core/account.pxd @@ -20,21 +20,18 @@ cdef extern from "libpurple/account.h": ctypedef struct PurpleAccount - cdef PurpleAccount* c_purple_account_new "purple_account_new" (const_char_ptr username, const_char_ptr protocol_id) + cdef PurpleAccount* 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) class Account(object): """ Account class """ - def __init__(self): - purple_account = None + def __init__(self, username, protocol_id): + cdef PurpleAccount *self.purple_account = purple_account_new(username, protocol_id) - # FIXME """ - def purple_account_new(self, user_name, protocol_id): - return c_purple_account_new(user_name, protocol_id) - def purple_account_set_password(self, account, password): c_purple_account_set_password(account, password) diff --git a/glib.pxd b/glib.pxd index d00dfdf..3a87384 100644 --- a/glib.pxd +++ b/glib.pxd @@ -18,14 +18,14 @@ # cdef extern from "glib.h": - ctypedef void* gpointer + ctypedef void *gpointer ctypedef int gint ctypedef unsigned int guint ctypedef gint gboolean # GHashTable is an opaque data structure ctypedef struct GHashTable: - void* none + void *none struct _GSList: gpointer data