Skip to content

Commit

Permalink
Fix: get_shard_id failing when setting new token
Browse files Browse the repository at this point in the history
  • Loading branch information
bordaigorl committed Sep 16, 2014
1 parent 6c49f12 commit c24aa77
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions sublime_evernote.py
Original file line number Diff line number Diff line change
Expand Up @@ -220,13 +220,13 @@ class EvernoteDo():
def token(self):
return self.settings.get("token")

def get_shard_id(self):
token_parts = self.token().split(":")
def get_shard_id(self, token=None):
token_parts = (token or self.token()).split(":")
id = token_parts[0][2:]
return id

def get_user_id(self):
token_parts = self.token().split(":")
def get_user_id(self, token=None):
token_parts = (token or self.token()).split(":")
id = token_parts[1][2:]
return int(id, 16)

Expand Down Expand Up @@ -271,7 +271,7 @@ def __connect(token, noteStoreUrl):
callback(**kwargs)

def __derive_note_store_url(token):
id = self.get_shard_id()
id = self.get_shard_id(token)
url = "http://www.evernote.com/shard/" + id + "/notestore"
return url

Expand Down

0 comments on commit c24aa77

Please sign in to comment.