Added Account class parent (core).
authorRagner Magalhaes <ragner.magalhaes@openbossa.org>
Tue, 2 Dec 2008 21:11:08 +0000 (21:11 +0000)
committerAnderson Briglia <anderson.briglia@openbossa.org>
Sat, 28 Feb 2009 21:11:18 +0000 (17:11 -0400)
FIXES:
 - Added Account class parent (core).

Signed-off-by: Bruno Abinader <bruno.abinader@indt.org.br>
Acked-by: Ragner Magalhaes <ragner.magalhaes@indt.org.br>
Acked-by: Ricardo Guimaraes <ricardo.guimaraes@indt.org.br>

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

account.pyx
purple.pyx

index 16e5dcd..a6d2412 100644 (file)
@@ -24,11 +24,13 @@ from protocol import Protocol
 cdef class Account:
     """
     Account class
+    @param core
     @param username
     @param protocol_id
     """
 
-    def __init__(self, username, protocol_id):
+    def __init__(self, core, username, protocol_id):
+        self.__core = core
         self.__username = username
         self.__protocol = Protocol(self, protocol_id)
 
@@ -63,6 +65,10 @@ cdef class Account:
             return None
     is_disconnected = property(__is_disconnected)
 
+    def __get_core(self):
+        return self.__core
+    core = property(__get_core)
+
     def __get_exists(self):
         return self.__exists
     exists = property(__get_exists)
index c91acdc..9601af7 100644 (file)
@@ -82,6 +82,10 @@ cdef class Purple:
         # adds glib iteration inside ecore main loop
         ecore.timer_add(0.001, self.__glib_iteration_when_idle)
 
+    def __get_ui_name(self):
+        return __APP_NAME__
+    ui_name = property(__get_ui_name)
+
     def destroy(self):
         core.c_purple_core_quit()
 
@@ -369,7 +373,7 @@ cdef class Purple:
                 protocol_id = <char *> account.purple_account_get_protocol_id(acc)
 
                 if username != NULL and protocol_id != NULL:
-                    account_list.append(Account(username, protocol_id))
+                    account_list.append(Account(self, username, protocol_id))
             iter = iter.next
 
         return account_list