Skip to content

Commit 9289cb2

Browse files
committed
Polishing commands and moving entries from context menu to preferences menu
1 parent 27f15be commit 9289cb2

File tree

4 files changed

+41
-20
lines changed

4 files changed

+41
-20
lines changed

Context.sublime-menu

Lines changed: 0 additions & 15 deletions
This file was deleted.

Default.sublime-commands

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
[
2-
{ "command": "send_to_evernote", "caption": "Send to Evernote" },
3-
{ "command": "open_evernote_note", "caption": "Open Evernote Note" },
2+
{ "command": "send_to_evernote", "caption": "Evernote: Send to Evernote" },
3+
{ "command": "open_evernote_note", "caption": "Evernote: Open Evernote Note" },
44
{
5-
"caption": "Evernote Settings",
5+
"caption": "Evernote: Settings",
66
"command": "open_file", "args":
77
{
88
"file": "${packages}/User/SublimeEvernote.sublime-settings"

Main.sublime-menu

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
[
2+
{
3+
"caption": "Preferences",
4+
"mnemonic": "n",
5+
"id": "preferences",
6+
"children":
7+
[
8+
{
9+
"caption": "Package Settings",
10+
"mnemonic": "P",
11+
"id": "package-settings",
12+
"children":
13+
[
14+
{
15+
"caption": "Evernote",
16+
"children":
17+
[
18+
{
19+
"command": "open_file",
20+
"args": {"file": "${packages}/Evernote/README.md"},
21+
"caption": "README"
22+
},
23+
{ "caption": "-" },
24+
{
25+
"command": "open_file",
26+
"args": {"file": "${packages}/Evernote/Evernote.sublime-settings"},
27+
"caption": "Settings – Default"
28+
}
29+
]
30+
}
31+
]
32+
}
33+
]
34+
}
35+
]

sublime_evernote.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ def on_token(token):
116116
__connect(token, noteStoreUrl)
117117
else:
118118
webbrowser.open_new_tab("https://www.evernote.com/api/DeveloperToken.action")
119-
self.window.show_input_panel("Developer Token (required)::", "", on_token, None, None)
119+
self.window.show_input_panel("Developer Token (required):", "", on_token, None, None)
120120

121121
def send_note(self, **kwargs):
122122
token = self.settings.get("token")
@@ -219,6 +219,7 @@ def run(self):
219219

220220
token = self.settings.get("token")
221221

222+
# TODO: refactor pop out in def
222223
if sys.version_info.major == 2:
223224
noteStore = EvernoteClient(token=token, sandbox=False).get_note_store()
224225
if sys.version_info.major == 3:
@@ -230,6 +231,7 @@ def run(self):
230231
noteStoreProtocol = TBinaryProtocol.TBinaryProtocol(noteStoreHttpClient)
231232
noteStore = NoteStore.Client(noteStoreProtocol)
232233

234+
# TODO: refactor, join with __get_notebooks and caching (with reset after timeout)
233235
notebooks = None
234236
try:
235237
sublime.status_message("Fetching notebooks, please wait...")
@@ -265,4 +267,3 @@ def on_note(i):
265267
sublime.set_timeout(lambda: self.window.show_quick_panel([note.title for note in notes], on_note), 0)
266268
self.window.show_quick_panel([notebook.name for notebook in notebooks], on_notebook)
267269

268-

0 commit comments

Comments
 (0)