Skip to content

Instantly share code, notes, and snippets.

@evernotegists
Created April 4, 2013 20:11
Show Gist options
  • Save evernotegists/5313913 to your computer and use it in GitHub Desktop.
Save evernotegists/5313913 to your computer and use it in GitHub Desktop.
def getUserShardId(authToken, userStore):
"""
Get the User from userStore and return the user's shard ID
"""
try:
user = userStore.getUser(authToken)
except (Errors.EDAMUserException, Errors.EDAMSystemException), e:
print "Exception while getting user's shardID:"
print type(e), e
return None
if hasattr(user, 'shardId'):
return user.shardId
return None
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment