Adding function new(...) to Account
authorRagner Magalhaes <ragner.magalhaes@openbossa.org>
Tue, 2 Dec 2008 20:54:09 +0000 (20:54 +0000)
committerAnderson Briglia <anderson.briglia@openbossa.org>
Sat, 28 Feb 2009 21:11:14 +0000 (17:11 -0400)
Adding new function new(...) to Account class to create a new account

Signed-off-by: Ragner Magalhaes <ragner.magalhaes@indt.org.br>

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

account.pyx

index e45288d..e562013 100644 (file)
@@ -305,6 +305,15 @@ cdef class Account:
             iter = iter.next
         return buddies
 
             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
     def get_all(self):
         cdef glib.GList *iter
         cdef account.PurpleAccount *acc