Skip to content

Commit 3cfc2eb

Browse files
authored
Merge pull request timotheus#245 from mthaddon/master
Add an option for domain to sample/findings.py so it can work with sandbox keys
2 parents b357af5 + 9d28f5e commit 3cfc2eb

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

samples/finding.py

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ def init_options():
3131
parser.add_option("-a", "--appid",
3232
dest="appid", default=None,
3333
help="Specifies the eBay application id to use.")
34+
parser.add_option("-n", "--domain",
35+
dest="domain", default='svcs.ebay.com',
36+
help="Specifies the eBay domain to use (e.g. svcs.sandbox.ebay.com).")
3437

3538
(opts, args) = parser.parse_args()
3639
return opts, args
@@ -39,7 +42,7 @@ def init_options():
3942
def run(opts):
4043

4144
try:
42-
api = finding(debug=opts.debug, appid=opts.appid,
45+
api = finding(debug=opts.debug, appid=opts.appid, domain=opts.domain,
4346
config_file=opts.yaml, warnings=True)
4447

4548
api_request = {
@@ -66,7 +69,7 @@ def run(opts):
6669
def run_unicode(opts):
6770

6871
try:
69-
api = finding(debug=opts.debug, appid=opts.appid,
72+
api = finding(debug=opts.debug, appid=opts.appid, domain=opts.domain,
7073
config_file=opts.yaml, warnings=True)
7174

7275
api_request = {
@@ -88,7 +91,7 @@ def run_unicode(opts):
8891

8992
def run2(opts):
9093
try:
91-
api = finding(debug=opts.debug, appid=opts.appid,
94+
api = finding(debug=opts.debug, appid=opts.appid, domain=opts.domain,
9295
config_file=opts.yaml)
9396

9497
response = api.execute('findItemsByProduct',
@@ -103,7 +106,7 @@ def run2(opts):
103106

104107
def run_motors(opts):
105108
api = finding(siteid='EBAY-MOTOR', debug=opts.debug, appid=opts.appid, config_file=opts.yaml,
106-
warnings=True)
109+
domain=opts.domain, warnings=True)
107110

108111
api.execute('findItemsAdvanced', {
109112
'keywords': 'tesla',

0 commit comments

Comments
 (0)