Skip to content

Commit

Permalink
add Yinxiang Biji support
Browse files Browse the repository at this point in the history
  • Loading branch information
achen committed Nov 6, 2015
1 parent 44d8485 commit 69273e3
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 2 deletions.
3 changes: 3 additions & 0 deletions lib/evernote/api/client.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,11 @@ def __init__(self, **options):
self.consumer_key = options.get('consumer_key')
self.consumer_secret = options.get('consumer_secret')
self.sandbox = options.get('sandbox', True)
self.china = options.get('china', False)
if self.sandbox:
default_service_host = 'sandbox.evernote.com'
elif self.china:
default_service_host = 'app.yinxiang.com'
else:
default_service_host = 'www.evernote.com'
self.service_host = options.get('service_host', default_service_host)
Expand Down
22 changes: 20 additions & 2 deletions sample/client/EDAMTest.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,18 @@
# Real applications authenticate with Evernote using OAuth, but for the
# purpose of exploring the API, you can get a developer token that allows
# you to access your own Evernote account. To get a developer token, visit
# https://sandbox.evernote.com/api/DeveloperToken.action
# https://SERVICE_HOST/api/DeveloperToken.action
#
# There are three Evernote services:
#
# Sandbox: https://sandbox.evernote.com/
# Production (International): https://www.evernote.com/
# Production (China): https://app.yinxiang.com/
#
# For more information about Sandbox and Evernote China services, please
# refer to https://dev.evernote.com/doc/articles/testing.php
# and https://dev.evernote.com/doc/articles/bootstrap.php

auth_token = "your developer token"

if auth_token == "your developer token":
Expand All @@ -27,11 +38,18 @@
"https://sandbox.evernote.com/api/DeveloperToken.action"
exit(1)


# To access Sandbox service, set sandbox to True
# To access production (International) service, set both sandbox and china to False
# To access production (China) service, set sandbox to False and china to True
sandbox = True
china = False

# Initial development is performed on our sandbox server. To use the production
# service, change sandbox=False and replace your
# developer token above with a token from
# https://www.evernote.com/api/DeveloperToken.action
client = EvernoteClient(token=auth_token, sandbox=True)
client = EvernoteClient(token=auth_token, sandbox=sandbox, china=china)

user_store = client.get_user_store()

Expand Down

0 comments on commit 69273e3

Please sign in to comment.