oauth1 timeout. pbkdf2_ctypes repository reference in docstring
This commit is contained in:
@@ -109,7 +109,7 @@ class OAuthAccount(object):
|
||||
self.session.access_token = None
|
||||
return None
|
||||
|
||||
def __init__(self, g, client_id, client_secret, auth_url, token_url, access_token_url):
|
||||
def __init__(self, g, client_id, client_secret, auth_url, token_url, access_token_url, socket_timeout=60):
|
||||
self.globals = g
|
||||
self.client_id = client_id
|
||||
self.client_secret = client_secret
|
||||
@@ -119,6 +119,7 @@ class OAuthAccount(object):
|
||||
self.auth_url = auth_url
|
||||
self.token_url = token_url
|
||||
self.access_token_url = access_token_url
|
||||
self.socket_timeout = socket_timeout
|
||||
|
||||
# consumer init
|
||||
self.consumer = oauth.Consumer(self.client_id, self.client_secret)
|
||||
@@ -154,7 +155,7 @@ class OAuthAccount(object):
|
||||
|
||||
if not self.accessToken():
|
||||
# setup the client
|
||||
client = oauth.Client(self.consumer, None)
|
||||
client = oauth.Client(self.consumer, None, timeout=self.socket_timeout)
|
||||
# Get a request token.
|
||||
# oauth_callback *is REQUIRED* for OAuth1.0a
|
||||
# putting it in the body seems to work.
|
||||
|
||||
@@ -9,6 +9,8 @@
|
||||
Note: This module is intended as a plugin replacement of pbkdf2.py
|
||||
by Armin Ronacher.
|
||||
|
||||
Git repository:
|
||||
$ git clone https://github.com/michele-comitini/pbkdf2_ctypes.git
|
||||
|
||||
:copyright: Copyright (c) 2013: Michele Comitini <mcm@glisco.it>
|
||||
:license: LGPLv3
|
||||
@@ -42,7 +44,7 @@ try: # check that we have proper OpenSSL on the system.
|
||||
hashlib.sha224: crypto.EVP_sha224,
|
||||
hashlib.sha384: crypto.EVP_sha384,
|
||||
hashlib.sha512: crypto.EVP_sha512}
|
||||
except OSError, AttributeError:
|
||||
except (OSError, AttributeError), e:
|
||||
raise ImportError('Cannot find a compatible OpenSSL installation '
|
||||
'on your system')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user