Skip to content
This repository was archived by the owner on May 8, 2018. It is now read-only.

Commit aaeecdd

Browse files
committed
Removed hardcoded tuples as default parameters.
1 parent e0cf0cc commit aaeecdd

File tree

1 file changed

+24
-13
lines changed

1 file changed

+24
-13
lines changed

mws/mws.py

Lines changed: 24 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ def make_request(self, extra_data, method="GET", **kwargs):
168168

169169
except HTTPError, e:
170170
error = MWSError(str(e))
171-
error.response = getattr(e, 'response')
171+
error.response = e.response
172172
raise error
173173

174174
# Store the response object in the parsed_response for quick access
@@ -209,11 +209,11 @@ def enumerate_param(self, param, values):
209209
}
210210
"""
211211
params = {}
212-
213-
if not param.endswith('.'):
214-
param = "%s." % param
215-
for num, value in enumerate(values):
216-
params['%s%d' % (param, (num + 1))] = value
212+
if values is not None:
213+
if not param.endswith('.'):
214+
param = "%s." % param
215+
for num, value in enumerate(values):
216+
params['%s%d' % (param, (num + 1))] = value
217217
return params
218218

219219

@@ -222,11 +222,11 @@ class Feeds(MWS):
222222

223223
ACCOUNT_TYPE = "Merchant"
224224

225-
def submit_feed(self, feed, feed_type, marketplaceids=(),
225+
def submit_feed(self, feed, feed_type, marketplaceids=None,
226226
content_type="text/xml", purge='false'):
227227
"""
228-
Uploads a feed ( xml or .tsv ) to the seller's inventory.
229-
Can be used for creating/updating products on amazon.
228+
Uploads a feed ( xml or .tsv ) to the seller's inventory.
229+
Can be used for creating/updating products on Amazon.
230230
"""
231231
data = dict(Action='SubmitFeed',
232232
FeedType=feed_type,
@@ -236,8 +236,13 @@ def submit_feed(self, feed, feed_type, marketplaceids=(),
236236
return self.make_request(data, method="POST", body=feed,
237237
extra_headers={'Content-MD5': md, 'Content-Type': content_type})
238238

239-
def get_feed_submission_list(self, feedids=(), max_count=None, feedtypes=(),
240-
processingstatuses=(), fromdate=None, todate=None):
239+
def get_feed_submission_list(self, feedids=None, max_count=None, feedtypes=None,
240+
processingstatuses=None, fromdate=None, todate=None):
241+
"""
242+
Returns a list of all feed submissions submitted in the previous 90 days.
243+
That match the query parameters.
244+
"""
245+
241246
data = dict(Action='GetFeedSubmissionList',
242247
MaxCount=max_count,
243248
SubmittedFromDate=fromdate,
@@ -251,15 +256,15 @@ def get_submission_list_by_next_token(self, token):
251256
data = dict(Action='GetFeedSubmissionListByNextToken', NextToken=token)
252257
return self.make_request(data)
253258

254-
def get_feed_submission_count(self, feedtypes=(), processingstatuses=(), fromdate=None, todate=None):
259+
def get_feed_submission_count(self, feedtypes=None, processingstatuses=None, fromdate=None, todate=None):
255260
data = dict(Action='GetFeedSubmissionCount',
256261
SubmittedFromDate=fromdate,
257262
SubmittedToDate=todate)
258263
data.update(self.enumerate_param('FeedTypeList.Type.', feedtypes))
259264
data.update(self.enumerate_param('FeedProcessingStatusList.Status.', processingstatuses))
260265
return self.make_request(data)
261266

262-
def cancel_feed_submissions(self, feedids=(), feedtypes=(), fromdate=None, todate=None):
267+
def cancel_feed_submissions(self, feedids=None, feedtypes=None, fromdate=None, todate=None):
263268
data = dict(Action='CancelFeedSubmissions',
264269
SubmittedFromDate=fromdate,
265270
SubmittedToDate=todate)
@@ -554,3 +559,9 @@ class OutboundShipments(MWS):
554559
URI = "/FulfillmentOutboundShipment/2010-10-01"
555560
VERSION = "2010-10-01"
556561
# To be completed
562+
563+
564+
try:
565+
execfile('keys.py', globals(), locals())
566+
except IOError, err:
567+
pass

0 commit comments

Comments
 (0)