From ba6e0247b48cb0eed065c7c427bf015e160c84ad Mon Sep 17 00:00:00 2001 From: codeastar Date: Thu, 27 Jul 2017 14:44:55 +0800 Subject: [PATCH 01/28] 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 cb1c54703744e4a18fb7b20d8a7043f188f43b1a Mon Sep 17 00:00:00 2001 From: codeastar Date: Thu, 27 Jul 2017 14:51:30 +0800 Subject: [PATCH 02/28] 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 36bc59596f9b9ff4390d74e9889e13fce872492e Mon Sep 17 00:00:00 2001 From: Tim Keefer Date: Wed, 5 Sep 2018 13:54:34 -0700 Subject: [PATCH 03/28] 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 181707076df10a4a5100d75659e87ac30aa9e04d Mon Sep 17 00:00:00 2001 From: Tim Keefer Date: Wed, 5 Sep 2018 13:55:46 -0700 Subject: [PATCH 04/28] 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 d8f5ef7b91765f747d4b346a2b87d1197a13727d Mon Sep 17 00:00:00 2001 From: Tim Keefer Date: Tue, 11 Sep 2018 14:56:25 -0700 Subject: [PATCH 05/28] 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 308e0911956747097e8bc915df952988e6a8f1b2 Mon Sep 17 00:00:00 2001 From: egdoc Date: Thu, 20 Dec 2018 16:15:55 +0100 Subject: [PATCH 06/28] 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 3fef3e0b10b5e6b579edbba7442d6f2d123cea5a Mon Sep 17 00:00:00 2001 From: Kevin Zhang Date: Wed, 12 Jun 2019 15:20:22 +1200 Subject: [PATCH 07/28] 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 91ebddf830a56c91fab75732e535e13396355d2d 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 08/28] 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 d2e478d457e32296cd329d23e4803a6d80274ddc Mon Sep 17 00:00:00 2001 From: johnsliao Date: Mon, 5 Aug 2019 11:01:31 -0400 Subject: [PATCH 09/28] 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 a1250683987598fe1e98ca81b3a5bc6628d5bc1e Mon Sep 17 00:00:00 2001 From: Tim Keefer Date: Thu, 14 Nov 2019 13:50:20 -0800 Subject: [PATCH 10/28] 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_request.py | 2 +- 36 files changed, 48 insertions(+), 34 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_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 4189d22b441ff13f8a645ea9f0a1b01de7af5913 Mon Sep 17 00:00:00 2001 From: Tim Keefer Date: Mon, 18 Nov 2019 14:00:47 -0800 Subject: [PATCH 11/28] 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 09967e1a07937ab3951e517101ec80e261568bc7 Mon Sep 17 00:00:00 2001 From: Tim Keefer Date: Mon, 18 Nov 2019 15:57:07 -0800 Subject: [PATCH 12/28] 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 0b3ad5823738167eb26de8c1abbf2bf958d01fc6 Mon Sep 17 00:00:00 2001 From: Tim Keefer Date: Mon, 18 Nov 2019 16:05:53 -0800 Subject: [PATCH 13/28] 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 0a4536161bb45712bb6d174f0a7585d672917093 Mon Sep 17 00:00:00 2001 From: Tim Keefer Date: Mon, 18 Nov 2019 16:12:48 -0800 Subject: [PATCH 14/28] 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 c6aaa34c06bf179ce96e671c20da77899a98f16f Mon Sep 17 00:00:00 2001 From: Tim Keefer Date: Mon, 18 Nov 2019 16:17:10 -0800 Subject: [PATCH 15/28] 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 e2f3b06bb24f40c90e8d633d05c1aba33e7f02ed Mon Sep 17 00:00:00 2001 From: Tim Keefer Date: Thu, 5 Dec 2019 14:37:50 -0800 Subject: [PATCH 16/28] 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 c43041c819d12c77eaf43cbca1a9f8f5e4ab338a Mon Sep 17 00:00:00 2001 From: Tim Keefer Date: Fri, 6 Dec 2019 09:47:32 -0800 Subject: [PATCH 17/28] 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 baaae90e1b375a67c661522d62373792ec77f087 Mon Sep 17 00:00:00 2001 From: Tim Keefer Date: Fri, 6 Dec 2019 09:51:21 -0800 Subject: [PATCH 18/28] 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 a713f284f0be3608ed49535db37bf939f1bbe4f4 Mon Sep 17 00:00:00 2001 From: Tim Keefer Date: Fri, 17 Apr 2020 07:34:56 -0700 Subject: [PATCH 19/28] force https for finding api calls --- 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 756f438..be0ad98 100644 --- a/ebaysdk/finding/__init__.py +++ b/ebaysdk/finding/__init__.py @@ -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', True) + self.config.set('https', True, force=True) self.config.set('warnings', True) self.config.set('errors', True) self.config.set('siteid', 'EBAY-US') From 988704ca6755dd37927b265a8c1fbb3892f8fdb6 Mon Sep 17 00:00:00 2001 From: Tim Keefer Date: Mon, 20 Apr 2020 15:39:40 -0700 Subject: [PATCH 20/28] Bulk commit to force https and for fixes to the code samples. see Changes file more details --- Changes | 5 +++ ebay.yaml | 2 - ebaysdk/__init__.py | 2 +- ebaysdk/connection.py | 2 +- ebaysdk/response.py | 3 ++ ebaysdk/shopping/__init__.py | 6 +-- ebaysdk/trading/__init__.py | 2 +- samples/common.py | 15 ++++++- samples/shopping.py | 87 ++++++++++-------------------------- samples/trading.py | 4 +- tox.ini | 2 +- 11 files changed, 53 insertions(+), 77 deletions(-) diff --git a/Changes b/Changes index d436bd2..0517a87 100644 --- a/Changes +++ b/Changes @@ -1,5 +1,10 @@ Changes for ebaysdk +2.2.0 Mon Apr 20 15:23:53 PDT 2020 +- Forced HTTPS for finding, shopping, and trading calls +- fixed sample code so that it uses the appropriate domain +- added py38 to tox testing + 2.1.6 - Update Copyright diff --git a/ebay.yaml b/ebay.yaml index fc170b6..2ab6ed3 100644 --- a/ebay.yaml +++ b/ebay.yaml @@ -19,9 +19,7 @@ api.ebay.com: # 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 diff --git a/ebaysdk/__init__.py b/ebaysdk/__init__.py index 125b463..5630928 100644 --- a/ebaysdk/__init__.py +++ b/ebaysdk/__init__.py @@ -9,7 +9,7 @@ import platform import logging -__version__ = '2.1.5' +__version__ = '2.2.0' Version = __version__ # for backward compatibility try: diff --git a/ebaysdk/connection.py b/ebaysdk/connection.py index cec9b09..da713cc 100644 --- a/ebaysdk/connection.py +++ b/ebaysdk/connection.py @@ -169,7 +169,7 @@ def build_request_data(self, verb, data, verb_attrs): def build_request_url(self, verb): url = "%s://%s%s" % ( - HTTP_SSL[self.config.get('https', False)], + HTTP_SSL[self.config.get('https', True)], self.config.get('domain'), self.config.get('uri') ) diff --git a/ebaysdk/response.py b/ebaysdk/response.py index 762762e..fca9a0d 100644 --- a/ebaysdk/response.py +++ b/ebaysdk/response.py @@ -161,7 +161,10 @@ def __init__(self, obj, verb=None, list_nodes=[], datetime_nodes=[], parse_respo datetime_nodes=copy.copy(datetime_nodes)) except XMLSyntaxError as e: log.debug('response parse failed: %s' % e) + self._dom = self._parse_xml("<%sResponse>parse error " % (verb, e, verb)) + self._dict = self._etree_to_dict(self._dom) self.reply = ResponseDataObject({}, []) + else: self.reply = ResponseDataObject({}, []) diff --git a/ebaysdk/shopping/__init__.py b/ebaysdk/shopping/__init__.py index 56d8c5d..a53c9cf 100644 --- a/ebaysdk/shopping/__init__.py +++ b/ebaysdk/shopping/__init__.py @@ -72,7 +72,7 @@ def __init__(self, **kwargs): self.config.set('uri', '/shopping') self.config.set('warnings', True) self.config.set('errors', True) - self.config.set('https', False) + self.config.set('https', True, force=True) self.config.set('siteid', '0') self.config.set('response_encoding', 'XML') self.config.set('request_encoding', 'XML') @@ -85,15 +85,13 @@ def __init__(self, **kwargs): self.config.set( 'doc_url', 'http://developer.ebay.com/DevZone/Shopping/docs/CallRef/index.html') - if self.config.get('https') and self.debug: - print("HTTPS is not supported on the Shopping API.") - self.datetime_nodes = ['timestamp', 'registrationdate', 'creationtime', 'commenttime', 'updatetime', 'estimateddeliverymintime', 'estimateddeliverymaxtime', 'creationtime', 'estimateddeliverymintime', 'estimateddeliverymaxtime', 'endtime', 'starttime'] self.base_list_nodes = [ + 'getcategoryinforesponse.categoryarray.category', 'findhalfproductsresponse.halfcatalogproduct.productid', 'findhalfproductsresponse.halfproducts.product', 'getshippingcostsresponse.internationalshippingserviceoption.shipsto', diff --git a/ebaysdk/trading/__init__.py b/ebaysdk/trading/__init__.py index b1c5506..e199851 100644 --- a/ebaysdk/trading/__init__.py +++ b/ebaysdk/trading/__init__.py @@ -87,7 +87,7 @@ def __init__(self, **kwargs): self.config.set('uri', '/ws/api.dll') self.config.set('warnings', True) self.config.set('errors', True) - self.config.set('https', True) + self.config.set('https', True, force=True) self.config.set('siteid', '0') self.config.set('response_encoding', 'XML') self.config.set('request_encoding', 'XML') diff --git a/samples/common.py b/samples/common.py index 916b805..6271b3a 100644 --- a/samples/common.py +++ b/samples/common.py @@ -5,6 +5,19 @@ Licensed under CDDL 1.0 ''' +from ebaysdk.finding import Connection as finding + +def get_one_item(opts): + api = finding(debug=opts.debug, appid=opts.appid, + config_file=opts.yaml, warnings=True) + + api_request = { + 'keywords': u'GRAMMY Foundation®', + } + + response = api.execute('findItemsAdvanced', api_request) + return response.reply.searchResult.item[0].itemId + def dump(api, full=False): @@ -17,7 +30,7 @@ def dump(api, full=False): print("Call Success: %s in length" % len(api.response.content)) print("Response code: %s" % api.response_code()) - print("Response DOM1: %s" % api.response_dom()) # deprecated + print("Response DOM1: %s" % api.response.dom()) # deprecated print("Response ETREE: %s" % api.response.dom()) if full: diff --git a/samples/shopping.py b/samples/shopping.py index 555c46d..34ff558 100644 --- a/samples/shopping.py +++ b/samples/shopping.py @@ -16,7 +16,7 @@ sys.path.insert(0, '%s/../' % os.path.dirname(__file__)) -from common import dump +from common import dump, get_one_item import ebaysdk from ebaysdk.exception import ConnectionError @@ -37,8 +37,8 @@ def init_options(): 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).") + dest="domain", default='open.api.ebay.com', + help="Specifies the eBay domain to use (e.g. open.api.ebay.com).") (opts, args) = parser.parse_args() return opts, args @@ -51,13 +51,12 @@ def run(opts): print("Shopping samples for SDK version %s" % ebaysdk.get_version()) try: - response = api.execute('FindPopularItems', {'QueryKeywords': 'Python'}) + ItemID = get_one_item(opts) - dump(api) + response = api.execute('GetSingleItem', {'ItemID': ItemID}) + print("EndTime: %s" % response.reply.Item.EndTime) - print("Matching Titles:") - for item in response.reply.ItemArray.Item: - print(item.Title) + dump(api) except ConnectionError as e: print(e) @@ -69,45 +68,22 @@ def popularSearches(opts): api = Shopping(debug=opts.debug, appid=opts.appid, config_file=opts.yaml, domain=opts.domain, warnings=True) - choice = True - - while choice: - - choice = input('Search: ') - - if choice == 'quit': - break - - mySearch = { - "MaxKeywords": 10, - "QueryKeywords": choice, - } - - try: - response = api.execute('FindPopularSearches', mySearch) + mySearch = { + "MaxKeywords": 10, + "QueryKeywords": 'shirt', + } - dump(api, full=False) - - print("Related: %s" % - response.reply.PopularSearchResult.RelatedSearches) - - for term in response.reply.PopularSearchResult.AlternativeSearches.split(';')[:3]: - api.execute('FindPopularItems', { - 'QueryKeywords': term, 'MaxEntries': 3}) + try: + response = api.execute('FindPopularSearches', mySearch) - print("Term: %s" % term) - try: - for item in response.reply.ItemArray.Item: - print(item.Title) - except AttributeError: - pass + dump(api, full=False) - dump(api) - print("\n") + print("Related: %s" % + response.reply.PopularSearchResult.RelatedSearches) - except ConnectionError as e: - print(e) - print(e.response.dict()) + except ConnectionError as e: + print(e) + print(e.response.dict()) def categoryInfo(opts): @@ -116,28 +92,12 @@ def categoryInfo(opts): api = Shopping(debug=opts.debug, appid=opts.appid, config_file=opts.yaml, domain=opts.domain, warnings=True) - response = api.execute('GetCategoryInfo', {"CategoryID": 3410}) - - dump(api, full=False) - - except ConnectionError as e: - print(e) - print(e.response.dict()) - - -def with_affiliate_info(opts): - try: - api = Shopping(debug=opts.debug, appid=opts.appid, - config_file=opts.yaml, warnings=True, - trackingid=1234, trackingpartnercode=9) + response = api.execute('GetCategoryInfo', {"CategoryID": 11450}) - mySearch = { - "MaxKeywords": 10, - "QueryKeywords": 'shirt', - } + print("Category Name: %s" % + response.reply.CategoryArray.Category[0].CategoryName) - response = api.execute('FindPopularSearches', mySearch) - dump(api, full=False) + dump(api) except ConnectionError as e: print(e) @@ -165,5 +125,4 @@ def using_attributes(opts): run(opts) popularSearches(opts) categoryInfo(opts) - with_affiliate_info(opts) using_attributes(opts) diff --git a/samples/trading.py b/samples/trading.py index 658eadd..e0d724e 100644 --- a/samples/trading.py +++ b/samples/trading.py @@ -40,8 +40,8 @@ def init_options(): 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).") + dest="domain", default='api.ebay.com', + help="Specifies the eBay domain to use (e.g. api.sandbox.ebay.com).") (opts, args) = parser.parse_args() return opts, args diff --git a/tox.ini b/tox.ini index fad7a86..f15fd35 100644 --- a/tox.ini +++ b/tox.ini @@ -1,5 +1,5 @@ [tox] -envlist = py27,py37 +envlist = py27,py37,py38 [testenv] setenv = From 0633485bc5c50d10f194b5152d7ed509a253a71e Mon Sep 17 00:00:00 2001 From: Osuolale Marvellous <31046066+mahveotm@users.noreply.github.com> Date: Fri, 8 May 2020 03:18:37 +0100 Subject: [PATCH 21/28] Update INSTALL Updated the Mac, Linux & Unix section. Easy install no longer work, Pip should do. --- INSTALL | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/INSTALL b/INSTALL index 48975dd..2e4a930 100644 --- a/INSTALL +++ b/INSTALL @@ -11,9 +11,10 @@ Installing ebaysdk on Mac, Linux, Unix: Ubuntu: sudo apt-get install python-lxml -2) Install the SDK with easy_install +2) Install the SDK with pip - sudo easy_install ebaysdk + python3 -m pip install ebaysdk + Or install the latest version from github, From 0de27938684cace3a2aef7bf60fbb389b6a4ae99 Mon Sep 17 00:00:00 2001 From: Wesley Bowman Date: Wed, 3 Jun 2020 08:35:12 +0200 Subject: [PATCH 22/28] Remove samples and tests from package When installing the package, `tests` and `samples` were being put into my `site-packages`. This fixes that for me. --- setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setup.py b/setup.py index fc03578..473ac0d 100644 --- a/setup.py +++ b/setup.py @@ -42,7 +42,7 @@ def requirements_file_to_list(fn="requirements.txt"): author_email="tkeefer@gmail.com", url="https://github.com/timotheus/ebaysdk-python", license="COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0", - packages=find_packages(), + packages=find_packages(include=['ebaysdk', 'ebaysdk.*'), provides=[PKG], install_requires=['lxml', 'requests'], #requirements_file_to_list(), test_suite='tests', From 5dced67e5ce1285542f6f996c7650327a030fd27 Mon Sep 17 00:00:00 2001 From: Wesley Bowman Date: Thu, 4 Jun 2020 09:08:34 +0200 Subject: [PATCH 23/28] Fix syntax error in setup.py Also removed some unused code. --- setup.py | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/setup.py b/setup.py index 473ac0d..71b8630 100644 --- a/setup.py +++ b/setup.py @@ -27,13 +27,6 @@ calls, response processing, error handling, debugging across the Finding, Shopping, Merchandising, & Trading APIs. """ -def requirements_file_to_list(fn="requirements.txt"): - """read a requirements file and create a list that can be used in setup. - """ - - with open(fn, 'r') as f: - return [x.rstrip() for x in list(f) if x and not x.startswith('#')] - setup( name=PKG, version=version, @@ -42,9 +35,9 @@ def requirements_file_to_list(fn="requirements.txt"): author_email="tkeefer@gmail.com", url="https://github.com/timotheus/ebaysdk-python", license="COMMON DEVELOPMENT AND DISTRIBUTION LICENSE (CDDL) Version 1.0", - packages=find_packages(include=['ebaysdk', 'ebaysdk.*'), + packages=find_packages(include=['ebaysdk', 'ebaysdk.*']), provides=[PKG], - install_requires=['lxml', 'requests'], #requirements_file_to_list(), + install_requires=['lxml', 'requests'], test_suite='tests', long_description=long_desc, classifiers=[ From a26b33dc32979c628d609ecfd149cd4a7b3735a1 Mon Sep 17 00:00:00 2001 From: Wesley Bowman Date: Thu, 4 Jun 2020 09:09:02 +0200 Subject: [PATCH 24/28] Remove requirements.txt since it is no longer used --- requirements.txt | 2 -- 1 file changed, 2 deletions(-) delete mode 100644 requirements.txt diff --git a/requirements.txt b/requirements.txt deleted file mode 100644 index a3596c0..0000000 --- a/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -lxml -requests From ef785379ecff9eb9ca833fd509cdfe132ccd5d5a Mon Sep 17 00:00:00 2001 From: Tim Keefer Date: Thu, 13 May 2021 14:37:02 -0700 Subject: [PATCH 25/28] Update test_errors.py From 7b24a4ae07933d070bef8bb9da5b17881ec1068a Mon Sep 17 00:00:00 2001 From: Tim Keefer Date: Thu, 13 May 2021 14:49:43 -0700 Subject: [PATCH 26/28] Update test_errors.py --- tests/test_errors.py | 72 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 72 insertions(+) create mode 100644 tests/test_errors.py diff --git a/tests/test_errors.py b/tests/test_errors.py new file mode 100644 index 0000000..22e257a --- /dev/null +++ b/tests/test_errors.py @@ -0,0 +1,72 @@ +# -*- coding: utf-8 -*- + +''' +Copyright 2012-2019 eBay Inc. +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 DISABLE_test_single_item(self): + connection = ebaysdk.shopping.Connection(version='799', config_file=os.environ.get('EBAY_YAML')) + + 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': 'asdf'} +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': 'asdf'} +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 bcff8293d04e6c100b256eeb360f98d515062980 Mon Sep 17 00:00:00 2001 From: jhug146 Date: Sun, 13 Jun 2021 10:47:58 +0100 Subject: [PATCH 27/28] Changed all the deprecated log.warn() calls into the new log.warning() --- ebaysdk/connection.py | 10 +++++----- ebaysdk/finding/__init__.py | 2 +- ebaysdk/inventorymanagement/__init__.py | 2 +- ebaysdk/policies/__init__.py | 2 +- ebaysdk/shopping/__init__.py | 2 +- ebaysdk/soa/__init__.py | 2 +- ebaysdk/trading/__init__.py | 2 +- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/ebaysdk/connection.py b/ebaysdk/connection.py index da713cc..a29a644 100644 --- a/ebaysdk/connection.py +++ b/ebaysdk/connection.py @@ -246,7 +246,7 @@ def response_soup(self): from bs4 import BeautifulStoneSoup except ImportError: from BeautifulSoup import BeautifulStoneSoup - log.warn( + log.warning( 'DeprecationWarning: BeautifulSoup 3 or earlier is deprecated; install bs4 instead\n') self._response_soup = BeautifulStoneSoup( @@ -256,14 +256,14 @@ def response_soup(self): return self._response_soup def response_obj(self): - log.warn('response_obj() DEPRECATED, use response.reply instead') + log.warning('response_obj() DEPRECATED, use response.reply instead') return self.response.reply def response_dom(self): """ Deprecated: use self.response.dom() instead Returns the response DOM (xml.dom.minidom). """ - log.warn('response_dom() DEPRECATED, use response.dom instead') + log.warning('response_dom() DEPRECATED, use response.dom instead') if not self._response_dom: dom = None @@ -291,14 +291,14 @@ def response_dom(self): def response_dict(self): "Returns the response dictionary." - log.warn( + log.warning( 'response_dict() DEPRECATED, use response.dict() or response.reply instead') return self.response.reply def response_json(self): "Returns the response JSON." - log.warn('response_json() DEPRECATED, use response.json() instead') + log.warning('response_json() DEPRECATED, use response.json() instead') return self.response.json() diff --git a/ebaysdk/finding/__init__.py b/ebaysdk/finding/__init__.py index be0ad98..64a9286 100644 --- a/ebaysdk/finding/__init__.py +++ b/ebaysdk/finding/__init__.py @@ -270,7 +270,7 @@ def _get_resp_body_errors(self): self._resp_codes = resp_codes if self.config.get('warnings') and len(warnings) > 0: - log.warn("%s: %s\n\n" % (self.verb, "\n".join(warnings))) + log.warning("%s: %s\n\n" % (self.verb, "\n".join(warnings))) try: if self.response.reply.ack == 'Success' and len(errors) > 0 and self.config.get('errors'): diff --git a/ebaysdk/inventorymanagement/__init__.py b/ebaysdk/inventorymanagement/__init__.py index c9ee40a..f1bf98c 100644 --- a/ebaysdk/inventorymanagement/__init__.py +++ b/ebaysdk/inventorymanagement/__init__.py @@ -296,7 +296,7 @@ def _get_resp_body_errors(self): self._resp_codes = resp_codes if self.config.get('warnings') and len(warnings) > 0: - log.warn("{verb}: {message}\n\n".format( + log.warning("{verb}: {message}\n\n".format( verb=self.verb, message="\n".join(warnings))) # In special case of error 500 on ebay side, we get really weird diff --git a/ebaysdk/policies/__init__.py b/ebaysdk/policies/__init__.py index ebc4f4f..278cfdf 100644 --- a/ebaysdk/policies/__init__.py +++ b/ebaysdk/policies/__init__.py @@ -208,7 +208,7 @@ def _get_resp_body_errors(self): self._resp_codes = resp_codes if self.config.get('warnings') and len(warnings) > 0: - log.warn("%s: %s\n\n" % (self.verb, "\n".join(warnings))) + log.warning("%s: %s\n\n" % (self.verb, "\n".join(warnings))) try: if self.response.reply.ack == 'Success' and len(errors) > 0 and self.config.get('errors'): diff --git a/ebaysdk/shopping/__init__.py b/ebaysdk/shopping/__init__.py index a53c9cf..edba963 100644 --- a/ebaysdk/shopping/__init__.py +++ b/ebaysdk/shopping/__init__.py @@ -244,7 +244,7 @@ def _get_resp_body_errors(self): self._resp_codes = resp_codes if self.config.get('warnings') and len(warnings) > 0: - log.warn("%s: %s\n\n" % (self.verb, "\n".join(warnings))) + log.warning("%s: %s\n\n" % (self.verb, "\n".join(warnings))) if self.response.reply.Ack == 'Failure': if self.config.get('errors'): diff --git a/ebaysdk/soa/__init__.py b/ebaysdk/soa/__init__.py index 9d05923..f3d80f2 100644 --- a/ebaysdk/soa/__init__.py +++ b/ebaysdk/soa/__init__.py @@ -178,7 +178,7 @@ def _get_resp_body_errors(self): self._resp_codes = resp_codes if self.config.get('warnings') and len(warnings) > 0: - log.warn("%s: %s\n\n" % (self.verb, "\n".join(warnings))) + log.warning("%s: %s\n\n" % (self.verb, "\n".join(warnings))) try: if self.response.reply.ack == 'Success' and len(errors) > 0 and self.config.get('errors'): diff --git a/ebaysdk/trading/__init__.py b/ebaysdk/trading/__init__.py index e199851..7918417 100644 --- a/ebaysdk/trading/__init__.py +++ b/ebaysdk/trading/__init__.py @@ -798,7 +798,7 @@ def _get_resp_body_errors(self): self._resp_codes = resp_codes if self.config.get('warnings') and len(warnings) > 0: - log.warn("{verb}: {message}\n\n".format( + log.warning("{verb}: {message}\n\n".format( verb=self.verb, message="\n".join(warnings))) if self.response.reply.Ack == 'Failure': From fe02f724a1b44f8c5eccd96e9dc86f4630ea4410 Mon Sep 17 00:00:00 2001 From: riozo Date: Mon, 11 Oct 2021 15:49:18 +0330 Subject: [PATCH 28/28] add iaf_token to shopping API --- ebaysdk/shopping/__init__.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/ebaysdk/shopping/__init__.py b/ebaysdk/shopping/__init__.py index edba963..bb01854 100644 --- a/ebaysdk/shopping/__init__.py +++ b/ebaysdk/shopping/__init__.py @@ -79,6 +79,7 @@ def __init__(self, **kwargs): self.config.set('proxy_host', None) self.config.set('proxy_port', None) self.config.set('appid', None) + self.config.set('iaf_token', None) self.config.set('version', '799') self.config.set('trackingid', None) self.config.set('trackingpartnercode', None) @@ -146,6 +147,10 @@ def build_request_headers(self, verb): "X-EBAY-API-TRACKING-PARTNER-CODE": self.config.get('trackingpartnercode') }) + if self.config.get('iaf_token', None): + headers["X-EBAY-API-IAF-TOKEN"] = self.config.get('iaf_token') + + return headers def build_request_data(self, verb, data, verb_attrs):