From c71ba56da8fd2b4ac9b09614941c731583ba77f2 Mon Sep 17 00:00:00 2001 From: Tim Keefer Date: Wed, 5 Apr 2017 17:11:01 -0700 Subject: [PATCH 01/34] add tests --- .gitignore | 1 + ebaysdk/config.py | 2 - ebaysdk/shopping/__init__.py | 2 +- tests/__init__.py | 57 -------------------------- tests/test_base.py | 79 ++++++++++++++++++++++++++++++++++++ tests/test_errors.py | 72 ++++++++++++++++++++++++++++++++ 6 files changed, 153 insertions(+), 60 deletions(-) create mode 100644 tests/test_base.py create mode 100644 tests/test_errors.py diff --git a/.gitignore b/.gitignore index b401fe8..6d16747 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +ebay.yaml timebay.yaml build/ dist/ diff --git a/ebaysdk/config.py b/ebaysdk/config.py index 1766496..ed857af 100644 --- a/ebaysdk/config.py +++ b/ebaysdk/config.py @@ -17,8 +17,6 @@ class Config(object): """Config Class for all APIs connections >>> c = Config(domain='api.ebay.com') - >>> print(c.file()) - ebay.yaml >>> c.set('fname', 'tim') >>> c.get('fname') 'tim' diff --git a/ebaysdk/shopping/__init__.py b/ebaysdk/shopping/__init__.py index ceec437..a34b92e 100644 --- a/ebaysdk/shopping/__init__.py +++ b/ebaysdk/shopping/__init__.py @@ -46,7 +46,7 @@ def __init__(self, **kwargs): uri -- API endpoint uri (default: /shopping) appid -- eBay application id siteid -- eBay country site id (default: 0 (US)) - compatibility -- version number (default: 799) + version -- version number (default: 799) https -- execute of https (default: True) proxy_host -- proxy hostname proxy_port -- proxy port number diff --git a/tests/__init__.py b/tests/__init__.py index 7e93eb8..8b13789 100644 --- a/tests/__init__.py +++ b/tests/__init__.py @@ -1,58 +1 @@ -# -*- coding: utf-8 -*- -''' -© 2012-2013 eBay Software Foundation -Authored by: Tim Keefer -Licensed under CDDL 1.0 -''' - -import sys -import unittest -import doctest -import ebaysdk.utils -import ebaysdk.config -import ebaysdk.response -import ebaysdk.connection -import ebaysdk.http -import ebaysdk.shopping -import ebaysdk.trading -import ebaysdk.merchandising -import ebaysdk.soa.finditem -import ebaysdk.finding -import ebaysdk.poller.orders -import ebaysdk.inventorymanagement - -# does not pass with python3.3 -try: - import ebaysdk.parallel -except ImportError: - pass - - -def getTestSuite(): - suite = unittest.TestSuite() - - suite.addTest(doctest.DocTestSuite(ebaysdk.poller.orders)) - suite.addTest(doctest.DocTestSuite(ebaysdk.utils)) - suite.addTest(doctest.DocTestSuite(ebaysdk.config)) - suite.addTest(doctest.DocTestSuite(ebaysdk.response)) - suite.addTest(doctest.DocTestSuite(ebaysdk.connection)) - # suite.addTest(doctest.DocTestSuite(ebaysdk.http)) - suite.addTest(doctest.DocTestSuite(ebaysdk.shopping)) - suite.addTest(doctest.DocTestSuite(ebaysdk.trading)) - suite.addTest(doctest.DocTestSuite(ebaysdk.merchandising)) - suite.addTest(doctest.DocTestSuite(ebaysdk.finding)) - suite.addTest(doctest.DocTestSuite(ebaysdk.inventorymanagement)) - - if not sys.version_info[0] >= 3 \ - and sys.modules.has_key('grequests') is True: - # suite.addTest(doctest.DocTestSuite(ebaysdk.parallel)) - pass - - # inside only - # suite.addTest(doctest.DocTestSuite(ebaysdk.soa.finditem)) - - return suite - -runner = unittest.TextTestRunner() -runner.run(getTestSuite()) diff --git a/tests/test_base.py b/tests/test_base.py new file mode 100644 index 0000000..913e75b --- /dev/null +++ b/tests/test_base.py @@ -0,0 +1,79 @@ +# -*- coding: utf-8 -*- + +''' +© 2012-2013 eBay Software Foundation +Authored by: Tim Keefer +Licensed under CDDL 1.0 +''' + +from __future__ import absolute_import +import os +import sys +import unittest +import doctest +import ebaysdk.utils +import ebaysdk.config +import ebaysdk.response +import ebaysdk.connection +import ebaysdk.http +import ebaysdk.shopping +import ebaysdk.trading +import ebaysdk.merchandising +import ebaysdk.soa.finditem +import ebaysdk.finding +import ebaysdk.poller.orders +import ebaysdk.inventorymanagement + +# does not pass with python3.3 +try: + import ebaysdk.parallel +except ImportError: + pass + +os.environ.setdefault("EBAY_YAML", "ebay.yaml") + + +class TestBase(unittest.TestCase): + + def doctest(self, module): + doctest.testmod(module, raise_on_error=True, verbose=False) + + def test_run_doctest_poller(self): + self.doctest(ebaysdk.poller.orders) + + def test_run_doctest_utils(self): + self.doctest(ebaysdk.utils) + + def test_run_doctest_config(self): + self.doctest(ebaysdk.config) + + def test_run_doctest_response(self): + self.doctest(ebaysdk.response) + + def test_run_doctest_connection(self): + self.doctest(ebaysdk.connection) + + def test_run_doctest_shopping(self): + self.doctest(ebaysdk.shopping) + + def test_run_doctest_trading(self): + self.doctest(ebaysdk.trading) + + def test_run_doctest_merchandising(self): + self.doctest(ebaysdk.merchandising) + + def test_run_doctest_finding(self): + self.doctest(ebaysdk.finding) + + def test_run_doctest_inventorymanagement(self): + self.doctest(ebaysdk.inventorymanagement) + + def test_grequests(self): + if not sys.version_info[0] >= 3 \ + and sys.modules.has_key('grequests') is True: + + # self.doctest(ebaysdk.parallel) + pass + +if __name__ == '__main__': + unittest.main() diff --git a/tests/test_errors.py b/tests/test_errors.py new file mode 100644 index 0000000..def976d --- /dev/null +++ b/tests/test_errors.py @@ -0,0 +1,72 @@ +# -*- coding: utf-8 -*- + +''' +© 2012-2013 eBay Software Foundation +Authored by: Tim Keefer +Licensed under CDDL 1.0 +''' + +from __future__ import absolute_import +import os +import unittest +import ebaysdk.shopping +import lxml + +os.environ.setdefault("EBAY_YAML", "ebay.yaml") + +class TestErrors(unittest.TestCase): + + def test_single_item(self): + connection = ebaysdk.shopping.Connection(debug=True, version='799') + + for i in range(20): + connection.execute('GetSingleItem', { + 'ItemID': '262809803926', + 'version': '981', + 'IncludeSelector': ['Variations'] + }) + self.assertEqual(connection.response.status_code, 200) + self.assertEqual(type(connection.response.dom()), lxml.etree._Element) + +if __name__ == '__main__': + unittest.main() + +""" +Variations262809803926981 +2017-02-28 06:18:42,156 ebaysdk [DEBUG]:total time=0.478377819061 +2017-02-28 06:18:42,156 ebaysdk [DEBUG]:execute: verb=GetSingleItem data={'ItemID': '262809803926', 'version': 981, 'IncludeSelector': 'Variations'} +2017-02-28 06:18:42,157 ebaysdk [DEBUG]:REQUEST (3ff5f071-04c3-40c0-a4f0-57f04a9e9972): POST http://open.api.ebay.com/shopping +2017-02-28 06:18:42,157 ebaysdk [DEBUG]:headers={'Content-Length': '219', 'X-EBAY-API-REQUEST-ENCODING': 'XML', 'X-EBAY-API-VERSION': '799', 'User-Agent': 'eBaySDK/2.1.4 Pytho +n/2.7.6 Linux/3.13.0-91-generic', 'X-EBAY-SDK-REQUEST-ID': '3ff5f071-04c3-40c0-a4f0-57f04a9e9972', 'X-EBAY-API-SITE-ID': '0', 'X-EBAY-API-CALL-NAME': 'GetSingleItem', 'Content +-Type': 'text/xml', 'X-EBAY-API-APP-ID': 'LogoGrab-logograb-PRD-42f530923-a70f22b2'} +2017-02-28 06:18:42,157 ebaysdk [DEBUG]:body=Variations262809803926981 +2017-02-28 06:18:42,511 ebaysdk [DEBUG]:RESPONSE (3ff5f071-04c3-40c0-a4f0-57f04a9e9972): +2017-02-28 06:18:42,511 ebaysdk [DEBUG]:elapsed time=0:00:00.354254 +2017-02-28 06:18:42,511 ebaysdk [DEBUG]:status code=500 +2017-02-28 06:18:42,511 ebaysdk [DEBUG]:headers={'breadcrumbid': 'ID-slc4b03c-6483-stratus-slc-ebay-com-53764-1487075486325-0-1105919761', 'content-length': '25', 'accept-enco +ding': 'identity', 'x-ebay-api-request-encoding': 'XML', 'x-ebay-api-version': '799', 'user-agent': 'eBaySDK/2.1.4 Python/2.7.6 Linux/3.13.0-91-generic', 'connection': 'keep-a +live', 'x-ebay-sdk-request-id': '3ff5f071-04c3-40c0-a4f0-57f04a9e9972', 'x-ebay-api-site-id': '0', 'x-ebay-api-call-name': 'GetSingleItem', 'content-type': 'text/plain;charset +=utf-8', 'x-forwarded-for': '52.19.146.95', 'x-ebay-api-app-id': 'LogoGrab-logograb-PRD-42f530923-a70f22b2'} +2017-02-28 06:18:42,511 ebaysdk [DEBUG]:content=an internal error occured +2017-02-28 06:18:42,512 ebaysdk [DEBUG]:response parse failed: Start tag expected, '<' not found, line 1, column 1 +ERROR - 2017-02-28 06:18:42,512 - utils.firehose_util - MainProcess - MainThread: Shopping Call error: {"ItemID": "262809803926", "version": 981, "IncludeSelector": "Variation +s"} +Traceback (most recent call last): + File "/home/ubuntu/logograb2-detection-server/utils/firehose_util.py", line 235, in make_ebay_request + r = Shopping(appid=app_id, config_file=None, debug=True).execute('GetSingleItem', api_pars) + File "/usr/local/lib/python2.7/dist-packages/ebaysdk/connection.py", line 124, in execute + self.error_check() + File "/usr/local/lib/python2.7/dist-packages/ebaysdk/connection.py", line 209, in error_check + estr = self.error() + File "/usr/local/lib/python2.7/dist-packages/ebaysdk/connection.py", line 321, in error + error_array.extend(self._get_resp_body_errors()) + File "/usr/local/lib/python2.7/dist-packages/ebaysdk/shopping/__init__.py", line 188, in _get_resp_body_errors + dom = self.response.dom() + File "/usr/local/lib/python2.7/dist-packages/ebaysdk/response.py", line 233, in dom + return self._dom + File "/usr/local/lib/python2.7/dist-packages/ebaysdk/response.py", line 220, in __getattr__ + return getattr(self._obj, name) +AttributeError: 'Response' object has no attribute '_dom' +""" From 059cdd8cc039f183bd2181c7f3b1b134e0fb0297 Mon Sep 17 00:00:00 2001 From: Tim Keefer Date: Wed, 5 Apr 2017 17:12:26 -0700 Subject: [PATCH 02/34] remove debugging --- tests/test_errors.py | 40 ---------------------------------------- 1 file changed, 40 deletions(-) diff --git a/tests/test_errors.py b/tests/test_errors.py index def976d..8322010 100644 --- a/tests/test_errors.py +++ b/tests/test_errors.py @@ -30,43 +30,3 @@ def test_single_item(self): if __name__ == '__main__': unittest.main() - -""" -Variations262809803926981 -2017-02-28 06:18:42,156 ebaysdk [DEBUG]:total time=0.478377819061 -2017-02-28 06:18:42,156 ebaysdk [DEBUG]:execute: verb=GetSingleItem data={'ItemID': '262809803926', 'version': 981, 'IncludeSelector': 'Variations'} -2017-02-28 06:18:42,157 ebaysdk [DEBUG]:REQUEST (3ff5f071-04c3-40c0-a4f0-57f04a9e9972): POST http://open.api.ebay.com/shopping -2017-02-28 06:18:42,157 ebaysdk [DEBUG]:headers={'Content-Length': '219', 'X-EBAY-API-REQUEST-ENCODING': 'XML', 'X-EBAY-API-VERSION': '799', 'User-Agent': 'eBaySDK/2.1.4 Pytho -n/2.7.6 Linux/3.13.0-91-generic', 'X-EBAY-SDK-REQUEST-ID': '3ff5f071-04c3-40c0-a4f0-57f04a9e9972', 'X-EBAY-API-SITE-ID': '0', 'X-EBAY-API-CALL-NAME': 'GetSingleItem', 'Content --Type': 'text/xml', 'X-EBAY-API-APP-ID': 'LogoGrab-logograb-PRD-42f530923-a70f22b2'} -2017-02-28 06:18:42,157 ebaysdk [DEBUG]:body=Variations262809803926981 -2017-02-28 06:18:42,511 ebaysdk [DEBUG]:RESPONSE (3ff5f071-04c3-40c0-a4f0-57f04a9e9972): -2017-02-28 06:18:42,511 ebaysdk [DEBUG]:elapsed time=0:00:00.354254 -2017-02-28 06:18:42,511 ebaysdk [DEBUG]:status code=500 -2017-02-28 06:18:42,511 ebaysdk [DEBUG]:headers={'breadcrumbid': 'ID-slc4b03c-6483-stratus-slc-ebay-com-53764-1487075486325-0-1105919761', 'content-length': '25', 'accept-enco -ding': 'identity', 'x-ebay-api-request-encoding': 'XML', 'x-ebay-api-version': '799', 'user-agent': 'eBaySDK/2.1.4 Python/2.7.6 Linux/3.13.0-91-generic', 'connection': 'keep-a -live', 'x-ebay-sdk-request-id': '3ff5f071-04c3-40c0-a4f0-57f04a9e9972', 'x-ebay-api-site-id': '0', 'x-ebay-api-call-name': 'GetSingleItem', 'content-type': 'text/plain;charset -=utf-8', 'x-forwarded-for': '52.19.146.95', 'x-ebay-api-app-id': 'LogoGrab-logograb-PRD-42f530923-a70f22b2'} -2017-02-28 06:18:42,511 ebaysdk [DEBUG]:content=an internal error occured -2017-02-28 06:18:42,512 ebaysdk [DEBUG]:response parse failed: Start tag expected, '<' not found, line 1, column 1 -ERROR - 2017-02-28 06:18:42,512 - utils.firehose_util - MainProcess - MainThread: Shopping Call error: {"ItemID": "262809803926", "version": 981, "IncludeSelector": "Variation -s"} -Traceback (most recent call last): - File "/home/ubuntu/logograb2-detection-server/utils/firehose_util.py", line 235, in make_ebay_request - r = Shopping(appid=app_id, config_file=None, debug=True).execute('GetSingleItem', api_pars) - File "/usr/local/lib/python2.7/dist-packages/ebaysdk/connection.py", line 124, in execute - self.error_check() - File "/usr/local/lib/python2.7/dist-packages/ebaysdk/connection.py", line 209, in error_check - estr = self.error() - File "/usr/local/lib/python2.7/dist-packages/ebaysdk/connection.py", line 321, in error - error_array.extend(self._get_resp_body_errors()) - File "/usr/local/lib/python2.7/dist-packages/ebaysdk/shopping/__init__.py", line 188, in _get_resp_body_errors - dom = self.response.dom() - File "/usr/local/lib/python2.7/dist-packages/ebaysdk/response.py", line 233, in dom - return self._dom - File "/usr/local/lib/python2.7/dist-packages/ebaysdk/response.py", line 220, in __getattr__ - return getattr(self._obj, name) -AttributeError: 'Response' object has no attribute '_dom' -""" From 047223db7381372b06edb4ba3f6e94c8c27fb9da Mon Sep 17 00:00:00 2001 From: Tim Keefer Date: Mon, 10 Apr 2017 22:02:00 -0700 Subject: [PATCH 03/34] Revert "remove debugging" This reverts commit 38bb259167ae38194d0e199b6ff7feb61117c532. --- tests/test_errors.py | 40 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/tests/test_errors.py b/tests/test_errors.py index 8322010..def976d 100644 --- a/tests/test_errors.py +++ b/tests/test_errors.py @@ -30,3 +30,43 @@ def test_single_item(self): if __name__ == '__main__': unittest.main() + +""" +Variations262809803926981 +2017-02-28 06:18:42,156 ebaysdk [DEBUG]:total time=0.478377819061 +2017-02-28 06:18:42,156 ebaysdk [DEBUG]:execute: verb=GetSingleItem data={'ItemID': '262809803926', 'version': 981, 'IncludeSelector': 'Variations'} +2017-02-28 06:18:42,157 ebaysdk [DEBUG]:REQUEST (3ff5f071-04c3-40c0-a4f0-57f04a9e9972): POST http://open.api.ebay.com/shopping +2017-02-28 06:18:42,157 ebaysdk [DEBUG]:headers={'Content-Length': '219', 'X-EBAY-API-REQUEST-ENCODING': 'XML', 'X-EBAY-API-VERSION': '799', 'User-Agent': 'eBaySDK/2.1.4 Pytho +n/2.7.6 Linux/3.13.0-91-generic', 'X-EBAY-SDK-REQUEST-ID': '3ff5f071-04c3-40c0-a4f0-57f04a9e9972', 'X-EBAY-API-SITE-ID': '0', 'X-EBAY-API-CALL-NAME': 'GetSingleItem', 'Content +-Type': 'text/xml', 'X-EBAY-API-APP-ID': 'LogoGrab-logograb-PRD-42f530923-a70f22b2'} +2017-02-28 06:18:42,157 ebaysdk [DEBUG]:body=Variations262809803926981 +2017-02-28 06:18:42,511 ebaysdk [DEBUG]:RESPONSE (3ff5f071-04c3-40c0-a4f0-57f04a9e9972): +2017-02-28 06:18:42,511 ebaysdk [DEBUG]:elapsed time=0:00:00.354254 +2017-02-28 06:18:42,511 ebaysdk [DEBUG]:status code=500 +2017-02-28 06:18:42,511 ebaysdk [DEBUG]:headers={'breadcrumbid': 'ID-slc4b03c-6483-stratus-slc-ebay-com-53764-1487075486325-0-1105919761', 'content-length': '25', 'accept-enco +ding': 'identity', 'x-ebay-api-request-encoding': 'XML', 'x-ebay-api-version': '799', 'user-agent': 'eBaySDK/2.1.4 Python/2.7.6 Linux/3.13.0-91-generic', 'connection': 'keep-a +live', 'x-ebay-sdk-request-id': '3ff5f071-04c3-40c0-a4f0-57f04a9e9972', 'x-ebay-api-site-id': '0', 'x-ebay-api-call-name': 'GetSingleItem', 'content-type': 'text/plain;charset +=utf-8', 'x-forwarded-for': '52.19.146.95', 'x-ebay-api-app-id': 'LogoGrab-logograb-PRD-42f530923-a70f22b2'} +2017-02-28 06:18:42,511 ebaysdk [DEBUG]:content=an internal error occured +2017-02-28 06:18:42,512 ebaysdk [DEBUG]:response parse failed: Start tag expected, '<' not found, line 1, column 1 +ERROR - 2017-02-28 06:18:42,512 - utils.firehose_util - MainProcess - MainThread: Shopping Call error: {"ItemID": "262809803926", "version": 981, "IncludeSelector": "Variation +s"} +Traceback (most recent call last): + File "/home/ubuntu/logograb2-detection-server/utils/firehose_util.py", line 235, in make_ebay_request + r = Shopping(appid=app_id, config_file=None, debug=True).execute('GetSingleItem', api_pars) + File "/usr/local/lib/python2.7/dist-packages/ebaysdk/connection.py", line 124, in execute + self.error_check() + File "/usr/local/lib/python2.7/dist-packages/ebaysdk/connection.py", line 209, in error_check + estr = self.error() + File "/usr/local/lib/python2.7/dist-packages/ebaysdk/connection.py", line 321, in error + error_array.extend(self._get_resp_body_errors()) + File "/usr/local/lib/python2.7/dist-packages/ebaysdk/shopping/__init__.py", line 188, in _get_resp_body_errors + dom = self.response.dom() + File "/usr/local/lib/python2.7/dist-packages/ebaysdk/response.py", line 233, in dom + return self._dom + File "/usr/local/lib/python2.7/dist-packages/ebaysdk/response.py", line 220, in __getattr__ + return getattr(self._obj, name) +AttributeError: 'Response' object has no attribute '_dom' +""" From bf47d4c23d506e3a91c097e34bdfc79bd6ef13df Mon Sep 17 00:00:00 2001 From: Tim Keefer Date: Thu, 13 Apr 2017 08:36:29 -0700 Subject: [PATCH 04/34] Create ebay.yaml --- ebay.yaml | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 ebay.yaml diff --git a/ebay.yaml b/ebay.yaml new file mode 100644 index 0000000..fc170b6 --- /dev/null +++ b/ebay.yaml @@ -0,0 +1,27 @@ +name: ebay_api_config + +# Trading API Sandbox - https://www.x.com/developers/ebay/products/trading-api +api.sandbox.ebay.com: + compatability: 719 + appid: ENTER_YOUR_APPID_HERE + certid: ENTER_YOUR_CERTID_HERE + devid: ENTER_YOUR_DEVID_HERE + token: ENTER_YOUR_TOKEN_HERE + +# Trading API - https://www.x.com/developers/ebay/products/trading-api +api.ebay.com: + compatability: 719 + appid: ENTER_YOUR_APPID_HERE + certid: ENTER_YOUR_CERTID_HERE + devid: ENTER_YOUR_DEVID_HERE + token: ENTER_YOUR_TOKEN_HERE + +# Finding API - https://www.x.com/developers/ebay/products/finding-api +svcs.ebay.com: + appid: ENTER_YOUR_APPID_HERE + version: 1.0.0 + +# Shopping API - https://www.x.com/developers/ebay/products/shopping-api +open.api.ebay.com: + appid: ENTER_YOUR_APPID_HERE + version: 671 From d91e37441d77c72be6c97fede725d146cd8dcda1 Mon Sep 17 00:00:00 2001 From: Tim Keefer Date: Thu, 27 Apr 2017 12:15:23 -0700 Subject: [PATCH 05/34] pep8 fixes and added tests --- .gitignore | 1 + ebaysdk/parallel.py | 6 ++-- ebaysdk/soa/__init__.py | 18 ---------- ebaysdk/trading/__init__.py | 2 +- samples/trading.py | 19 +++++++++++ tests/test_base.py | 10 ++++-- tests/test_errors.py | 2 +- tests/test_request.py | 67 +++++++++++++++++++++++++++++++++++++ tox.ini | 6 +++- 9 files changed, 105 insertions(+), 26 deletions(-) create mode 100644 tests/test_request.py diff --git a/.gitignore b/.gitignore index 6d16747..0a764d8 100644 --- a/.gitignore +++ b/.gitignore @@ -13,3 +13,4 @@ ebaysdk.egg-info/ \.tox venv/ venv* +\.virtualenvs diff --git a/ebaysdk/parallel.py b/ebaysdk/parallel.py index bee0923..e40c769 100644 --- a/ebaysdk/parallel.py +++ b/ebaysdk/parallel.py @@ -6,12 +6,12 @@ Licensed under CDDL 1.0 ''' import sys +from ebaysdk.exception import ConnectionError +import grequests + if sys.version_info[0] >= 3: raise ImportError('grequests does not work with python3+') -import grequests -from ebaysdk.exception import ConnectionError - class Parallel(object): """ diff --git a/ebaysdk/soa/__init__.py b/ebaysdk/soa/__init__.py index 25193ab..67f003b 100644 --- a/ebaysdk/soa/__init__.py +++ b/ebaysdk/soa/__init__.py @@ -55,24 +55,6 @@ def load_from_app_config(self, app_config): def response_dict(self): return self.response.dict() - ''' - if self._response_dict: - return self._response_dict - - if self._response_content: - - mydict = self.response.dict() - - try: - verb = self.verb + 'Response' - self._response_dict = mydict['Envelope']['Body'][verb] - - except KeyError: - self._response_dict = mydict.get(self.verb + 'Response', mydict) - - return self._response_dict - ''' - def build_request_headers(self, verb): return { 'Content-Type': self.config.get('content_type'), diff --git a/ebaysdk/trading/__init__.py b/ebaysdk/trading/__init__.py index 183db30..faf808c 100644 --- a/ebaysdk/trading/__init__.py +++ b/ebaysdk/trading/__init__.py @@ -785,7 +785,7 @@ def _get_resp_body_errors(self): .format(eClass=eClass, severity=eSeverity, code=eCode, shortMsg=eShortMsg, longMsg=eLongMsg) - #from IPython import embed; embed() + # from IPython import embed; embed() if eSeverity == 'Warning': warnings.append(msg) diff --git a/samples/trading.py b/samples/trading.py index 00bc85b..01e5826 100644 --- a/samples/trading.py +++ b/samples/trading.py @@ -189,6 +189,25 @@ def verifyAddItemErrorCodes(opts): } } + motors_item = { + 'Item': { + 'Category': '101', + 'Title': 'My Title', + 'ItemCompatibilityList': { + 'Compatibility': [ + { + 'CompatibilityNotes': 'Fits for all trims and engines.', + 'NameValueList': [ + {'Name': 'Year', 'Value': '2001'}, + {'Name': 'Make', 'Value': 'Honda'}, + {'Name': 'Model', 'Value': 'Accord'} + ] + }, + ] + } + } + } + api.execute('VerifyAddItem', myitem) except ConnectionError as e: diff --git a/tests/test_base.py b/tests/test_base.py index 913e75b..c27431d 100644 --- a/tests/test_base.py +++ b/tests/test_base.py @@ -30,7 +30,7 @@ except ImportError: pass -os.environ.setdefault("EBAY_YAML", "ebay.yaml") +# os.environ.setdefault("EBAY_YAML", "ebay.yaml") class TestBase(unittest.TestCase): @@ -54,7 +54,13 @@ def test_run_doctest_connection(self): self.doctest(ebaysdk.connection) def test_run_doctest_shopping(self): - self.doctest(ebaysdk.shopping) + s = ebaysdk.shopping.Connection(config_file=os.environ.get('EBAY_YAML')) + resp = s.execute('GetCategoryInfo', + {'CategoryID': '-1', + 'IncludeSelector': ['ChildCategories']}) + self.assertEqual(s.response.reply.Ack, 'Success') + self.assertEqual(s.error(), None) + #self.doctest(ebaysdk.shopping) def test_run_doctest_trading(self): self.doctest(ebaysdk.trading) diff --git a/tests/test_errors.py b/tests/test_errors.py index def976d..a5b241d 100644 --- a/tests/test_errors.py +++ b/tests/test_errors.py @@ -17,7 +17,7 @@ class TestErrors(unittest.TestCase): def test_single_item(self): - connection = ebaysdk.shopping.Connection(debug=True, version='799') + connection = ebaysdk.shopping.Connection(version='799', config_file=os.environ.get('EBAY_YAML')) for i in range(20): connection.execute('GetSingleItem', { diff --git a/tests/test_request.py b/tests/test_request.py new file mode 100644 index 0000000..1f60954 --- /dev/null +++ b/tests/test_request.py @@ -0,0 +1,67 @@ +# -*- coding: utf-8 -*- + +''' +© 2012-2013 eBay Software Foundation +Authored by: Tim Keefer +Licensed under CDDL 1.0 +''' + +from __future__ import absolute_import +import os +import unittest +import re +from ebaysdk.utils import dict2xml + +os.environ.setdefault("EBAY_YAML", "ebay.yaml") + + +class TestBase(unittest.TestCase): + + def test_motors_compat_request_xml(self): + motors_dict = { + 'Item': { + 'Category': '101', + 'Title': 'My Title', + 'ItemCompatibilityList': { + 'Compatibility': [ + { + 'CompatibilityNotes': 'Fits for all trims and engines.', + 'NameValueList': [ + {'Name': 'Year', 'Value': '2001'}, + {'Name': 'Make', 'Value': 'Honda'}, + {'Name': 'Model', 'Value': 'Accord'} + ] + }, + ] + } + } + } + + motors_xml = """ + 101 + + + Fits for all trims and engines. + + Year2001 + + + MakeHonda + + + ModelAccord + + + + My Title + + """ + + motors_xml = re.sub(r'>\s+<', '><', motors_xml) + motors_xml = re.sub(r'\s+$', '', motors_xml) + + self.assertEqual(dict2xml(motors_dict), motors_xml) + + +if __name__ == '__main__': + unittest.main() diff --git a/tox.ini b/tox.ini index 0809def..2970c64 100644 --- a/tox.ini +++ b/tox.ini @@ -2,8 +2,12 @@ envlist = py27,py36 [testenv] +setenv = + EBAY_YAML = ebay_private.yaml + commands = pep8 --ignore=E202,E501 ebaysdk - pylint -E ebaysdk + pylint -E ebaysdk + python setup.py test whitelist_externals = make deps = pep8 pylint From 123d0122b0eda75bc9808d5388b62d7d09c81e9f Mon Sep 17 00:00:00 2001 From: Lukas Moors Date: Fri, 12 May 2017 11:24:13 +0200 Subject: [PATCH 06/34] Added str conversion of siteid --- ebaysdk/trading/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ebaysdk/trading/__init__.py b/ebaysdk/trading/__init__.py index faf808c..1349c19 100644 --- a/ebaysdk/trading/__init__.py +++ b/ebaysdk/trading/__init__.py @@ -681,7 +681,7 @@ def build_request_headers(self, verb): "X-EBAY-API-DEV-NAME": self.config.get('devid', ''), "X-EBAY-API-APP-NAME": self.config.get('appid', ''), "X-EBAY-API-CERT-NAME": self.config.get('certid', ''), - "X-EBAY-API-SITEID": self.config.get('siteid', ''), + "X-EBAY-API-SITEID": str(self.config.get('siteid', '')), "X-EBAY-API-CALL-NAME": self.verb, "Content-Type": "text/xml" } From 86985e3e0e84a48d44cf52b428c731c9fa6d4355 Mon Sep 17 00:00:00 2001 From: codeastar Date: Thu, 27 Jul 2017 14:44:55 +0800 Subject: [PATCH 07/34] Fix on issue #189 encode utf-8 on string object only --- ebaysdk/utils.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ebaysdk/utils.py b/ebaysdk/utils.py index 64ac996..edd0d13 100644 --- a/ebaysdk/utils.py +++ b/ebaysdk/utils.py @@ -97,7 +97,10 @@ def smart_encode_request_data(value): if sys.version_info[0] < 3: return value - return value.encode('utf-8') + if isinstance(value,str): + return value.encode('utf-8') + else: + return value except UnicodeDecodeError: return value From 8060a75203ffa609dfd2a32562ab19b3bd8d1d1a Mon Sep 17 00:00:00 2001 From: codeastar Date: Thu, 27 Jul 2017 14:51:30 +0800 Subject: [PATCH 08/34] Python 3.x compatibility update replace 'basestring' with 'str' --- ebaysdk/connection.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ebaysdk/connection.py b/ebaysdk/connection.py index 77d5f8f..ffa95cd 100644 --- a/ebaysdk/connection.py +++ b/ebaysdk/connection.py @@ -149,7 +149,7 @@ def build_request(self, verb, data, verb_attrs, files=None): requestData = self.build_request_data(verb, data, verb_attrs) if files: del(headers['Content-Type']) - if isinstance(requestData, basestring): # pylint: disable-msg=E0602 + if isinstance(requestData, str): # pylint: disable-msg=E0602 requestData = {'XMLPayload': requestData} request = Request(self.method, From 1bab59bbc436a90828fb74f68f2fe27e0c1f2247 Mon Sep 17 00:00:00 2001 From: Aaron Johnson Date: Sat, 30 Sep 2017 00:57:40 -0500 Subject: [PATCH 09/34] updated trading sample --- samples/trading.py | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/samples/trading.py b/samples/trading.py index 01e5826..5ec02cd 100644 --- a/samples/trading.py +++ b/samples/trading.py @@ -104,7 +104,8 @@ def verifyAddItem(opts): "Title": "Harry Potter and the Philosopher's Stone", "Description": "This is the first book in the Harry Potter series. In excellent condition!", "PrimaryCategory": {"CategoryID": "377"}, - "StartPrice": "1.0", + "StartPrice": "10.0", + "BuyItNowPrice": "15.0", "CategoryMappingAllowed": "true", "Country": "US", "ConditionID": "3000", @@ -124,12 +125,29 @@ def verifyAddItem(opts): "Description": "If you are not satisfied, return the book for refund.", "ShippingCostPaidByOption": "Buyer" }, + "SellerProfiles": { + "SellerPaymentProfile": { + "PaymentProfileName": "PayPal:Immediate pay", + }, + "SellerReturnProfile": { + "ReturnProfileName": "30 Day Return Policy", + }, + "SellerShippingProfile": { + "ShippingProfileName": "USPS First Class, Priority, Priority Express Flat Rate Envelope", + } + }, "ShippingDetails": { - "ShippingType": "Flat", + "ShippingType": "Calculated", "ShippingServiceOptions": { "ShippingServicePriority": "1", - "ShippingService": "USPSMedia", - "ShippingServiceCost": "2.50" + "ShippingService": "USPSMedia" + }, + "CalculatedShippingRate": { + "OriginatingPostalCode": "95125", + "PackagingHandlingCosts": "0.0", + "ShippingPackage": "PackageThickEnvelope", + "WeightMajor": "1", + "WeightMinor": "0" } }, "Site": "US" From 6bacf630e2c5ef0ebbe554f0151ed28fedeefe8c Mon Sep 17 00:00:00 2001 From: Tim Keefer Date: Fri, 13 Oct 2017 14:16:28 -0700 Subject: [PATCH 10/34] fix setup.py ascii issue --- ebaysdk/__init__.py | 4 ++-- setup.py | 6 +----- tests/test_errors.py | 2 +- tox.ini | 2 +- 4 files changed, 5 insertions(+), 9 deletions(-) diff --git a/ebaysdk/__init__.py b/ebaysdk/__init__.py index cf8ab9b..79b6c1a 100644 --- a/ebaysdk/__init__.py +++ b/ebaysdk/__init__.py @@ -9,8 +9,8 @@ import platform import logging -__version__ = '2.1.4' -Version = __version__ # for backware compatibility +__version__ = '2.1.5' +Version = __version__ # for backward compatibility try: from logging import NullHandler diff --git a/setup.py b/setup.py index dc3395e..fc03578 100644 --- a/setup.py +++ b/setup.py @@ -20,11 +20,7 @@ PKG = 'ebaysdk' -# Get the version -VERSIONFILE = os.path.join(PKG, "__init__.py") -version = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", - open(VERSIONFILE, "rt").read(), re.M).group(1) - +version = __import__(PKG).get_version() long_desc = """This SDK is a programatic inteface into the eBay APIs. It simplifies development and cuts development time by standerizing diff --git a/tests/test_errors.py b/tests/test_errors.py index a5b241d..2d4a8ae 100644 --- a/tests/test_errors.py +++ b/tests/test_errors.py @@ -16,7 +16,7 @@ class TestErrors(unittest.TestCase): - def test_single_item(self): + def DISABLE_test_single_item(self): connection = ebaysdk.shopping.Connection(version='799', config_file=os.environ.get('EBAY_YAML')) for i in range(20): diff --git a/tox.ini b/tox.ini index 2970c64..d555f73 100644 --- a/tox.ini +++ b/tox.ini @@ -3,7 +3,7 @@ envlist = py27,py36 [testenv] setenv = - EBAY_YAML = ebay_private.yaml + EBAY_YAML = /etc/ebay.yaml commands = pep8 --ignore=E202,E501 ebaysdk pylint -E ebaysdk From 9d28f5e53905cfefe941c1e23871a3df40eaa8e7 Mon Sep 17 00:00:00 2001 From: Tom Haddon Date: Fri, 4 May 2018 15:57:16 +0100 Subject: [PATCH 11/34] Add an option for domain to sample/findings.py so it can work with sandbox keys --- samples/finding.py | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/samples/finding.py b/samples/finding.py index 674c6f8..bb45bf5 100644 --- a/samples/finding.py +++ b/samples/finding.py @@ -31,6 +31,9 @@ def init_options(): parser.add_option("-a", "--appid", dest="appid", default=None, help="Specifies the eBay application id to use.") + parser.add_option("-n", "--domain", + dest="domain", default='svcs.ebay.com', + help="Specifies the eBay domain to use (e.g. svcs.sandbox.ebay.com).") (opts, args) = parser.parse_args() return opts, args @@ -39,7 +42,7 @@ def init_options(): def run(opts): try: - api = finding(debug=opts.debug, appid=opts.appid, + api = finding(debug=opts.debug, appid=opts.appid, domain=opts.domain, config_file=opts.yaml, warnings=True) api_request = { @@ -66,7 +69,7 @@ def run(opts): def run_unicode(opts): try: - api = finding(debug=opts.debug, appid=opts.appid, + api = finding(debug=opts.debug, appid=opts.appid, domain=opts.domain, config_file=opts.yaml, warnings=True) api_request = { @@ -88,7 +91,7 @@ def run_unicode(opts): def run2(opts): try: - api = finding(debug=opts.debug, appid=opts.appid, + api = finding(debug=opts.debug, appid=opts.appid, domain=opts.domain, config_file=opts.yaml) response = api.execute('findItemsByProduct', @@ -103,7 +106,7 @@ def run2(opts): def run_motors(opts): api = finding(siteid='EBAY-MOTOR', debug=opts.debug, appid=opts.appid, config_file=opts.yaml, - warnings=True) + domain=opts.domain, warnings=True) api.execute('findItemsAdvanced', { 'keywords': 'tesla', From b357af5924858176999706cc7631214e2df48dea Mon Sep 17 00:00:00 2001 From: Tim Keefer Date: Thu, 7 Jun 2018 09:27:31 -0700 Subject: [PATCH 12/34] add storeMeta code to sample code --- ebaysdk/finding/__init__.py | 1 + samples/storeMeta.py | 282 ++++++++++++++++++++++++++++++++++++ samples/trading.py | 7 +- 3 files changed, 286 insertions(+), 4 deletions(-) create mode 100644 samples/storeMeta.py diff --git a/ebaysdk/finding/__init__.py b/ebaysdk/finding/__init__.py index fb0ba25..34dd83e 100644 --- a/ebaysdk/finding/__init__.py +++ b/ebaysdk/finding/__init__.py @@ -99,6 +99,7 @@ def __init__(self, **kwargs): 'finditemsbykeywordsresponse.categoryhistogramcontainer.categoryhistogram', 'finditemsbyproductresponse.categoryhistogramcontainer.categoryhistogram', 'finditemsinebaystoresresponse.categoryhistogramcontainer.categoryhistogram', + 'finditemsinebaystoresresponse.categoryhistogramcontainer.categoryhistogram.childcategoryhistogram', 'findcompleteditemsresponse.aspecthistogramcontainer.aspect', 'finditemsadvancedresponse.aspecthistogramcontainer.aspect', 'finditemsbycategoryresponse.aspecthistogramcontainer.aspect', diff --git a/samples/storeMeta.py b/samples/storeMeta.py new file mode 100644 index 0000000..9098e53 --- /dev/null +++ b/samples/storeMeta.py @@ -0,0 +1,282 @@ +# -*- coding: utf-8 -*- +''' +© 2012-2013 eBay Software Foundation +Authored by: Tim Keefer +Licensed under CDDL 1.0 +''' + +import os +import sys +from optparse import OptionParser +import csv +import json +import requests + +sys.path.insert(0, '%s/../' % os.path.dirname(__file__)) + +from common import dump + +import ebaysdk +from ebaysdk.finding import Connection as finding +from ebaysdk.exception import ConnectionError, RequestPaginationError, PaginationLimit + + +def init_options(): + usage = "usage: %prog [options]" + parser = OptionParser(usage=usage) + + parser.add_option("-d", "--debug", + action="store_true", dest="debug", default=False, + help="Enabled debugging [default: %default]") + parser.add_option("-y", "--yaml", + dest="yaml", default='ebay.yaml', + help="Specifies the name of the YAML defaults file. [default: %default]") + parser.add_option("-a", "--appid", + dest="appid", default=None, + help="Specifies the eBay application id to use.") + parser.add_option("-s", "--store_name", + dest="store_name", default=None, + help="Store name") + parser.add_option("-f", "--file", + dest="input_file", default=None, + help="Input file containing store names.") + parser.add_option("-o", "--offset", + dest="offset", default=0, + help="Input file line offset.") + parser.add_option("-e", "--line_end", + dest="line_end", default=None, + help="Input file lines.") + + (opts, args) = parser.parse_args() + return opts, args + + +def run(opts): + + data = None + if opts.store_name: + data = get_store_meta(opts.store_name) + print(data) + + if opts.input_file: + lines = [] + with open(opts.input_file, newline='') as csvfile: + for row1 in csv.reader(csvfile, delimiter=',', quotechar='"'): + name = row1[1] + desc = row1[2].replace('\n', '') + logo = row1[3] + sub = row1[4] + lines.append([name, desc, logo, sub]) + + for row in lines[int(opts.offset):(int(opts.offset)+1000)]: + print("(%s)" % row) + + if row[3] == 'http://': + row[3] = None + + if row[0] and row[2] and row[3]: + if record_exists(row[0]): + print("skipping %s" % row[0]) + continue + + try: + data = get_store_meta(row[0]) + except Exception as e: + print("Exception %s" % e) + + if not data: + continue + + data['store_logo'] = row[2] + data['store_name'] = row[0] + data['store_description'] = row[1] + data['subscription_level'] = row[3] + + req = requests.post( + 'http://elastic-1-2467465.lvs02.dev.ebayc3.com:9200/stores/storeMeta', + data=json.dumps(data, sort_keys=True) + ) + print(req.text) + + else: + pass + + +def record_exists(store_name): + query = { + "query": { + "match": { + "store_name": { + "query": store_name, + "type": "phrase" + } + } + } + } + + query_req = requests.get('http://elastic-1-2467465.lvs02.dev.ebayc3.com:9200/stores/storeMeta/_search', + data=json.dumps(query, sort_keys=True)) + + try: + record_id = query_req.json()['hits']['hits'][0]['_id'] + except Exception as e: + record_id = None + + return record_id + + +def get_store_meta(store_name): + + try: + api = finding(debug=opts.debug, appid=opts.appid, + config_file=opts.yaml) + + response = api.execute('findItemsIneBayStores', { + 'storeName': store_name, + 'outputSelector': [ + 'CategoryHistogram', + 'AspectHistogram', + 'SellerInfo', + 'StoreInfo', + ]} + ) + + if response.reply.ack != 'Success': + return {} + + if int(response.reply.paginationOutput.totalEntries) <= 0: + return {} + + data = { + 'followers': 0, + 'item_count': response.reply.paginationOutput.totalEntries, + 'seller_name': response.reply.searchResult.item[0].sellerInfo.sellerUserName, + 'store_url': response.reply.searchResult.item[0].storeInfo.storeURL, + 'feedback_score': response.reply.searchResult.item[0].sellerInfo.feedbackScore, + 'positive_feedback_percent': response.reply.searchResult.item[0].sellerInfo.positiveFeedbackPercent, + 'top_rated_seller': response.reply.searchResult.item[0].sellerInfo.topRatedSeller, + 'country_code': response.reply.searchResult.item[0].country, + } + + agg_data = { + 'cat_asp': {}, + 'watch_count': 0, + 'L0': [], + 'L1': [], + } + + dominate_l0_cat_count = 0 + dominate_l1_cat_count = 0 + + for lev0 in response.reply.categoryHistogramContainer.categoryHistogram: + agg_data['L0'].append({ + 'category_id': lev0.categoryId, + 'category_name': lev0.categoryName, + 'item_count': lev0.count + }) + + if int(lev0.count) > dominate_l0_cat_count: + dominate_l0_cat_count = int(lev0.count) + agg_data['dominate_l0_category_id'] = lev0.categoryId + agg_data['dominate_l0_category_name'] = lev0.categoryName + + for lev1 in lev0.childCategoryHistogram: + agg_data['L1'].append({ + 'category_id': lev1.categoryId, + 'category_name': lev1.categoryName, + 'item_count': lev1.count + }) + + if int(lev1.count) > dominate_l1_cat_count: + dominate_l1_cat_count = int(lev1.count) + agg_data['dominate_l1_category_id'] = lev1.categoryId + agg_data['dominate_l1_category_name'] = lev1.categoryName + + + + for category_node in agg_data['L1']: + category_id = category_node['category_id'] + + category_call = api.execute('findItemsIneBayStores', { + 'storeName': store_name, + 'categoryId': category_id, + 'outputSelector': [ + 'CategoryHistogram', + 'AspectHistogram', + 'SellerInfo', + 'StoreInfo', + ]} + ) + + if category_call.reply.ack != 'Success': + return {} + + if int(category_call.reply.paginationOutput.totalEntries) <= 0: + return {} + + analyze_items(category_call.reply.searchResult.item, category_id, agg_data) + + try: + while True: + category_call2 = api.next_page() + analyze_items(category_call2.reply.searchResult.item, category_id, agg_data) + + except PaginationLimit as e: + pass + + dom_l1_asp = average_asp( + agg_data['cat_asp'][agg_data['dominate_l1_category_id']] + ) + + for category_node in agg_data['L1']: + asp = average_asp(agg_data['cat_asp'][category_node['category_id']]) + category_node.update({'asp': asp}) + + data.update({ + 'L0': agg_data['L0'], + 'L1': agg_data['L1'], + 'watch_count': agg_data['watch_count'], + 'postal_code': agg_data.get('postal_code', None), + 'dominate_category_id': agg_data['dominate_l0_category_id'], + 'dominate_category_name': agg_data['dominate_l0_category_name'], + 'dominate_l1_category_id': agg_data['dominate_l1_category_id'], + 'dominate_l1_category_name': agg_data['dominate_l1_category_name'], + 'dominate_l1_category_asp': dom_l1_asp, + }) + + #from IPython import embed; + #embed() + + return data + + except ConnectionError as e: + print(e) + + +def average_asp(prices): + total = sum(prices) + if total > 0: + return total / len(prices) + else: + return 0 + + +def analyze_items(items, category_id, agg_data): + + for item in items: + if not agg_data['cat_asp'].get(category_id, None): + agg_data['cat_asp'][category_id] = [] + + agg_data['cat_asp'][category_id].append(float(item.sellingStatus.currentPrice.value)) + if getattr(item.listingInfo, 'watchCount', None): + agg_data['watch_count'] += int(item.listingInfo.watchCount) + + if getattr(item, 'postalCode', None): + agg_data['postal_code'] = item.postalCode + + +if __name__ == "__main__": + print("Finding samples for SDK version %s" % ebaysdk.get_version()) + (opts, args) = init_options() + + run(opts) diff --git a/samples/trading.py b/samples/trading.py index 01e5826..4407153 100644 --- a/samples/trading.py +++ b/samples/trading.py @@ -336,7 +336,7 @@ def categories(opts): try: api = Trading(debug=opts.debug, config_file=opts.yaml, appid=opts.appid, - certid=opts.certid, devid=opts.devid, warnings=True, timeout=20, siteid='101') + certid=opts.certid, devid=opts.devid, warnings=True, timeout=20, siteid='0') callData = { 'DetailLevel': 'ReturnAll', @@ -365,7 +365,6 @@ def categories(opts): print("Trading API Samples for version %s" % ebaysdk.get_version()) - """ run(opts) feedback(opts) verifyAddItem(opts) @@ -375,6 +374,6 @@ def categories(opts): uploadPictureFromFilesystem(opts, ("%s/test_image.jpg" % os.path.dirname(__file__))) memberMessages(opts) categories(opts) - """ - getUser(opts) + + # getUser(opts) # getOrders(opts) From ff19b4504f372242fd29113a3f67928f777d6cf7 Mon Sep 17 00:00:00 2001 From: w- Date: Tue, 26 Jun 2018 13:35:47 +0700 Subject: [PATCH 13/34] Make compatible with python 3 --- ebaysdk/connection.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/ebaysdk/connection.py b/ebaysdk/connection.py index 77d5f8f..370acd8 100644 --- a/ebaysdk/connection.py +++ b/ebaysdk/connection.py @@ -149,8 +149,13 @@ def build_request(self, verb, data, verb_attrs, files=None): requestData = self.build_request_data(verb, data, verb_attrs) if files: del(headers['Content-Type']) - if isinstance(requestData, basestring): # pylint: disable-msg=E0602 - requestData = {'XMLPayload': requestData} + # Python 3 compatibility + try: + if isinstance(requestData, basestring): # pylint: disable-msg=E0602 + requestData = {'XMLPayload': requestData} + except NameError: + if isinstance(requestData, str): # pylint: disable-msg=E0602 + requestData = {'XMLPayload': requestData} request = Request(self.method, url, From 7f97b94e5c2eb623c9430c6c7a83a5abf94cce99 Mon Sep 17 00:00:00 2001 From: w- Date: Tue, 26 Jun 2018 13:47:17 +0700 Subject: [PATCH 14/34] don't pass dict to smart_encode_request_data --- ebaysdk/connection.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ebaysdk/connection.py b/ebaysdk/connection.py index 370acd8..393348d 100644 --- a/ebaysdk/connection.py +++ b/ebaysdk/connection.py @@ -149,6 +149,7 @@ def build_request(self, verb, data, verb_attrs, files=None): requestData = self.build_request_data(verb, data, verb_attrs) if files: del(headers['Content-Type']) + requestData = smart_encode_request_data(requestData) # Python 3 compatibility try: if isinstance(requestData, basestring): # pylint: disable-msg=E0602 @@ -159,7 +160,7 @@ def build_request(self, verb, data, verb_attrs, files=None): request = Request(self.method, url, - data=smart_encode_request_data(requestData), + data=requestData, headers=headers, files=files, ) From 26a101a2bbabb22cc02de18a6b93de7bb6ced1e5 Mon Sep 17 00:00:00 2001 From: w- Date: Tue, 26 Jun 2018 13:51:22 +0700 Subject: [PATCH 15/34] Logic Errors on previous commit --- ebaysdk/connection.py | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/ebaysdk/connection.py b/ebaysdk/connection.py index 393348d..3b6a89b 100644 --- a/ebaysdk/connection.py +++ b/ebaysdk/connection.py @@ -149,14 +149,16 @@ def build_request(self, verb, data, verb_attrs, files=None): requestData = self.build_request_data(verb, data, verb_attrs) if files: del(headers['Content-Type']) - requestData = smart_encode_request_data(requestData) # Python 3 compatibility try: - if isinstance(requestData, basestring): # pylint: disable-msg=E0602 - requestData = {'XMLPayload': requestData} + CLS_TO_COMPARE=basestring except NameError: - if isinstance(requestData, str): # pylint: disable-msg=E0602 - requestData = {'XMLPayload': requestData} + CLS_TO_COMPARE=str + if isinstance(requestData, CLS_TO_COMPARE): # pylint: disable-msg=E0602 + requestData = {'XMLPayload': smart_encode_request_data(requestData)} + else: + requestData = smart_encode_request_data(requestData) + request = Request(self.method, url, From b53ddd325477570cefb0e84b81bcf86a9d6c5787 Mon Sep 17 00:00:00 2001 From: Tim Keefer Date: Mon, 3 Sep 2018 12:31:16 -0700 Subject: [PATCH 16/34] update tox to use pycodestyle instead of pep8 --- tox.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index d555f73..406235c 100644 --- a/tox.ini +++ b/tox.ini @@ -5,11 +5,11 @@ envlist = py27,py36 setenv = EBAY_YAML = /etc/ebay.yaml -commands = pep8 --ignore=E202,E501 ebaysdk +commands = pycodestyle --ignore=E202,E501 ebaysdk pylint -E ebaysdk python setup.py test whitelist_externals = make -deps = pep8 +deps = pycodestyle pylint pytest From c977cd8d7d4e3056817f3f6940ee6ed8940206d0 Mon Sep 17 00:00:00 2001 From: Tim Keefer Date: Wed, 5 Sep 2018 11:13:36 -0700 Subject: [PATCH 17/34] Revert "Make compatible with python 3" --- ebaysdk/connection.py | 14 +++----------- 1 file changed, 3 insertions(+), 11 deletions(-) diff --git a/ebaysdk/connection.py b/ebaysdk/connection.py index 3b6a89b..77d5f8f 100644 --- a/ebaysdk/connection.py +++ b/ebaysdk/connection.py @@ -149,20 +149,12 @@ def build_request(self, verb, data, verb_attrs, files=None): requestData = self.build_request_data(verb, data, verb_attrs) if files: del(headers['Content-Type']) - # Python 3 compatibility - try: - CLS_TO_COMPARE=basestring - except NameError: - CLS_TO_COMPARE=str - if isinstance(requestData, CLS_TO_COMPARE): # pylint: disable-msg=E0602 - requestData = {'XMLPayload': smart_encode_request_data(requestData)} - else: - requestData = smart_encode_request_data(requestData) - + if isinstance(requestData, basestring): # pylint: disable-msg=E0602 + requestData = {'XMLPayload': requestData} request = Request(self.method, url, - data=requestData, + data=smart_encode_request_data(requestData), headers=headers, files=files, ) From 7198ac79a29dd7606ad403f96170a3b9d7f165ce Mon Sep 17 00:00:00 2001 From: Tim Keefer Date: Wed, 5 Sep 2018 13:54:34 -0700 Subject: [PATCH 18/34] fix socket warning --- ebaysdk/connection.py | 1 + 1 file changed, 1 insertion(+) diff --git a/ebaysdk/connection.py b/ebaysdk/connection.py index 77d5f8f..2049509 100644 --- a/ebaysdk/connection.py +++ b/ebaysdk/connection.py @@ -208,6 +208,7 @@ def process_response(self, parse_response=True): datetime_nodes=self.datetime_nodes, parse_response=parse_response) + self.session.close() # set for backward compatibility self._response_content = self.response.content From 7dda80c502397f3732591f568de278b2edd0e084 Mon Sep 17 00:00:00 2001 From: Tim Keefer Date: Wed, 5 Sep 2018 13:55:46 -0700 Subject: [PATCH 19/34] add test that includes more unicode --- ebaysdk/finding/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ebaysdk/finding/__init__.py b/ebaysdk/finding/__init__.py index 34dd83e..34cebed 100644 --- a/ebaysdk/finding/__init__.py +++ b/ebaysdk/finding/__init__.py @@ -28,7 +28,7 @@ class Connection(BaseConnection): Doctests: >>> f = Connection(config_file=os.environ.get('EBAY_YAML'), debug=False) - >>> retval = f.execute('findItemsAdvanced', {'keywords': u'niño'}) + >>> retval = f.execute('findItemsAdvanced', {'keywords': u'Kościół'}) >>> error = f.error() >>> print(error) None From c00d225a67b6423fd8ccefff69fc676c29447dfc Mon Sep 17 00:00:00 2001 From: Tim Keefer Date: Tue, 11 Sep 2018 14:56:25 -0700 Subject: [PATCH 20/34] update finding test and clean up lint errors --- ebaysdk/finding/__init__.py | 2 +- ebaysdk/parallel.py | 3 +++ ebaysdk/utils.py | 13 +++++++------ 3 files changed, 11 insertions(+), 7 deletions(-) diff --git a/ebaysdk/finding/__init__.py b/ebaysdk/finding/__init__.py index 34cebed..468930a 100644 --- a/ebaysdk/finding/__init__.py +++ b/ebaysdk/finding/__init__.py @@ -28,7 +28,7 @@ class Connection(BaseConnection): Doctests: >>> f = Connection(config_file=os.environ.get('EBAY_YAML'), debug=False) - >>> retval = f.execute('findItemsAdvanced', {'keywords': u'Kościół'}) + >>> retval = f.execute('findItemsAdvanced', {'keywords': u'El Niño'}) >>> error = f.error() >>> print(error) None diff --git a/ebaysdk/parallel.py b/ebaysdk/parallel.py index e40c769..bc311e5 100644 --- a/ebaysdk/parallel.py +++ b/ebaysdk/parallel.py @@ -7,7 +7,10 @@ ''' import sys from ebaysdk.exception import ConnectionError + +# pylint: disable=import-error import grequests +# pylint: enable=import-error if sys.version_info[0] >= 3: raise ImportError('grequests does not work with python3+') diff --git a/ebaysdk/utils.py b/ebaysdk/utils.py index edd0d13..fdc26c5 100644 --- a/ebaysdk/utils.py +++ b/ebaysdk/utils.py @@ -97,12 +97,12 @@ def smart_encode_request_data(value): if sys.version_info[0] < 3: return value - if isinstance(value,str): - return value.encode('utf-8') + if isinstance(value, str): + return value.encode('utf-8') else: - return value + return value - except UnicodeDecodeError: + except UnicodeDecodeError as e: return value @@ -298,7 +298,7 @@ def getValue(response_dict, *args, **kwargs): if len(args) == 1: try: return h.get('value', None) - except: + except Exception as e: return h last = args_a.pop() @@ -310,7 +310,7 @@ def getValue(response_dict, *args, **kwargs): try: return h.get('value', None) - except: + except Exception as e: return h @@ -347,6 +347,7 @@ def perftest_dict2xml(): xml = dict2xml(sample_dict) + if __name__ == '__main__': import timeit From fd3417ad3d0007e5abb4b826707c3b9e72f97e9e Mon Sep 17 00:00:00 2001 From: egdoc Date: Thu, 20 Dec 2018 16:15:55 +0100 Subject: [PATCH 21/34] added 'getmyebaysellingresponse.activelist.itemarray.item' to the Trading api class base_list_nodes --- ebaysdk/trading/__init__.py | 1 + 1 file changed, 1 insertion(+) diff --git a/ebaysdk/trading/__init__.py b/ebaysdk/trading/__init__.py index 1349c19..1f00e1d 100644 --- a/ebaysdk/trading/__init__.py +++ b/ebaysdk/trading/__init__.py @@ -217,6 +217,7 @@ def __init__(self, **kwargs): 'getmembermessagesresponse.abstractrequest.outputselector', 'getmyebaybuyingresponse.abstractrequest.outputselector', 'getmyebaysellingresponse.abstractrequest.outputselector', + 'getmyebaysellingresponse.activelist.itemarray.item', 'getmymessagesresponse.abstractrequest.outputselector', 'getnotificationpreferencesresponse.abstractrequest.outputselector', 'getordersresponse.abstractrequest.outputselector', From bd3ecf571171084d08bc78d236efea53db112c53 Mon Sep 17 00:00:00 2001 From: Kevin Zhang Date: Wed, 12 Jun 2019 15:20:22 +1200 Subject: [PATCH 22/34] update samples with param: 'domain' --- ebaysdk/parallel.py | 8 +++++--- samples/calls_with_unicode.py | 10 ++++++---- samples/finditem.py | 5 ++++- samples/merchandising.py | 5 ++++- samples/parallel.py | 10 ++++++---- samples/parallel_gevent.py | 5 ++++- samples/policies.py | 7 +++++-- samples/shopping.py | 11 ++++++----- samples/storeMeta.py | 6 ++++-- samples/trading.py | 27 +++++++++++++++------------ 10 files changed, 59 insertions(+), 35 deletions(-) diff --git a/ebaysdk/parallel.py b/ebaysdk/parallel.py index bc311e5..92aff86 100644 --- a/ebaysdk/parallel.py +++ b/ebaysdk/parallel.py @@ -8,14 +8,16 @@ import sys from ebaysdk.exception import ConnectionError -# pylint: disable=import-error -import grequests -# pylint: enable=import-error +# pylint: enable=import-error if sys.version_info[0] >= 3: raise ImportError('grequests does not work with python3+') +# pylint: disable=import-error +import grequests + + class Parallel(object): """ >>> from ebaysdk.finding import Connection as finding diff --git a/samples/calls_with_unicode.py b/samples/calls_with_unicode.py index 26ea1a2..cf77e6b 100644 --- a/samples/calls_with_unicode.py +++ b/samples/calls_with_unicode.py @@ -30,7 +30,9 @@ def init_options(): parser.add_option("-a", "--appid", dest="appid", default=None, help="Specifies the eBay application id to use.") - + parser.add_option("-n", "--domain", + dest="domain", default='svcs.ebay.com', + help="Specifies the eBay domain to use (e.g. svcs.sandbox.ebay.com).") (opts, args) = parser.parse_args() return opts, args @@ -38,7 +40,7 @@ def init_options(): def run(opts): try: - api = finding(debug=opts.debug, appid=opts.appid, + api = finding(debug=opts.debug, appid=opts.appid, domain=opts.domain, config_file=opts.yaml, warnings=True) api_request = { @@ -65,7 +67,7 @@ def run(opts): def run_unicode(opts): try: - api = finding(debug=opts.debug, appid=opts.appid, + api = finding(debug=opts.debug, appid=opts.appid, domain=opts.domain, config_file=opts.yaml, warnings=True) api_request = { @@ -83,7 +85,7 @@ def run_unicode(opts): except ConnectionError as e: print(e) print(e.response.dict()) - + if __name__ == "__main__": print("Unicode samples for SDK version %s" % ebaysdk.get_version()) (opts, args) = init_options() diff --git a/samples/finditem.py b/samples/finditem.py index 492b01d..1fdc9fc 100644 --- a/samples/finditem.py +++ b/samples/finditem.py @@ -36,6 +36,9 @@ def init_options(): parser.add_option("-c", "--consumer_id", dest="consumer_id", default=None, help="Specifies the eBay consumer_id id to use.") + parser.add_option("-n", "--domain", + dest="domain", default='svcs.ebay.com', + help="Specifies the eBay domain to use (e.g. svcs.sandbox.ebay.com).") (opts, args) = parser.parse_args() return opts, args @@ -45,7 +48,7 @@ def run(opts): try: - shopping = Shopping(debug=opts.debug, appid=opts.appid, + shopping = Shopping(debug=opts.debug, appid=opts.appid, domain=opts.domain, config_file=opts.yaml, warnings=False) response = shopping.execute('FindPopularItems', diff --git a/samples/merchandising.py b/samples/merchandising.py index a6d090c..d4d1635 100644 --- a/samples/merchandising.py +++ b/samples/merchandising.py @@ -30,6 +30,9 @@ def init_options(): parser.add_option("-a", "--appid", dest="appid", default=None, help="Specifies the eBay application id to use.") + parser.add_option("-n", "--domain", + dest="domain", default='svcs.ebay.com', + help="Specifies the eBay domain to use (e.g. svcs.sandbox.ebay.com).") (opts, args) = parser.parse_args() return opts, args @@ -37,7 +40,7 @@ def init_options(): def run(opts): try: - api = merchandising(debug=opts.debug, appid=opts.appid, + api = merchandising(debug=opts.debug, appid=opts.appid, domain=opts.domain, config_file=opts.yaml, warnings=True) response = api.execute('getMostWatchedItems', {'maxResults': 4}) diff --git a/samples/parallel.py b/samples/parallel.py index 45a55ca..e8aa127 100644 --- a/samples/parallel.py +++ b/samples/parallel.py @@ -31,7 +31,9 @@ def init_options(): parser.add_option("-a", "--appid", dest="appid", default=None, help="Specifies the eBay application id to use.") - + parser.add_option("-n", "--domain", + dest="domain", default='svcs.ebay.com', + help="Specifies the eBay domain to use (e.g. svcs.sandbox.ebay.com).") (opts, args) = parser.parse_args() return opts, args @@ -42,7 +44,7 @@ def run(opts): p = Parallel() apis = [] - api1 = finding(parallel=p, debug=opts.debug, + api1 = finding(parallel=p, debug=opts.debug, domain=opts.domain, appid=opts.appid, config_file=opts.yaml) api1.execute('findItemsAdvanced', {'keywords': 'python'}) apis.append(api1) @@ -51,12 +53,12 @@ def run(opts): api4.execute('http://www.ebay.com/sch/i.html?_nkw=Shirt&_rss=1') apis.append(api4) - api2 = finding(parallel=p, debug=opts.debug, + api2 = finding(parallel=p, debug=opts.debug, domain=opts.domain, appid=opts.appid, config_file=opts.yaml) api2.execute('findItemsAdvanced', {'keywords': 'perl'}) apis.append(api2) - api3 = finding(parallel=p, debug=opts.debug, + api3 = finding(parallel=p, debug=opts.debug, domain=opts.domain, appid=opts.appid, config_file=opts.yaml) api3.execute('findItemsAdvanced', {'keywords': 'php'}) apis.append(api3) diff --git a/samples/parallel_gevent.py b/samples/parallel_gevent.py index 1a5b760..521e7f5 100644 --- a/samples/parallel_gevent.py +++ b/samples/parallel_gevent.py @@ -32,6 +32,9 @@ def init_options(): parser.add_option("-a", "--appid", dest="appid", default=None, help="Specifies the eBay application id to use.") + parser.add_option("-n", "--domain", + dest="domain", default='svcs.ebay.com', + help="Specifies the eBay domain to use (e.g. svcs.sandbox.ebay.com).") (opts, args) = parser.parse_args() return opts, args @@ -46,7 +49,7 @@ def run(opts): calls = [] for page in range(1, 10): - api = finding(debug=opts.debug, appid=opts.appid, + api = finding(debug=opts.debug, appid=opts.appid, domain=opts.domain, config_file=opts.yaml) call = gevent.spawn(api.execute, 'findItemsAdvanced', diff --git a/samples/policies.py b/samples/policies.py index 696a0c6..53b4658 100644 --- a/samples/policies.py +++ b/samples/policies.py @@ -39,6 +39,9 @@ def init_options(): parser.add_option("-c", "--certid", dest="certid", default=None, help="Specifies the eBay cert id to use.") + parser.add_option("-n", "--domain", + dest="domain", default='svcs.ebay.com', + help="Specifies the eBay domain to use (e.g. svcs.sandbox.ebay.com).") (opts, args) = parser.parse_args() return opts, args @@ -46,7 +49,7 @@ def init_options(): def getSellerProfiles(opts): try: - api = Policies(debug=opts.debug, config_file=opts.yaml, appid=opts.appid, + api = Policies(debug=opts.debug, config_file=opts.yaml, appid=opts.appid, domain=opts.domain, certid=opts.certid, devid=opts.devid) api.execute('getSellerProfiles') @@ -59,7 +62,7 @@ def getSellerProfiles(opts): def getConsolidationJobStatus(opts): try: - api = Policies(debug=opts.debug, config_file=opts.yaml, appid=opts.appid, + api = Policies(debug=opts.debug, config_file=opts.yaml, appid=opts.appid, domain=opts.domain, certid=opts.certid, devid=opts.devid) api.execute('getConsolidationJobStatus') diff --git a/samples/shopping.py b/samples/shopping.py index 703409b..888ce50 100644 --- a/samples/shopping.py +++ b/samples/shopping.py @@ -36,13 +36,16 @@ def init_options(): parser.add_option("-a", "--appid", dest="appid", default=None, help="Specifies the eBay application id to use.") + parser.add_option("-n", "--domain", + dest="domain", default='svcs.ebay.com', + help="Specifies the eBay domain to use (e.g. svcs.sandbox.ebay.com).") (opts, args) = parser.parse_args() return opts, args def run(opts): - api = Shopping(debug=opts.debug, appid=opts.appid, config_file=opts.yaml, + api = Shopping(debug=opts.debug, appid=opts.appid, config_file=opts.yaml, domain=opts.domain, warnings=True) print("Shopping samples for SDK version %s" % ebaysdk.get_version()) @@ -63,7 +66,7 @@ def run(opts): def popularSearches(opts): - api = Shopping(debug=opts.debug, appid=opts.appid, config_file=opts.yaml, + api = Shopping(debug=opts.debug, appid=opts.appid, config_file=opts.yaml, domain=opts.domain, warnings=True) choice = True @@ -93,7 +96,6 @@ def popularSearches(opts): 'QueryKeywords': term, 'MaxEntries': 3}) print("Term: %s" % term) - try: for item in response.reply.ItemArray.Item: print(item.Title) @@ -101,7 +103,6 @@ def popularSearches(opts): pass dump(api) - print("\n") except ConnectionError as e: @@ -112,7 +113,7 @@ def popularSearches(opts): def categoryInfo(opts): try: - api = Shopping(debug=opts.debug, appid=opts.appid, config_file=opts.yaml, + api = Shopping(debug=opts.debug, appid=opts.appid, config_file=opts.yaml, domain=opts.domain, warnings=True) response = api.execute('GetCategoryInfo', {"CategoryID": 3410}) diff --git a/samples/storeMeta.py b/samples/storeMeta.py index 9098e53..e3a18a8 100644 --- a/samples/storeMeta.py +++ b/samples/storeMeta.py @@ -46,6 +46,9 @@ def init_options(): parser.add_option("-e", "--line_end", dest="line_end", default=None, help="Input file lines.") + parser.add_option("-n", "--domain", + dest="domain", default='svcs.ebay.com', + help="Specifies the eBay domain to use (e.g. svcs.sandbox.ebay.com).") (opts, args) = parser.parse_args() return opts, args @@ -129,7 +132,7 @@ def get_store_meta(store_name): try: api = finding(debug=opts.debug, appid=opts.appid, - config_file=opts.yaml) + config_file=opts.yaml, domain=opts.domain) response = api.execute('findItemsIneBayStores', { 'storeName': store_name, @@ -278,5 +281,4 @@ def analyze_items(items, category_id, agg_data): if __name__ == "__main__": print("Finding samples for SDK version %s" % ebaysdk.get_version()) (opts, args) = init_options() - run(opts) diff --git a/samples/trading.py b/samples/trading.py index 06e2b1b..a08d33b 100644 --- a/samples/trading.py +++ b/samples/trading.py @@ -39,6 +39,9 @@ def init_options(): parser.add_option("-c", "--certid", dest="certid", default=None, help="Specifies the eBay cert id to use.") + parser.add_option("-n", "--domain", + dest="domain", default='svcs.ebay.com', + help="Specifies the eBay domain to use (e.g. svcs.sandbox.ebay.com).") (opts, args) = parser.parse_args() return opts, args @@ -47,7 +50,7 @@ def init_options(): def run(opts): try: - api = Trading(debug=opts.debug, config_file=opts.yaml, appid=opts.appid, + api = Trading(debug=opts.debug, config_file=opts.yaml, appid=opts.appid, domain=opts.domain, certid=opts.certid, devid=opts.devid) api.execute('GetCharities', {'CharityID': 3897}) @@ -61,7 +64,7 @@ def run(opts): def feedback(opts): try: - api = Trading(debug=opts.debug, config_file=opts.yaml, appid=opts.appid, + api = Trading(debug=opts.debug, config_file=opts.yaml, appid=opts.appid, domain=opts.domain, certid=opts.certid, devid=opts.devid, warnings=False) api.execute('GetFeedback', {'UserID': 'tim0th3us'}) @@ -80,7 +83,7 @@ def feedback(opts): def getTokenStatus(opts): try: - api = Trading(debug=opts.debug, config_file=opts.yaml, appid=opts.appid, + api = Trading(debug=opts.debug, config_file=opts.yaml, appid=opts.appid, domain=opts.domain, certid=opts.certid, devid=opts.devid, warnings=False) api.execute('GetTokenStatus') @@ -96,7 +99,7 @@ def verifyAddItem(opts): """ try: - api = Trading(debug=opts.debug, config_file=opts.yaml, appid=opts.appid, + api = Trading(debug=opts.debug, config_file=opts.yaml, appid=opts.appid, domain=opts.domain, certid=opts.certid, devid=opts.devid, warnings=False) myitem = { @@ -167,7 +170,7 @@ def verifyAddItemErrorCodes(opts): """ try: - api = Trading(debug=opts.debug, config_file=opts.yaml, appid=opts.appid, + api = Trading(debug=opts.debug, config_file=opts.yaml, appid=opts.appid, domain=opts.domain, certid=opts.certid, devid=opts.devid, warnings=False) myitem = { @@ -244,7 +247,7 @@ def verifyAddItemErrorCodes(opts): def uploadPicture(opts): try: - api = Trading(debug=opts.debug, config_file=opts.yaml, appid=opts.appid, + api = Trading(debug=opts.debug, config_file=opts.yaml, appid=opts.appid, domain=opts.domain, certid=opts.certid, devid=opts.devid, warnings=True) pictureData = { @@ -264,7 +267,7 @@ def uploadPicture(opts): def uploadPictureFromFilesystem(opts, filepath): try: - api = Trading(debug=opts.debug, config_file=opts.yaml, appid=opts.appid, + api = Trading(debug=opts.debug, config_file=opts.yaml, appid=opts.appid, domain=opts.domain, certid=opts.certid, devid=opts.devid, warnings=True) # pass in an open file @@ -287,7 +290,7 @@ def uploadPictureFromFilesystem(opts, filepath): def memberMessages(opts): try: - api = Trading(debug=opts.debug, config_file=opts.yaml, appid=opts.appid, + api = Trading(debug=opts.debug, config_file=opts.yaml, appid=opts.appid, domain=opts.domain, certid=opts.certid, devid=opts.devid, warnings=True) now = datetime.datetime.now() @@ -325,7 +328,7 @@ def memberMessages(opts): def getUser(opts): try: - api = Trading(debug=opts.debug, config_file=opts.yaml, appid=opts.appid, + api = Trading(debug=opts.debug, config_file=opts.yaml, appid=opts.appid, domain=opts.domain, certid=opts.certid, devid=opts.devid, warnings=True, timeout=20, siteid='101') api.execute('GetUser', {'UserID': 'sallyma789'}) @@ -339,7 +342,7 @@ def getUser(opts): def getOrders(opts): try: - api = Trading(debug=opts.debug, config_file=opts.yaml, appid=opts.appid, + api = Trading(debug=opts.debug, config_file=opts.yaml, appid=opts.appid, domain=opts.domain, certid=opts.certid, devid=opts.devid, warnings=True, timeout=20) api.execute('GetOrders', {'NumberOfDays': 30}) @@ -353,7 +356,7 @@ def getOrders(opts): def categories(opts): try: - api = Trading(debug=opts.debug, config_file=opts.yaml, appid=opts.appid, + api = Trading(debug=opts.debug, config_file=opts.yaml, appid=opts.appid, domain=opts.domain, certid=opts.certid, devid=opts.devid, warnings=True, timeout=20, siteid='0') callData = { @@ -392,6 +395,6 @@ def categories(opts): uploadPictureFromFilesystem(opts, ("%s/test_image.jpg" % os.path.dirname(__file__))) memberMessages(opts) categories(opts) - + # getUser(opts) # getOrders(opts) From 16e1ee1b6ef4183070f3bc710df46586de7b4cb0 Mon Sep 17 00:00:00 2001 From: dunnousername <12957182+dunnousername@users.noreply.github.com> Date: Fri, 28 Jun 2019 18:52:45 -0400 Subject: [PATCH 23/34] Allow parallel support in python 3 I tested this by commenting those lines out in the site-packages, (on Anaconda on Windows). Everything seems to work fine; if you import parallel after importing other ebaysdk packages, though, you get a "monkey patch" warning message. Regardless of whether you import it before or after, basic things seem to work fine with Parallel on python 3; I haven't tested everything though. --- ebaysdk/parallel.py | 3 --- 1 file changed, 3 deletions(-) diff --git a/ebaysdk/parallel.py b/ebaysdk/parallel.py index bc311e5..fc940e5 100644 --- a/ebaysdk/parallel.py +++ b/ebaysdk/parallel.py @@ -12,9 +12,6 @@ import grequests # pylint: enable=import-error -if sys.version_info[0] >= 3: - raise ImportError('grequests does not work with python3+') - class Parallel(object): """ From 8895794326ea1f8777a1112899033cca7ca928f0 Mon Sep 17 00:00:00 2001 From: johnsliao Date: Mon, 5 Aug 2019 11:01:31 -0400 Subject: [PATCH 24/34] Set Finding API to use https by default --- ebaysdk/finding/__init__.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ebaysdk/finding/__init__.py b/ebaysdk/finding/__init__.py index 468930a..0909bd6 100644 --- a/ebaysdk/finding/__init__.py +++ b/ebaysdk/finding/__init__.py @@ -55,7 +55,7 @@ def __init__(self, **kwargs): appid -- eBay application id siteid -- eBay country site id (default: EBAY-US) version -- version number (default: 1.0.0) - https -- execute of https (default: False) + https -- execute of https (default: True) proxy_host -- proxy hostname proxy_port -- proxy port number timeout -- HTTP request timeout (default: 20) @@ -73,7 +73,7 @@ def __init__(self, **kwargs): # override yaml defaults with args sent to the constructor self.config.set('domain', kwargs.get('domain', 'svcs.ebay.com')) self.config.set('uri', '/services/search/FindingService/v1') - self.config.set('https', False) + self.config.set('https', True) self.config.set('warnings', True) self.config.set('errors', True) self.config.set('siteid', 'EBAY-US') From 8af8e841e8398870fea6f842c2f643385b5d8bdd Mon Sep 17 00:00:00 2001 From: Tim Keefer Date: Thu, 14 Nov 2019 13:50:20 -0800 Subject: [PATCH 25/34] update copyright --- .gitignore | 5 +++-- Changes | 6 ++++++ ebaysdk/__init__.py | 2 +- ebaysdk/config.py | 2 +- ebaysdk/connection.py | 2 +- ebaysdk/exception.py | 2 +- ebaysdk/finding/__init__.py | 2 +- ebaysdk/http/__init__.py | 2 +- ebaysdk/merchandising/__init__.py | 2 +- ebaysdk/parallel.py | 2 +- ebaysdk/policies/__init__.py | 2 +- ebaysdk/poller/__init__.py | 2 +- ebaysdk/poller/orders.py | 1 + ebaysdk/response.py | 2 +- ebaysdk/shopping/__init__.py | 2 +- ebaysdk/soa/__init__.py | 2 +- ebaysdk/soa/finditem.py | 2 +- ebaysdk/trading/__init__.py | 2 +- ebaysdk/utils.py | 2 +- samples/calls_with_unicode.py | 2 +- samples/common.py | 2 +- samples/finding.py | 2 +- samples/finditem.py | 2 +- samples/merchandising.py | 2 +- samples/parallel.py | 2 +- samples/parallel_gevent.py | 2 +- samples/policies.py | 2 +- samples/poller.py | 2 +- samples/request_dictionary.py | 6 ++++++ samples/shopping.py | 2 +- samples/storeMeta.py | 2 +- samples/t_http.py | 2 +- samples/test_perf.py | 2 +- samples/trading.py | 2 +- tests/test_base.py | 2 +- tests/test_errors.py | 2 +- tests/test_request.py | 2 +- 37 files changed, 49 insertions(+), 35 deletions(-) diff --git a/.gitignore b/.gitignore index 0a764d8..74036df 100644 --- a/.gitignore +++ b/.gitignore @@ -11,6 +11,7 @@ ebaysdk.egg-info/ \.DS_Store \.eggs \.tox -venv/ -venv* +.venv/ +.venv* \.virtualenvs + diff --git a/Changes b/Changes index 699ad0c..d436bd2 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,11 @@ Changes for ebaysdk +2.1.6 +- Update Copyright + +2.1.5 Oct 13, 2017 +- Bug fix release + 2.1.4 Tue Aug 23 11:21:37 PDT 2016 - Merge PR from listingmirror for site-id fix - Added a few performance tests diff --git a/ebaysdk/__init__.py b/ebaysdk/__init__.py index 79b6c1a..125b463 100644 --- a/ebaysdk/__init__.py +++ b/ebaysdk/__init__.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- ''' -© 2012-2013 eBay Software Foundation +Copyright 2012-2019 eBay Inc. Authored by: Tim Keefer Licensed under CDDL 1.0 ''' diff --git a/ebaysdk/config.py b/ebaysdk/config.py index ed857af..fb697ef 100644 --- a/ebaysdk/config.py +++ b/ebaysdk/config.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- ''' -© 2012-2013 eBay Software Foundation +Copyright 2012-2019 eBay Inc. Authored by: Tim Keefer Licensed under CDDL 1.0 ''' diff --git a/ebaysdk/connection.py b/ebaysdk/connection.py index 6a9d7b3..cec9b09 100644 --- a/ebaysdk/connection.py +++ b/ebaysdk/connection.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- ''' -© 2012-2013 eBay Software Foundation +Copyright 2012-2019 eBay Inc. Authored by: Tim Keefer Licensed under CDDL 1.0 ''' diff --git a/ebaysdk/exception.py b/ebaysdk/exception.py index 27355a3..572cf7c 100644 --- a/ebaysdk/exception.py +++ b/ebaysdk/exception.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- ''' -© 2012-2013 eBay Software Foundation +Copyright 2012-2019 eBay Inc. Authored by: Tim Keefer Licensed under CDDL 1.0 ''' diff --git a/ebaysdk/finding/__init__.py b/ebaysdk/finding/__init__.py index 0909bd6..756f438 100644 --- a/ebaysdk/finding/__init__.py +++ b/ebaysdk/finding/__init__.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- ''' -© 2012-2013 eBay Software Foundation +Copyright 2012-2019 eBay Inc. Authored by: Tim Keefer Licensed under CDDL 1.0 ''' diff --git a/ebaysdk/http/__init__.py b/ebaysdk/http/__init__.py index 8200757..f4c62b1 100644 --- a/ebaysdk/http/__init__.py +++ b/ebaysdk/http/__init__.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- ''' -© 2012-2013 eBay Software Foundation +Copyright 2012-2019 eBay Inc. Authored by: Tim Keefer Licensed under CDDL 1.0 ''' diff --git a/ebaysdk/merchandising/__init__.py b/ebaysdk/merchandising/__init__.py index 74fd60e..b84a039 100644 --- a/ebaysdk/merchandising/__init__.py +++ b/ebaysdk/merchandising/__init__.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- ''' -© 2012-2013 eBay Software Foundation +Copyright 2012-2019 eBay Inc. Authored by: Tim Keefer Licensed under CDDL 1.0 ''' diff --git a/ebaysdk/parallel.py b/ebaysdk/parallel.py index fc940e5..3dcabc2 100644 --- a/ebaysdk/parallel.py +++ b/ebaysdk/parallel.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- ''' -© 2012-2013 eBay Software Foundation +Copyright 2012-2019 eBay Inc. Authored by: Tim Keefer Licensed under CDDL 1.0 ''' diff --git a/ebaysdk/policies/__init__.py b/ebaysdk/policies/__init__.py index 51e1b4d..ebc4f4f 100644 --- a/ebaysdk/policies/__init__.py +++ b/ebaysdk/policies/__init__.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- ''' -© 2012-2013 eBay Software Foundation +Copyright 2012-2019 eBay Inc. Authored by: Tim Keefer Licensed under CDDL 1.0 ''' diff --git a/ebaysdk/poller/__init__.py b/ebaysdk/poller/__init__.py index 14afee3..0551d7a 100644 --- a/ebaysdk/poller/__init__.py +++ b/ebaysdk/poller/__init__.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ''' -© 2012-2015 eBay Software Foundation +Copyright 2012-2019 eBay Inc. Authored by: Tim Keefer Licensed under CDDL 1.0 ''' diff --git a/ebaysdk/poller/orders.py b/ebaysdk/poller/orders.py index afa663f..0241d4c 100644 --- a/ebaysdk/poller/orders.py +++ b/ebaysdk/poller/orders.py @@ -1,6 +1,7 @@ # -*- coding: utf-8 -*- ''' +Copyright 2012-2019 eBay Inc. Authored by: Tim Keefer Licensed under CDDL 1.0 ''' diff --git a/ebaysdk/response.py b/ebaysdk/response.py index 79afa2b..762762e 100644 --- a/ebaysdk/response.py +++ b/ebaysdk/response.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- ''' -© 2012-2013 eBay Software Foundation +Copyright 2012-2019 eBay Inc. Authored by: Tim Keefer Licensed under CDDL 1.0 ''' diff --git a/ebaysdk/shopping/__init__.py b/ebaysdk/shopping/__init__.py index a34b92e..56d8c5d 100644 --- a/ebaysdk/shopping/__init__.py +++ b/ebaysdk/shopping/__init__.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- ''' -© 2012-2013 eBay Software Foundation +Copyright 2012-2019 eBay Inc. Authored by: Tim Keefer Licensed under CDDL 1.0 ''' diff --git a/ebaysdk/soa/__init__.py b/ebaysdk/soa/__init__.py index 67f003b..9d05923 100644 --- a/ebaysdk/soa/__init__.py +++ b/ebaysdk/soa/__init__.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- ''' -© 2012-2013 eBay Software Foundation +Copyright 2012-2019 eBay Inc. Authored by: Tim Keefer Licensed under CDDL 1.0 ''' diff --git a/ebaysdk/soa/finditem.py b/ebaysdk/soa/finditem.py index d70e91e..dd533d6 100644 --- a/ebaysdk/soa/finditem.py +++ b/ebaysdk/soa/finditem.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- ''' -© 2012-2013 eBay Software Foundation +Copyright 2012-2019 eBay Inc. Authored by: Tim Keefer Licensed under CDDL 1.0 ''' diff --git a/ebaysdk/trading/__init__.py b/ebaysdk/trading/__init__.py index 1f00e1d..b1c5506 100644 --- a/ebaysdk/trading/__init__.py +++ b/ebaysdk/trading/__init__.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- ''' -© 2012-2013 eBay Software Foundation +Copyright 2012-2019 eBay Inc. Authored by: Tim Keefer Licensed under CDDL 1.0 ''' diff --git a/ebaysdk/utils.py b/ebaysdk/utils.py index fdc26c5..ff819e2 100644 --- a/ebaysdk/utils.py +++ b/ebaysdk/utils.py @@ -2,7 +2,7 @@ from __future__ import unicode_literals ''' -© 2012-2013 eBay Software Foundation +Copyright 2012-2019 eBay Inc. Authored by: Tim Keefer Licensed under CDDL 1.0 ''' diff --git a/samples/calls_with_unicode.py b/samples/calls_with_unicode.py index 26ea1a2..fd4191d 100644 --- a/samples/calls_with_unicode.py +++ b/samples/calls_with_unicode.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ''' -© 2012-2013 eBay Software Foundation +Copyright 2012-2019 eBay Inc. Authored by: Tim Keefer Licensed under CDDL 1.0 ''' diff --git a/samples/common.py b/samples/common.py index 67aa047..916b805 100644 --- a/samples/common.py +++ b/samples/common.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ''' -© 2012-2013 eBay Software Foundation +Copyright 2012-2019 eBay Inc. Authored by: Tim Keefer Licensed under CDDL 1.0 ''' diff --git a/samples/finding.py b/samples/finding.py index bb45bf5..00d8a0e 100644 --- a/samples/finding.py +++ b/samples/finding.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ''' -© 2012-2013 eBay Software Foundation +Copyright 2012-2019 eBay Inc. Authored by: Tim Keefer Licensed under CDDL 1.0 ''' diff --git a/samples/finditem.py b/samples/finditem.py index 492b01d..2d12c75 100644 --- a/samples/finditem.py +++ b/samples/finditem.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ''' -© 2012-2013 eBay Software Foundation +Copyright 2012-2019 eBay Inc. Authored by: Tim Keefer Licensed under CDDL 1.0 ''' diff --git a/samples/merchandising.py b/samples/merchandising.py index a6d090c..cc437b1 100644 --- a/samples/merchandising.py +++ b/samples/merchandising.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ''' -© 2012-2013 eBay Software Foundation +Copyright 2012-2019 eBay Inc. Authored by: Tim Keefer Licensed under CDDL 1.0 ''' diff --git a/samples/parallel.py b/samples/parallel.py index 45a55ca..f0ba5cd 100644 --- a/samples/parallel.py +++ b/samples/parallel.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ''' -© 2012-2013 eBay Software Foundation +Copyright 2012-2019 eBay Inc. Authored by: Tim Keefer Licensed under CDDL 1.0 ''' diff --git a/samples/parallel_gevent.py b/samples/parallel_gevent.py index 1a5b760..611fb9f 100644 --- a/samples/parallel_gevent.py +++ b/samples/parallel_gevent.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ''' -© 2012-2013 eBay Software Foundation +Copyright 2012-2019 eBay Inc. Authored by: Tim Keefer Licensed under CDDL 1.0 ''' diff --git a/samples/policies.py b/samples/policies.py index 696a0c6..526459d 100644 --- a/samples/policies.py +++ b/samples/policies.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ''' -© 2012-2013 eBay Software Foundation +Copyright 2012-2019 eBay Inc. Authored by: Tim Keefer Licensed under CDDL 1.0 ''' diff --git a/samples/poller.py b/samples/poller.py index 87e995f..0364c9c 100644 --- a/samples/poller.py +++ b/samples/poller.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ''' -© 2012-2013 eBay Software Foundation +Copyright 2012-2019 eBay Inc. Authored by: Tim Keefer Licensed under CDDL 1.0 ''' diff --git a/samples/request_dictionary.py b/samples/request_dictionary.py index 75a0133..3c6f740 100644 --- a/samples/request_dictionary.py +++ b/samples/request_dictionary.py @@ -1,3 +1,9 @@ +# -*- coding: utf-8 -*- +''' +Copyright 2012-2019 eBay Inc. +Authored by: Tim Keefer +Licensed under CDDL 1.0 +''' import os import sys diff --git a/samples/shopping.py b/samples/shopping.py index 703409b..687ded9 100644 --- a/samples/shopping.py +++ b/samples/shopping.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ''' -© 2012-2013 eBay Software Foundation +Copyright 2012-2019 eBay Inc. Authored by: Tim Keefer Licensed under CDDL 1.0 ''' diff --git a/samples/storeMeta.py b/samples/storeMeta.py index 9098e53..676850f 100644 --- a/samples/storeMeta.py +++ b/samples/storeMeta.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ''' -© 2012-2013 eBay Software Foundation +Copyright 2012-2019 eBay Inc. Authored by: Tim Keefer Licensed under CDDL 1.0 ''' diff --git a/samples/t_http.py b/samples/t_http.py index 40433bb..229423f 100644 --- a/samples/t_http.py +++ b/samples/t_http.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ''' -© 2012-2013 eBay Software Foundation +Copyright 2012-2019 eBay Inc. Authored by: Tim Keefer Licensed under CDDL 1.0 ''' diff --git a/samples/test_perf.py b/samples/test_perf.py index 66cea2d..3e7feed 100644 --- a/samples/test_perf.py +++ b/samples/test_perf.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- ''' -© 2012-2013 eBay Software Foundation +Copyright 2012-2019 eBay Inc. Authored by: Tim Keefer Licensed under CDDL 1.0 ''' diff --git a/samples/trading.py b/samples/trading.py index 06e2b1b..7e50faf 100644 --- a/samples/trading.py +++ b/samples/trading.py @@ -1,6 +1,6 @@ # -*- coding: utf-8 -*- ''' -© 2012-2013 eBay Software Foundation +Copyright 2012-2019 eBay Inc. Authored by: Tim Keefer Licensed under CDDL 1.0 ''' diff --git a/tests/test_base.py b/tests/test_base.py index c27431d..389d9ea 100644 --- a/tests/test_base.py +++ b/tests/test_base.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- ''' -© 2012-2013 eBay Software Foundation +Copyright 2012-2019 eBay Inc. Authored by: Tim Keefer Licensed under CDDL 1.0 ''' diff --git a/tests/test_errors.py b/tests/test_errors.py index 2d4a8ae..4f5dfbf 100644 --- a/tests/test_errors.py +++ b/tests/test_errors.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- ''' -© 2012-2013 eBay Software Foundation +Copyright 2012-2019 eBay Inc. Authored by: Tim Keefer Licensed under CDDL 1.0 ''' diff --git a/tests/test_request.py b/tests/test_request.py index 1f60954..aba794c 100644 --- a/tests/test_request.py +++ b/tests/test_request.py @@ -1,7 +1,7 @@ # -*- coding: utf-8 -*- ''' -© 2012-2013 eBay Software Foundation +Copyright 2012-2019 eBay Inc. Authored by: Tim Keefer Licensed under CDDL 1.0 ''' From f119a6faad502341772d52765e8e88706be9f690 Mon Sep 17 00:00:00 2001 From: Tim Keefer Date: Mon, 18 Nov 2019 14:00:47 -0800 Subject: [PATCH 26/34] test commit w/ GPG --- README.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index 4557a87..fbd93d3 100644 --- a/README.rst +++ b/README.rst @@ -26,8 +26,8 @@ Quick Example:: print(e.response.dict()) -Migrating from v1 to v2 ------------------------ +Migrating from v1 to v2 +------------------------- For a complete guide on migrating from ebaysdk v1 to v2 and see an overview of the additional features in v2 please read the `v1 to v2 guide`_ From 4ff94cb7859da4d538d56687ce02642a41d80b28 Mon Sep 17 00:00:00 2001 From: Tim Keefer Date: Mon, 18 Nov 2019 15:57:07 -0800 Subject: [PATCH 27/34] test GPG commit --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index fbd93d3..6056a81 100644 --- a/README.rst +++ b/README.rst @@ -27,7 +27,7 @@ Quick Example:: Migrating from v1 to v2 -------------------------- +----------------==--------- For a complete guide on migrating from ebaysdk v1 to v2 and see an overview of the additional features in v2 please read the `v1 to v2 guide`_ From b6511d04b889956d368342a0a97f8b0fdb8c8198 Mon Sep 17 00:00:00 2001 From: Tim Keefer Date: Mon, 18 Nov 2019 16:05:53 -0800 Subject: [PATCH 28/34] test GPG commit - without signing --- README.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.rst b/README.rst index 6056a81..4557a87 100644 --- a/README.rst +++ b/README.rst @@ -26,8 +26,8 @@ Quick Example:: print(e.response.dict()) -Migrating from v1 to v2 -----------------==--------- +Migrating from v1 to v2 +----------------------- For a complete guide on migrating from ebaysdk v1 to v2 and see an overview of the additional features in v2 please read the `v1 to v2 guide`_ From c25e5cb3dbd4e21a6a898499bce5f46c3a02be98 Mon Sep 17 00:00:00 2001 From: Tim Keefer Date: Mon, 18 Nov 2019 16:12:48 -0800 Subject: [PATCH 29/34] test commit with signing --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 4557a87..5363390 100644 --- a/README.rst +++ b/README.rst @@ -27,7 +27,7 @@ Quick Example:: Migrating from v1 to v2 ------------------------ +-------------=---------- For a complete guide on migrating from ebaysdk v1 to v2 and see an overview of the additional features in v2 please read the `v1 to v2 guide`_ From 1dd9af4b9c0e515e24d823fc691a4962390384bc Mon Sep 17 00:00:00 2001 From: Tim Keefer Date: Mon, 18 Nov 2019 16:17:10 -0800 Subject: [PATCH 30/34] test GPG commit --- README.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.rst b/README.rst index 5363390..4557a87 100644 --- a/README.rst +++ b/README.rst @@ -27,7 +27,7 @@ Quick Example:: Migrating from v1 to v2 --------------=---------- +----------------------- For a complete guide on migrating from ebaysdk v1 to v2 and see an overview of the additional features in v2 please read the `v1 to v2 guide`_ From ae7d2d323c28e0f04d6b0ae8e54769bd895f35cb Mon Sep 17 00:00:00 2001 From: Tim Keefer Date: Thu, 5 Dec 2019 14:37:50 -0800 Subject: [PATCH 31/34] fix tox and import issue --- ebaysdk/parallel.py | 7 +++---- tox.ini | 2 +- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/ebaysdk/parallel.py b/ebaysdk/parallel.py index 45ff195..0320c97 100644 --- a/ebaysdk/parallel.py +++ b/ebaysdk/parallel.py @@ -5,13 +5,12 @@ Authored by: Tim Keefer Licensed under CDDL 1.0 ''' -import sys -from ebaysdk.exception import ConnectionError +from ebaysdk.exception import ConnectionError -if sys.version_info[0] >= 3: - raise ImportError('grequests does not work with python3+') +# pylint: disable=import-error import grequests +# pylint: enable=import-error class Parallel(object): diff --git a/tox.ini b/tox.ini index 406235c..fad7a86 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py27,py36 +envlist = py27,py37 [testenv] setenv = From b8e9fb59abf992de44e0fd510ec60e3c699652c9 Mon Sep 17 00:00:00 2001 From: Tim Keefer Date: Fri, 6 Dec 2019 09:47:32 -0800 Subject: [PATCH 32/34] test commit with signing --- README.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/README.rst b/README.rst index 4557a87..7ef7931 100644 --- a/README.rst +++ b/README.rst @@ -29,6 +29,8 @@ Quick Example:: Migrating from v1 to v2 ----------------------- +Test for GPG + For a complete guide on migrating from ebaysdk v1 to v2 and see an overview of the additional features in v2 please read the `v1 to v2 guide`_ From ab739ac0469790386bf657fc885ea5e16f31eb09 Mon Sep 17 00:00:00 2001 From: Tim Keefer Date: Fri, 6 Dec 2019 09:51:21 -0800 Subject: [PATCH 33/34] revert GPG test commit --- README.rst | 2 -- 1 file changed, 2 deletions(-) diff --git a/README.rst b/README.rst index 7ef7931..4557a87 100644 --- a/README.rst +++ b/README.rst @@ -29,8 +29,6 @@ Quick Example:: Migrating from v1 to v2 ----------------------- -Test for GPG - For a complete guide on migrating from ebaysdk v1 to v2 and see an overview of the additional features in v2 please read the `v1 to v2 guide`_ From 36fe7b4d38ed6b1391ec611a347ba483ed215ff3 Mon Sep 17 00:00:00 2001 From: Foster Hoff Date: Sun, 5 Apr 2020 11:29:33 -0700 Subject: [PATCH 34/34] docstrings: update warnings / errors docstring defaults --- ebaysdk/finding/__init__.py | 3 ++- ebaysdk/inventorymanagement/__init__.py | 3 ++- ebaysdk/merchandising/__init__.py | 3 ++- ebaysdk/policies/__init__.py | 3 ++- ebaysdk/trading/__init__.py | 3 ++- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/ebaysdk/finding/__init__.py b/ebaysdk/finding/__init__.py index 756f438..0a7830c 100644 --- a/ebaysdk/finding/__init__.py +++ b/ebaysdk/finding/__init__.py @@ -50,7 +50,8 @@ def __init__(self, **kwargs): domain -- API endpoint (default: svcs.ebay.com) config_file -- YAML defaults (default: ebay.yaml) debug -- debugging enabled (default: False) - warnings -- warnings enabled (default: False) + warnings -- warnings enabled (default: True) + errors -- errors enabled (default: True) uri -- API endpoint uri (default: /services/search/FindingService/v1) appid -- eBay application id siteid -- eBay country site id (default: EBAY-US) diff --git a/ebaysdk/inventorymanagement/__init__.py b/ebaysdk/inventorymanagement/__init__.py index c9ee40a..9ae0cc3 100644 --- a/ebaysdk/inventorymanagement/__init__.py +++ b/ebaysdk/inventorymanagement/__init__.py @@ -128,7 +128,8 @@ def __init__(self, **kwargs): domain -- API endpoint (default: api.ebay.com) config_file -- YAML defaults (default: ebay.yaml) debug -- debugging enabled (default: False) - warnings -- warnings enabled (default: False) + warnings -- warnings enabled (default: True) + errors -- errors enabled (default: True) uri -- API endpoint uri (default: /selling/inventory/v1) token -- eBay application/user token version -- version number (default: 1.0.0) diff --git a/ebaysdk/merchandising/__init__.py b/ebaysdk/merchandising/__init__.py index b84a039..501bc5e 100644 --- a/ebaysdk/merchandising/__init__.py +++ b/ebaysdk/merchandising/__init__.py @@ -40,7 +40,8 @@ def __init__(self, **kwargs): domain -- API endpoint (default: open.api.ebay.com) config_file -- YAML defaults (default: ebay.yaml) debug -- debugging enabled (default: False) - warnings -- warnings enabled (default: False) + warnings -- warnings enabled (default: True) + errors -- errors enabled (default: True) uri -- API endpoint uri (default: /MerchandisingService) appid -- eBay application id siteid -- eBay country site id (default: 0 (US)) diff --git a/ebaysdk/policies/__init__.py b/ebaysdk/policies/__init__.py index ebc4f4f..66f1b2c 100644 --- a/ebaysdk/policies/__init__.py +++ b/ebaysdk/policies/__init__.py @@ -32,7 +32,8 @@ def __init__(self, **kwargs): domain -- API endpoint (default: svcs.ebay.com) config_file -- YAML defaults (default: ebay.yaml) debug -- debugging enabled (default: False) - warnings -- warnings enabled (default: False) + warnings -- warnings enabled (default: True) + errors -- errors enabled (default: True) uri -- API endpoint uri (default: /services/selling/v1/SellerProfilesManagementService) appid -- eBay application id siteid -- eBay country site id (default: EBAY-US) diff --git a/ebaysdk/trading/__init__.py b/ebaysdk/trading/__init__.py index b1c5506..94eb5a0 100644 --- a/ebaysdk/trading/__init__.py +++ b/ebaysdk/trading/__init__.py @@ -60,7 +60,8 @@ def __init__(self, **kwargs): domain -- API endpoint (default: api.ebay.com) config_file -- YAML defaults (default: ebay.yaml) debug -- debugging enabled (default: False) - warnings -- warnings enabled (default: False) + warnings -- warnings enabled (default: True) + errors -- errors enabled (default: True) uri -- API endpoint uri (default: /ws/api.dll) appid -- eBay application id devid -- eBay developer id