Пример #1
0
 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
Пример #2
0
    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)
Пример #3
0
    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', {}))
Пример #4
0
    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)
Пример #5
0
    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
Пример #6
0
    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
Пример #7
0
 def update(self):
     profile.update_account(self)
Пример #8
0
 def change_acct_password(self, password, callback=None):
     self.password = profile.crypt_pw(str(password))
     profile.update_account(self)
     callback.success()
Пример #9
0
 def rename(self, newalias):
     oldalias = self.alias
     self.alias = newalias
     self.notify('alias', oldalias, newalias)
     profile.update_account(self)
Пример #10
0
 def rename(self, newalias):
     oldalias = self.alias
     self.alias = newalias
     self.notify('alias', oldalias, newalias)
     profile.update_account(self)