summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
0ac3a2d)
Declaring fields of Account class
Fixing segfault caused by recursive dependency
Signed-off-by: Ragner Magalhaes <ragner.magalhaes@indt.org.br>
Acked-by: Bruno Abinader <bruno.abinader@indt.org.br>
git-svn-id: https://garage.maemo.org/svn/carman/branches/carman-0.7-beta2/python-purple@1427
596f6dd7-e928-0410-a184-
9e12fd12cf7e
cdef class Account:
"""
Account class
cdef class Account:
"""
Account class
- @param core Purple class instance
@param username
@param protocol Protocol class instance
@param username
@param protocol Protocol class instance
+ @param core Purple class instance
+ cdef object __username
+ cdef object __protocol
+ cdef object __core
+ cdef object __exists
+
def __init__(self, username, protocol, core):
self.__username = username
self.__protocol = protocol
def __init__(self, username, protocol, core):
self.__username = username
self.__protocol = protocol
self.__exists = False
cdef account.PurpleAccount *_get_structure(self):
self.__exists = False
cdef account.PurpleAccount *_get_structure(self):
- return account.purple_accounts_find(self.username, \
- self.protocol.protocol_id)
+ return account.purple_accounts_find(self.__username, \
+ self.__protocol.id)
def __is_connected(self):
if self.__exists:
def __is_connected(self):
if self.__exists:
username = property(__get_username)
def __get_protocol(self):
username = property(__get_username)
def __get_protocol(self):
protocol = property(__get_protocol)
def __get_password(self):
protocol = property(__get_protocol)
def __get_password(self):
def __get_enabled(self):
if self.__exists:
return account.purple_account_get_enabled(self._get_structure(), \
def __get_enabled(self):
if self.__exists:
return account.purple_account_get_enabled(self._get_structure(), \
else:
return None
enabled = property(__get_enabled)
else:
return None
enabled = property(__get_enabled)
"""
if protocol.exists and self.__exists:
account.purple_account_set_protocol_id(self._get_structure(), \
"""
if protocol.exists and self.__exists:
account.purple_account_set_protocol_id(self._get_structure(), \
self.__protocol = protocol
return True
else:
self.__protocol = protocol
return True
else:
"""
if self.__exists:
account.purple_account_set_enabled(self._get_structure(), \
"""
if self.__exists:
account.purple_account_set_enabled(self._get_structure(), \
- self.core.ui_name, bool(value))
+ self.__core.ui_name, bool(value))
return True
else:
return False
return True
else:
return False
if self.__exists:
return False
else:
if self.__exists:
return False
else:
- account.purple_account_new(self.username, self.protocol_id)
+ account.purple_account_new(self.__username, self.__protocol.id)
self.__exists = True
return True
self.__exists = True
return True