return None
remember_password = property(__get_remember_password)
+ def __get_enabled(self):
+ if self.__exists:
+ return account.purple_account_get_enabled(self._get_structure(), \
+ self.core.ui_name)
+ else:
+ return None
+ enabled = property(__get_enabled)
+
def set_username(self, username):
"""
Sets the account's username.
else:
return False
+ def set_enabled(self, value):
+ """
+ Sets wheter or not this account is enabled.
+
+ @param value True if it is enabled, or False otherwise
+ @return True if successful, False if account doesn't exists
+ """
+ if self.__exists:
+ account.purple_account_set_enabled(self._get_structure(), \
+ self.core.ui_name, bool(value))
+ return True
+ else:
+ return False
+
def new(self):
"""
Creates a new account.
account.purple_account_new(self.username, self.protocol_id)
self.__exists = True
return True
+
+ def connect(self):
+ """
+ Connects to an account.
+
+ @return True if successful, False if account doesn't exists
+ """
+ if self.__exists:
+ account.purple_account_connect(self._get_structure())
+ return True
+ else:
+ return False
+
+ def disconnect(self):
+ """
+ Disconnects from an account.
+
+ @return True if successful, False if account doesn't exists
+ """
+ if self.__exists:
+ account.purple_account_disconnect(self._get_structure())
+ return True
+ else:
+ return False