Skip to content

Commit 0fcf66a

Browse files
committed
Committing grammar bundles
1 parent 81d3405 commit 0fcf66a

4 files changed

+137
-54
lines changed

bundles/Caster/python_voice_coding_plugin_caster_v0-5-11.py

+43-13
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,9 @@ def create_arguments(command,format,**kwargs):
5050

5151

5252
def send_sublime(c,data):
53-
x = json.dumps(data).replace('"','\\"')
54-
y = "subl --command \"" + c + " " + x + "\""
5553
if local_settings["show_command"]:
56-
print(y)
57-
subprocess.call(y, shell = True)
58-
subprocess.call("subl", shell = True)
54+
print(c + " " + json.dumps(data))
55+
subprocess.Popen(["subl","-b", "--command",c + " " + json.dumps(data)],creationflags = 0x08000000)
5956

6057
def noob_send(command,format,**kwargs):
6158
data = create_arguments(command,format,**kwargs)
@@ -294,16 +291,49 @@ class PythonVoiceCodingPluginRule(MergeRule):
294291
"decorator":"decorator",
295292
"base class":"base class",
296293

297-
# "same" : "same",
294+
# "same" : "same",
298295

299296

300-
# "string" : "string",
301-
# "integer literal" : "integer literal",
302-
# "dictionary" : "dictionary",
303-
# "list" : "list",
304-
# "tuple" : "tuple",
305-
# "set" : "set",
306-
# "key" : "key",
297+
# "string" : "string",
298+
# "integer literal" : "integer literal",
299+
# "dictionary" : "dictionary",
300+
# "list" : "list",
301+
# "tuple" : "tuple",
302+
# "set" : "set",
303+
304+
305+
# "subscript" : "subscript",
306+
# "subscript body" : "subscript body",
307+
# "key" : "key",
308+
# "lower" : "lower",
309+
# "upper" : "upper",
310+
# "step" : "step",
311+
312+
# "attribute" : "attribute",
313+
314+
# "comparison" : "comparison",
315+
# "arithmetic" : "arithmetic",
316+
# "boolean" : "boolean",
317+
318+
# "member": "member",
319+
# "container": "container",
320+
# "membership" : "membership",
321+
322+
# "left side" : "left side",
323+
# "right side" : "right side",
324+
# "middle" : "middle",
325+
326+
# "arithmetic left" : "arithmetic left" ,
327+
# "arithmetic right" : "arithmetic right",
328+
# "arithmetic middle" : "arithmetic middle",
329+
330+
# "boolean left" : "boolean left",
331+
# "boolean right" : "boolean right",
332+
# "boolean middle" : "boolean middle",
333+
334+
# "boolean and" : "boolean and" ,
335+
# "boolean or" : "boolean or",
336+
307337

308338

309339
}

bundles/Caster/python_voice_coding_plugin_caster_v0-6-11.py

+43-14
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from dragonfly import (Choice, Dictation, Grammar, Repeat, StartApp, Function)
1+
from dragonfly import (MappingRule, Choice, Dictation, Grammar, Repeat, StartApp, Function,RunCommand,FocusWindow)
22

33
from castervoice.lib import control
44
from castervoice.lib import settings
@@ -50,12 +50,9 @@ def create_arguments(command,format,**kwargs):
5050

5151

5252
def send_sublime(c,data):
53-
x = json.dumps(data).replace('"','\\"')
54-
y = "subl --command \"" + c + " " + x + "\""
5553
if local_settings["show_command"]:
56-
print(y)
57-
subprocess.call(y, shell = True)
58-
subprocess.call("subl", shell = True)
54+
print(c + " " + json.dumps(data))
55+
RunCommand(["subl","-b", "--command",c + " " + json.dumps(data)],synchronous = True).execute()
5956

6057
def noob_send(command,format,**kwargs):
6158
data = create_arguments(command,format,**kwargs)
@@ -293,16 +290,48 @@ class PythonVoiceCodingPluginRule(MergeRule):
293290
"decorator":"decorator",
294291
"base class":"base class",
295292

296-
# "same" : "same",
293+
# "same" : "same",
297294

298295

299-
# "string" : "string",
300-
# "integer literal" : "integer literal",
301-
# "dictionary" : "dictionary",
302-
# "list" : "list",
303-
# "tuple" : "tuple",
304-
# "set" : "set",
305-
# "key" : "key",
296+
# "string" : "string",
297+
# "integer literal" : "integer literal",
298+
# "dictionary" : "dictionary",
299+
# "list" : "list",
300+
# "tuple" : "tuple",
301+
# "set" : "set",
302+
303+
304+
# "subscript" : "subscript",
305+
# "subscript body" : "subscript body",
306+
# "key" : "key",
307+
# "lower" : "lower",
308+
# "upper" : "upper",
309+
# "step" : "step",
310+
311+
# "attribute" : "attribute",
312+
313+
# "comparison" : "comparison",
314+
# "arithmetic" : "arithmetic",
315+
# "boolean" : "boolean",
316+
317+
# "member": "member",
318+
# "container": "container",
319+
# "membership" : "membership",
320+
321+
# "left side" : "left side",
322+
# "right side" : "right side",
323+
# "middle" : "middle",
324+
325+
# "arithmetic left" : "arithmetic left" ,
326+
# "arithmetic right" : "arithmetic right",
327+
# "arithmetic middle" : "arithmetic middle",
328+
329+
# "boolean left" : "boolean left",
330+
# "boolean right" : "boolean right",
331+
# "boolean middle" : "boolean middle",
332+
333+
# "boolean and" : "boolean and" ,
334+
# "boolean or" : "boolean or",
306335

307336

308337
}

bundles/Caster/python_voice_coding_plugin_caster_v1-0-0.py

+50-17
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from dragonfly import (MappingRule, Choice, Dictation, Grammar, Repeat, StartApp, Function)
1+
from dragonfly import (MappingRule, Choice, Dictation, Grammar, Repeat, StartApp, Function,RunCommand,FocusWindow)
22

33
from castervoice.lib import control
44
from castervoice.lib import settings
@@ -18,7 +18,7 @@
1818
#########################################################################################
1919

2020
local_settings = {
21-
"show_command":False,
21+
"show_command":True,
2222
"force_rpc":False,
2323
}
2424

@@ -49,12 +49,10 @@ def create_arguments(command,format,**kwargs):
4949

5050

5151
def send_sublime(c,data):
52-
x = json.dumps(data).replace('"','\\"')
53-
y = "subl --command \"" + c + " " + x + "\""
5452
if local_settings["show_command"]:
55-
print(y)
56-
subprocess.call(y, shell = True)
57-
subprocess.call("subl", shell = True)
53+
print(c + " " + json.dumps(data))
54+
RunCommand(["subl","-b", "--command",c + " " + json.dumps(data)],synchronous = True).execute()
55+
5856

5957
def noob_send(command,format,**kwargs):
6058
data = create_arguments(command,format,**kwargs)
@@ -237,7 +235,8 @@ class PythonVoiceCodingPluginRule(MappingRule):
237235
Choice("big_roi",{
238236

239237
"if condition" : "if condition",
240-
"else if condition" : "else if condition",
238+
"iffae" : "if condition",
239+
"LFA" : "else if condition",
241240
"while condition" : "while condition",
242241
"with item" : "with clause",
243242

@@ -279,6 +278,7 @@ class PythonVoiceCodingPluginRule(MappingRule):
279278
"iterable" : "iterable",
280279

281280
"function name": "definition name",
281+
"F name": "definition name",
282282
"function parameter": "definition parameter",
283283
"parameter list": "definition parameter list",
284284
"default value": "default value",
@@ -292,17 +292,48 @@ class PythonVoiceCodingPluginRule(MappingRule):
292292
"decorator":"decorator",
293293
"base class":"base class",
294294

295-
# "same" : "same",
295+
# "same" : "same",
296+
297+
298+
# "string" : "string",
299+
# "integer literal" : "integer literal",
300+
# "dictionary" : "dictionary",
301+
# "list" : "list",
302+
# "tuple" : "tuple",
303+
# "set" : "set",
304+
305+
306+
# "subscript" : "subscript",
307+
# "subscript body" : "subscript body",
308+
# "key" : "key",
309+
# "lower" : "lower",
310+
# "upper" : "upper",
311+
# "step" : "step",
312+
313+
# "attribute" : "attribute",
314+
315+
# "comparison" : "comparison",
316+
# "arithmetic" : "arithmetic",
317+
# "boolean" : "boolean",
318+
319+
# "member": "member",
320+
# "container": "container",
321+
# "membership" : "membership",
322+
323+
# "left side" : "left side",
324+
# "right side" : "right side",
325+
# "middle" : "middle",
296326

327+
# "arithmetic left" : "arithmetic left" ,
328+
# "arithmetic right" : "arithmetic right",
329+
# "arithmetic middle" : "arithmetic middle",
297330

298-
# "string" : "string",
299-
# "integer literal" : "integer literal",
300-
# "dictionary" : "dictionary",
301-
# "list" : "list",
302-
# "tuple" : "tuple",
303-
# "set" : "set",
304-
# "key" : "key",
331+
# "boolean left" : "boolean left",
332+
# "boolean right" : "boolean right",
333+
# "boolean middle" : "boolean middle",
305334

335+
# "boolean and" : "boolean and" ,
336+
# "boolean or" : "boolean or",
306337

307338
}
308339
),
@@ -322,6 +353,7 @@ class PythonVoiceCodingPluginRule(MappingRule):
322353
),
323354
Choice("surrounding_punctuation",{
324355
"quotes": ("quotes","quotes"),
356+
"experiment":('"\t/','\n\n\n"&' + r'\s'),
325357
"thin quotes": ("'","'"),
326358
"tickris": ("`","`"),
327359
"prekris": ("(",")"),
@@ -362,4 +394,5 @@ class PythonVoiceCodingPluginRule(MappingRule):
362394

363395

364396
def get_rule():
365-
return PythonVoiceCodingPluginRule, RuleDetails(name="python voice coding plugin", executable="sublime_text", title="Sublime Text")
397+
# return PythonVoiceCodingPluginRule, RuleDetails(name="python voice coding plugin", executable="sublime_text", title="Sublime Text")
398+
return PythonVoiceCodingPluginRule, RuleDetails(name="develop plugin", executable=["sublime_text","VirtualBox"])

doc/SelectBigROI.md

+1-10
Original file line numberDiff line numberDiff line change
@@ -108,20 +108,11 @@ Choice("big_roi",{
108108

109109
# "same":"same",
110110

111-
# "string" : "string",
112-
# "integer literal" : "integer literal",
113-
# "dictionary" : "dictionary",
114-
# "list" : "list",
115-
# "tuple" : "tuple",
116-
# "set" : "set",
117-
# "key" : "key",
118-
119-
120111
}
121112
)
122113
```
123114

124-
As a final note,there is also a commented line and an entire commented block separated by an empty line, about which we are going to talk [later](#experimental-same) and [later](#temporary-until-small-regions) respectively.
115+
As a final note,there is also a commented line and an entire commented block(not shown here) separated by an empty line, about which we are going to talk [later](#experimental-same) and [later](#temporary-until-small-regions) respectively.
125116

126117
Moving on the full syntax, looks like
127118

0 commit comments

Comments
 (0)