Created
April 4, 2013 20:12
-
-
Save evernotegists/5313915 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def shareSingleNote(authToken, noteStore, userStore, noteGuid, shardId=None): | |
""" | |
Share a single note and return the public URL for the note | |
""" | |
if not shardId: | |
shardId = getUserShardId(authToken, userStore) | |
if not shardId: | |
raise SystemExit | |
try: | |
shareKey = noteStore.shareNote(authToken, noteGuid) | |
except (EDAMNotFoundException, EDAMSystemException, EDAMUserException), e: | |
print "Error sharing note:" | |
print type(e), e | |
return None | |
return "%s/shard/%s/sh/%s/%s" % \ | |
(EN_URL, shardId, noteGuid, shareKey) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment