BigW Consortium Gitlab

Commit 31d024e2 by Tarun Bhardwaj

Merge branch 'release/0.4.10'

parents 2d735c19 8fbed4bb
...@@ -2,7 +2,7 @@ from _v2 import EtsyV2 as Etsy # noqa ...@@ -2,7 +2,7 @@ from _v2 import EtsyV2 as Etsy # noqa
from etsy_env import EtsyEnvProduction # noqa from etsy_env import EtsyEnvProduction # noqa
__version__ = '0.4.9' __version__ = '0.4.10'
__author__ = 'Dan McKinley & Fulfil.IO Inc.' __author__ = 'Dan McKinley & Fulfil.IO Inc.'
__copyright__ = 'Copyright 2010 Etsy Inc.; 2016-2017 Fulfil.IO Inc' __copyright__ = 'Copyright 2010 Etsy Inc.; 2016-2017 Fulfil.IO Inc'
__license__ = 'GPL v3' __license__ = 'GPL v3'
......
...@@ -9,6 +9,8 @@ import tempfile ...@@ -9,6 +9,8 @@ import tempfile
import time import time
from _multipartformdataencode import encode_multipart_formdata from _multipartformdataencode import encode_multipart_formdata
from .exceptions import EtsyConcurrencyError, EtsyAPILimitError
missing = object() missing = object()
...@@ -314,6 +316,10 @@ class API(object): ...@@ -314,6 +316,10 @@ class API(object):
try: try:
self.data = self.decode(data) self.data = self.decode(data)
except json.JSONDecodeError: except json.JSONDecodeError:
if 'being edited by another process' in data:
raise EtsyConcurrencyError(data)
if 'exceeded your quota' in data:
raise EtsyAPILimitError(data)
raise ValueError( raise ValueError(
'Could not decode response from Etsy as JSON: %r' % data) 'Could not decode response from Etsy as JSON: %r' % data)
......
class EtsyConcurrencyError(Exception):
pass
class EtsyAPILimitError(Exception):
pass
...@@ -30,6 +30,7 @@ def write_config_file(oauth_token): ...@@ -30,6 +30,7 @@ def write_config_file(oauth_token):
config_file.write("oauth_token_key = %r\n" % oauth_token.key) config_file.write("oauth_token_key = %r\n" % oauth_token.key)
config_file.write("oauth_token_secret = %r\n" % oauth_token.secret) config_file.write("oauth_token_secret = %r\n" % oauth_token.secret)
try: try:
import config import config
except ImportError: except ImportError:
...@@ -94,4 +95,5 @@ def testCreateListing(): ...@@ -94,4 +95,5 @@ def testCreateListing():
print "Result of uploading image: %r" % result print "Result of uploading image: %r" % result
testCreateListing() testCreateListing()
[bumpversion] [bumpversion]
current_version = 0.4.9 current_version = 0.4.10
commit = True commit = True
tag = True tag = True
......
...@@ -19,7 +19,7 @@ test_requirements = [ ...@@ -19,7 +19,7 @@ test_requirements = [
setup( setup(
name='pyetsy', name='pyetsy',
version='0.4.9', version='0.4.10',
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