BigW Consortium Gitlab

Commit a5cceb99 by Tarun Bhardwaj

Merge branch 'release/0.4.8'

parents 21dde768 b986374a
...@@ -2,8 +2,8 @@ from _v2 import EtsyV2 as Etsy # noqa ...@@ -2,8 +2,8 @@ from _v2 import EtsyV2 as Etsy # noqa
from etsy_env import EtsyEnvProduction # noqa from etsy_env import EtsyEnvProduction # noqa
__version__ = '0.4.7' __version__ = '0.4.8'
__author__ = 'Dan McKinley & Fulfil.IO Inc.' __author__ = 'Dan McKinley & Fulfil.IO Inc.'
__copyright__ = 'Copyright 2010, Etsy Inc.' __copyright__ = 'Copyright 2010 Etsy Inc.; 2016-2017 Fulfil.IO Inc'
__license__ = 'GPL v3' __license__ = 'GPL v3'
__email__ = 'dan@etsy.com' __email__ = 'dan@etsy.com, support@fulfil.io'
...@@ -300,6 +300,10 @@ class API(object): ...@@ -300,6 +300,10 @@ class API(object):
fields.append((name, str(value))) fields.append((name, str(value)))
content_type, body = encode_multipart_formdata(fields, files) content_type, body = encode_multipart_formdata(fields, files)
else:
url = '%s%s' % (self.api_url, url)
body = urlencode(kwargs)
content_type = 'application/x-www-form-urlencoded'
self.last_url = url self.last_url = url
data = self._get_url(url, http_method, content_type, body) data = self._get_url(url, http_method, content_type, body)
......
from etsy import EtsyEnvProduction
from requests_oauthlib import OAuth1Session
class EtsyOAuthClient(OAuth1Session):
def __init__(self, oauth_consumer_key,
oauth_consumer_secret, etsy_env=EtsyEnvProduction()):
super(EtsyOAuthClient, self).__init__(
oauth_consumer_key, oauth_consumer_secret)
self.request_token_url = etsy_env.request_token_url
self.access_token_url = etsy_env.access_token_url
self.signin_url = etsy_env.signin_url
def get_signin_url(self, **kwargs):
self.fetch_request_token(self.request_token_url)
return self.authorization_url(self.signin_url)
def set_oauth_verifier(self, oauth_verifier):
token = self.fetch_access_token(
self.access_token_url, verifier=unicode(oauth_verifier))
self.resource_owner_key = token['oauth_token']
self.resource_owner_secret = token['oauth_token_secret']
def do_oauth_request(self, url, http_method, content_type, body):
headers = {}
if content_type:
headers = {'Content-Type': content_type}
return self.request(http_method, url, headers=headers, data=body).text
[bumpversion] [bumpversion]
current_version = 0.4.7 current_version = 0.4.8
commit = True commit = True
tag = True tag = True
......
...@@ -7,8 +7,10 @@ long_description = open(os.path.join(this_dir, 'README.md'), 'r').read() ...@@ -7,8 +7,10 @@ long_description = open(os.path.join(this_dir, 'README.md'), 'r').read()
requirements = [ requirements = [
'httplib2', 'httplib2',
'oauth2>=1.2.0', 'oauth2==1.9.0.post1',
'simplejson>=2.0', 'simplejson',
'requests',
'requests_oauthlib',
] ]
test_requirements = [ test_requirements = [
...@@ -17,7 +19,7 @@ test_requirements = [ ...@@ -17,7 +19,7 @@ test_requirements = [
setup( setup(
name='pyetsy', name='pyetsy',
version='0.4.7', version='0.4.8',
author='Dan McKinley & Fulfil.IO Inc.', author='Dan McKinley & Fulfil.IO Inc.',
author_email='dan@etsy.com,support@fulfil.io', author_email='dan@etsy.com,support@fulfil.io',
description='Python access to the Etsy API', description='Python access to the Etsy API',
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment