From c24aa7793387d6db7e2a5337f909b1294ac45b10 Mon Sep 17 00:00:00 2001 From: bordaigorl Date: Tue, 16 Sep 2014 11:00:20 +0100 Subject: [PATCH] Fix: get_shard_id failing when setting new token --- sublime_evernote.py | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/sublime_evernote.py b/sublime_evernote.py index 9b255f1..cae9d48 100644 --- a/sublime_evernote.py +++ b/sublime_evernote.py @@ -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) @@ -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