def set_enabled(self, enabled, notify = True): old = getattr(self, 'autologin', False) self.autologin = enabled if notify: self.notify('enabled', old, enabled) profile.update_account(self) return
def update_info(self, **info): force = info.pop('force', None) self._dirty_error = True for k, v in info.iteritems(): setattr(self, k, v) self.notify() # if self.OFFLINE and self.enabled: # self.update_now() # Tell the server. profile.update_account(self, force = force)
def update_info(self, **options): "Update this account's information. The server will be notified." self.update_with_defaults(options) # Tell the server. from common import profile profile.update_account(self) if self.offline_reason in (StateMixin.Reasons.BAD_PASSWORD, StateMixin.Reasons.NO_MAILBOX): self.connect(**getattr(self, '_connect_args', {}))
def update_info(self, **info): force = info.pop('force', None) self._dirty_error = True for k, v in info.iteritems(): setattr(self, k, v) self.notify() # if self.OFFLINE and self.enabled: # self.update_now() # Tell the server. profile.update_account(self, force=force)
def update_info(self, **info): flush_state = False with self.frozen(): for k, v in info.iteritems(): if k in ('password', 'username', 'server') and getattr(self, k, None) != v: flush_state = True self.setnotifyif(k, v) # Tell the server. profile.update_account(self) if flush_state: log.info('Resetting state for %r', self) self._reset_state() self._dirty_error = True
def update(self): profile.update_account(self)
def change_acct_password(self, password, callback=None): self.password = profile.crypt_pw(str(password)) profile.update_account(self) callback.success()
def rename(self, newalias): oldalias = self.alias self.alias = newalias self.notify('alias', oldalias, newalias) profile.update_account(self)