Fixed get account c-structure on Protocol class.
authorRagner Magalhaes <ragner.magalhaes@openbossa.org>
Tue, 2 Dec 2008 21:11:28 +0000 (21:11 +0000)
committerAnderson Briglia <anderson.briglia@openbossa.org>
Sat, 28 Feb 2009 21:11:18 +0000 (17:11 -0400)
FIXES:
 - Fixed get account c-structure on Protocol class.

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@1420 596f6dd7-e928-0410-a184-9e12fd12cf7e

account.pyx
protocol.pyx
purple.pyx

index a6d2412..d896dd0 100644 (file)
@@ -19,8 +19,6 @@
 
 cimport purple
 
-from protocol import Protocol
-
 cdef class Account:
     """
     Account class
index e8d8999..b482e6e 100644 (file)
@@ -29,14 +29,14 @@ cdef class Protocol:
         self.__account = account
         self.__protocol_id = protocol_id
 
+    cdef account.PurpleAccount *__account_get_structure(self):
+        return account.purple_accounts_find(self.__account.username, \
+                self.__account.protocol_id)
+
     def __get_protocol_id(self):
         return self.__protocol_id.protocol_id
     protocol_id = property(__get_protocol_id)
 
-    def __get_account(self):
-        return self.__account
-    account = property(__get_account)
-
     def _set_protocol_id(self, protocol_id):
         account.purple_account_set_protocol_id( \
-                self.__account._get_structure(), protocol_id)
+                self.__account_get_structure(), protocol_id)
index 9601af7..5d87af3 100644 (file)
@@ -378,7 +378,8 @@ cdef class Purple:
 
         return account_list
 
-include "plugin.pyx"
+include "protocol.pyx"
+#include "plugin.pyx"
 include "proxy.pyx"
 #include "protocol.pyx"
 include "account.pyx"