From e5ebb86780b3aaa049d510bfa0c9ce265ba5ebb5 Mon Sep 17 00:00:00 2001 From: Ragner Magalhaes Date: Tue, 2 Dec 2008 20:54:09 +0000 Subject: [PATCH] Adding function new(...) to Account Adding new function new(...) to Account class to create a new account Signed-off-by: Ragner Magalhaes git-svn-id: https://garage.maemo.org/svn/carman/branches/carman-0.7-beta2/python-purple@1369 596f6dd7-e928-0410-a184-9e12fd12cf7e --- account.pyx | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/account.pyx b/account.pyx index e45288d..e562013 100644 --- a/account.pyx +++ b/account.pyx @@ -305,6 +305,15 @@ cdef class Account: iter = iter.next return buddies + def new(self, username, protocol_id): + cdef account.PurpleAccount *c_account + c_account = account.c_purple_account_new(username, protocol_id) + + if c_account == NULL: + return None + + return (username, protocol_id) + def get_all(self): cdef glib.GList *iter cdef account.PurpleAccount *acc -- 1.7.9.5