Skip to content

Commit 764009e

Browse files
committed
Finally Main plug-in file
1 parent 461ee5d commit 764009e

File tree

1 file changed

+16
-9
lines changed

1 file changed

+16
-9
lines changed

python_voice_coding_plugin.py

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,29 +4,39 @@
44
import sublime
55
import sublime_plugin
66

7-
settings = {}
7+
88
# making sure our dependencies are in the path
99
sys.path.insert(0,os.path.join(os.path.dirname(__file__), 'third_party'))
1010

1111
from PythonVoiceCodingPlugin.interface.interface import Interface
1212

13-
# removing our dependencies from the path so as not to interfere with other packages
14-
sys.path.remove(os.path.join(os.path.dirname(__file__), 'third_party'))
1513

14+
PLUGIN_VERSION = (0,1,0)
15+
16+
settings = {}
17+
already_message = False
1618

1719
def plugin_loaded():
1820
global settings
1921
settings = sublime.load_settings("python_voice_coding_plugin.sublime-settings")
2022

21-
2223

23-
class PythonVoiceCodingPluginCommand(sublime_plugin.TextCommand,sublime_plugin.ViewEventListener):
24+
25+
class PythonVoiceCodingPluginCommand(sublime_plugin.TextCommand):
2426
def run(self, edit,arg):
27+
global already_message
28+
if "grammar_version" not in arg and not already_message:
29+
sublime.error_message("You are using main plug-in version >=0.1.0 with a grammar <= 0.0.5." +
30+
"They are not compatible." +
31+
"You can find the new newest version of the grammar along with instructions to install it" +
32+
" Under Preferences > Package Settings > PythonVoiceCodingPlugin"
33+
34+
)
35+
already_message = True
2536
self.action_one(edit,arg)
2637

2738
def action_one(self, edit,arg):
2839
global settings
29-
print(" the counties ",self.view.change_count())
3040
interface = Interface(
3141
sublime = sublime,
3242
view = self.view,
@@ -36,10 +46,7 @@ def action_one(self, edit,arg):
3646
)
3747
interface.respond_to_query(arg)
3848
interface.respond_to_event({"event":"update_change_count","change_count":self.view.change_count()})
39-
print(" the counties ",self.view.change_count())
4049

41-
def on_modified(self):
42-
print(" from the event lease and their side of the plug-in",self.view.change_count())
4350

4451

4552

0 commit comments

Comments
 (0)