FIXES:
- When using property, "set_*" methods didn't return anything, so whe
couldn't know if the operation was successful or not. Because of
this, I've moved them into separate methods outside of the property
(like username and protocol_id).
Signed-off-by: Bruno Abinader <bruno.abinader@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@1414
596f6dd7-e928-0410-a184-
9e12fd12cf7e
return None
else:
return None
return None
else:
return None
- def __set_password(self, password):
- if self.__exists:
- account.purple_account_set_password(self._get_structure(), \
- password)
- return True
- else:
- return False
- password = property(__get_password, __set_password)
+ password = property(__get_password)
def __get_alias(self):
cdef char *alias = NULL
def __get_alias(self):
cdef char *alias = NULL
return None
else:
return None
return None
else:
return None
- def __set_alias(self, alias):
- if self.__exists:
- account.purple_account_set_alias(self._get_structure(), \
- alias)
- return True
- else:
- return False
- alias = property(__get_alias, __set_alias)
+ alias = property(__get_alias)
def __get_user_info(self):
cdef char *user_info = NULL
def __get_user_info(self):
cdef char *user_info = NULL
return None
else:
return None
return None
else:
return None
- def __set_user_info(self, user_info):
- if self.__exists:
- account.purple_account_set_user_info(self._get_structure(), \
- user_info)
- return True
- else:
- return False
- user_info = property(__get_user_info, __set_user_info)
+ user_info = property(__get_user_info)
def __get_remember_password(self):
if self.__exists:
def __get_remember_password(self):
if self.__exists:
self._get_structure())
else:
return None
self._get_structure())
else:
return None
- def __set_remember_password(self, remember_password):
- if self.__exists:
- account.purple_account_set_remember_password( \
- self._get_structure(), remember_password)
- return True
- else:
- return False
- remember_password = property(__get_remember_password, \
- __set_remember_password)
+ remember_password = property(__get_remember_password)
def set_username(self, username):
if self.__exists:
def set_username(self, username):
if self.__exists:
+ def set_password(self, password):
+ if self.__exists:
+ account.purple_account_set_password(self._get_structure(), \
+ password)
+ return True
+ else:
+ return False
+
+ def set_alias(self, alias):
+ if self.__exists:
+ account.purple_account_set_alias(self._get_structure(), \
+ alias)
+ return True
+ else:
+ return False
+
+ def set_user_info(self, user_info):
+ if self.__exists:
+ account.purple_account_set_user_info(self._get_structure(), \
+ user_info)
+ return True
+ else:
+ return False
+
+ def set_remember_password(self, remember_password):
+ if self.__exists:
+ account.purple_account_set_remember_password( \
+ self._get_structure(), remember_password)
+ return True
+ else:
+ return False
+
def new(self):
if self.__exists:
return False
def new(self):
if self.__exists:
return False