Ejemplo n.º 1
0
    def load(self, account_id):
        cfg = AccountConfig(account_id)
        auth = cfg.read_section("OAuth")
        username = cfg.read("Login", "username")
        protocol = cfg.read("Login", "protocol")
        p = cfg.revert(cfg.read("Login", "password"), username)

        if self.__accounts.has_key(account_id):
            self.log.debug("Account %s is already registered" % account_id)
        else:
            account = Account(username, account_id, protocol, p, auth, cfg)
            timeout = int(self.config.read("Advanced", "socket-timeout"))
            account.protocol.timeout = timeout
            self.log.debug("Using %i sec for socket timeout in account %s" % (account.protocol.timeout, account_id))
            self.__accounts[account_id] = account
            self.log.debug("Account %s loaded successfully" % account_id)
        return account_id
Ejemplo n.º 2
0
    def load(self, account_id):
        cfg = AccountConfig(account_id)
        auth = cfg.read_section('OAuth')
        username = cfg.read('Login', 'username')
        protocol = cfg.read('Login', 'protocol')
        p = cfg.revert(cfg.read('Login', 'password'), username)

        if account_id in self.__accounts:
            self.log.debug('Account %s is already registered' % account_id)
        else:
            account = Account(username, account_id, protocol, p, auth, cfg)
            timeout = int(self.config.read('Advanced', 'socket-timeout'))
            account.protocol.timeout = timeout
            self.log.debug('Using %i sec for socket timeout in account %s' % (
                account.protocol.timeout, account_id))
            self.__accounts[account_id] = account
            self.log.debug('Account %s loaded successfully' % account_id)
        return account_id
Ejemplo n.º 3
0
    def load(self, account_id):
        cfg = AccountConfig(account_id)
        auth = cfg.read_section('OAuth')
        username = cfg.read('Login', 'username')
        protocol = cfg.read('Login', 'protocol')
        p = cfg.revert(cfg.read('Login', 'password'), username)

        if self.__accounts.has_key(account_id):
            self.log.debug('Account %s is already registered' % account_id)
        else:
            account = Account(username, account_id, protocol, p, auth, cfg)
            timeout = int(self.config.read('Advanced', 'socket-timeout'))
            account.protocol.timeout = timeout
            self.log.debug('Using %i sec for socket timeout in account %s' %
                           (account.protocol.timeout, account_id))
            self.__accounts[account_id] = account
            self.log.debug('Account %s loaded successfully' % account_id)
        return account_id