-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathcacher_open_snippet.py
39 lines (32 loc) · 1.01 KB
/
cacher_open_snippet.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
import sublime_plugin
from .lib import snippets, util
class OpenSnippetInputHandler(sublime_plugin.ListInputHandler):
@staticmethod
def list_items():
return snippets.snippets_for_list()
class CacherOpenSnippet(sublime_plugin.ApplicationCommand):
@staticmethod
def run(open_snippet):
if not open_snippet:
return
snippet = snippets.snippet_with_guid(open_snippet)
if not snippet:
return
if snippet["team"]:
util.open_url(
host=util.settings().get("appHost"),
path="/enter",
action="goto_team_snippet",
t=snippet["team"]["guid"],
s=snippet["guid"]
)
else:
util.open_url(
host=util.settings().get("appHost"),
path="/enter",
action="goto_snippet",
s=snippet["guid"]
)
@staticmethod
def input(args):
return OpenSnippetInputHandler()