@@ -39,6 +39,9 @@ def init_options():
3939 parser .add_option ("-c" , "--certid" ,
4040 dest = "certid" , default = None ,
4141 help = "Specifies the eBay cert id to use." )
42+ parser .add_option ("-n" , "--domain" ,
43+ dest = "domain" , default = 'svcs.ebay.com' ,
44+ help = "Specifies the eBay domain to use (e.g. svcs.sandbox.ebay.com)." )
4245
4346 (opts , args ) = parser .parse_args ()
4447 return opts , args
@@ -47,7 +50,7 @@ def init_options():
4750def run (opts ):
4851
4952 try :
50- api = Trading (debug = opts .debug , config_file = opts .yaml , appid = opts .appid ,
53+ api = Trading (debug = opts .debug , config_file = opts .yaml , appid = opts .appid , domain = opts . domain ,
5154 certid = opts .certid , devid = opts .devid )
5255
5356 api .execute ('GetCharities' , {'CharityID' : 3897 })
@@ -61,7 +64,7 @@ def run(opts):
6164
6265def feedback (opts ):
6366 try :
64- api = Trading (debug = opts .debug , config_file = opts .yaml , appid = opts .appid ,
67+ api = Trading (debug = opts .debug , config_file = opts .yaml , appid = opts .appid , domain = opts . domain ,
6568 certid = opts .certid , devid = opts .devid , warnings = False )
6669
6770 api .execute ('GetFeedback' , {'UserID' : 'tim0th3us' })
@@ -80,7 +83,7 @@ def feedback(opts):
8083def getTokenStatus (opts ):
8184
8285 try :
83- api = Trading (debug = opts .debug , config_file = opts .yaml , appid = opts .appid ,
86+ api = Trading (debug = opts .debug , config_file = opts .yaml , appid = opts .appid , domain = opts . domain ,
8487 certid = opts .certid , devid = opts .devid , warnings = False )
8588
8689 api .execute ('GetTokenStatus' )
@@ -96,7 +99,7 @@ def verifyAddItem(opts):
9699 """
97100
98101 try :
99- api = Trading (debug = opts .debug , config_file = opts .yaml , appid = opts .appid ,
102+ api = Trading (debug = opts .debug , config_file = opts .yaml , appid = opts .appid , domain = opts . domain ,
100103 certid = opts .certid , devid = opts .devid , warnings = False )
101104
102105 myitem = {
@@ -167,7 +170,7 @@ def verifyAddItemErrorCodes(opts):
167170 """
168171
169172 try :
170- api = Trading (debug = opts .debug , config_file = opts .yaml , appid = opts .appid ,
173+ api = Trading (debug = opts .debug , config_file = opts .yaml , appid = opts .appid , domain = opts . domain ,
171174 certid = opts .certid , devid = opts .devid , warnings = False )
172175
173176 myitem = {
@@ -244,7 +247,7 @@ def verifyAddItemErrorCodes(opts):
244247def uploadPicture (opts ):
245248
246249 try :
247- api = Trading (debug = opts .debug , config_file = opts .yaml , appid = opts .appid ,
250+ api = Trading (debug = opts .debug , config_file = opts .yaml , appid = opts .appid , domain = opts . domain ,
248251 certid = opts .certid , devid = opts .devid , warnings = True )
249252
250253 pictureData = {
@@ -264,7 +267,7 @@ def uploadPicture(opts):
264267def uploadPictureFromFilesystem (opts , filepath ):
265268
266269 try :
267- api = Trading (debug = opts .debug , config_file = opts .yaml , appid = opts .appid ,
270+ api = Trading (debug = opts .debug , config_file = opts .yaml , appid = opts .appid , domain = opts . domain ,
268271 certid = opts .certid , devid = opts .devid , warnings = True )
269272
270273 # pass in an open file
@@ -287,7 +290,7 @@ def uploadPictureFromFilesystem(opts, filepath):
287290def memberMessages (opts ):
288291
289292 try :
290- api = Trading (debug = opts .debug , config_file = opts .yaml , appid = opts .appid ,
293+ api = Trading (debug = opts .debug , config_file = opts .yaml , appid = opts .appid , domain = opts . domain ,
291294 certid = opts .certid , devid = opts .devid , warnings = True )
292295
293296 now = datetime .datetime .now ()
@@ -325,7 +328,7 @@ def memberMessages(opts):
325328def getUser (opts ):
326329 try :
327330
328- api = Trading (debug = opts .debug , config_file = opts .yaml , appid = opts .appid ,
331+ api = Trading (debug = opts .debug , config_file = opts .yaml , appid = opts .appid , domain = opts . domain ,
329332 certid = opts .certid , devid = opts .devid , warnings = True , timeout = 20 , siteid = '101' )
330333
331334 api .execute ('GetUser' , {'UserID' : 'sallyma789' })
@@ -339,7 +342,7 @@ def getUser(opts):
339342def getOrders (opts ):
340343
341344 try :
342- api = Trading (debug = opts .debug , config_file = opts .yaml , appid = opts .appid ,
345+ api = Trading (debug = opts .debug , config_file = opts .yaml , appid = opts .appid , domain = opts . domain ,
343346 certid = opts .certid , devid = opts .devid , warnings = True , timeout = 20 )
344347
345348 api .execute ('GetOrders' , {'NumberOfDays' : 30 })
@@ -353,7 +356,7 @@ def getOrders(opts):
353356def categories (opts ):
354357
355358 try :
356- api = Trading (debug = opts .debug , config_file = opts .yaml , appid = opts .appid ,
359+ api = Trading (debug = opts .debug , config_file = opts .yaml , appid = opts .appid , domain = opts . domain ,
357360 certid = opts .certid , devid = opts .devid , warnings = True , timeout = 20 , siteid = '0' )
358361
359362 callData = {
@@ -392,6 +395,6 @@ def categories(opts):
392395 uploadPictureFromFilesystem (opts , ("%s/test_image.jpg" % os .path .dirname (__file__ )))
393396 memberMessages (opts )
394397 categories (opts )
395-
398+
396399 # getUser(opts)
397400 # getOrders(opts)
0 commit comments