forked from sgricci/LiveReload-sublimetext2
-
Notifications
You must be signed in to change notification settings - Fork 0
/
CommandAPI.py
34 lines (23 loc) · 896 Bytes
/
CommandAPI.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
#!/usr/bin/python
# -*- coding: utf-8 -*-
import sublime
import sublime_plugin
import LiveReload
import webbrowser
import os
class LiveReloadTest(sublime_plugin.ApplicationCommand):
def run(self):
path = os.path.join(sublime.packages_path(), 'LiveReload', 'web')
file_name = os.path.join(path, 'test.html')
webbrowser.open_new_tab("file://"+file_name)
class LiveReloadHelp(sublime_plugin.ApplicationCommand):
def run(self):
webbrowser.open_new_tab('https://github.com/dz0ny/LiveReload-sublimetext2/'
)
class LiveReloadEnablePluginCommand(sublime_plugin.ApplicationCommand):
def on_done(self, index):
if not index is -1:
LiveReload.Plugin.togglePlugin(index)
def run(self):
sublime.active_window().show_quick_panel(LiveReload.Plugin.listPlugins(),
self.on_done)