Skip to content

Commit 85eac9e

Browse files
authored
Merge pull request #16 from mpourmpoulis/develop-0.1.0
Massive blunder 0.1.2
2 parents 8a6942c + ebaca59 commit 85eac9e

14 files changed

+258
-32
lines changed

CHANGELOG.md

+10
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,15 @@
11
# Changelog
22

3+
## [0.1.2]
4+
5+
### Added
6+
7+
- Utility to automatically upgrade scripts in the preferences menu
8+
9+
### Fixed
10+
11+
- Fixed the massive subl blunder
12+
313

414
## [0.1.1]
515

Main.sublime-menu

+7-1
Original file line numberDiff line numberDiff line change
@@ -122,15 +122,21 @@
122122

123123
},
124124
{
125-
"caption": "Grammar Installation",
125+
"caption": "Grammar Installation Doc",
126126
"command": "open_url",
127127
"args":{
128128
"url": "https://github.com/mpourmpoulis/PythonVoiceCodingPlugin/blob/master/bundles/README.md"
129129
}
130+
},
131+
{
132+
"caption": "Quick 1.0.0 Installation",
133+
"command": "quick_install_python_voice_coding_plugin",
134+
"args":{}
130135
}
131136

132137

133138

139+
134140
]
135141
}
136142
]

README.md

+64-15
Original file line numberDiff line numberDiff line change
@@ -29,9 +29,12 @@ when coding python 3 by voice. It ships with an integrated [Caster](https://git
2929

3030
In case you have never heard about voice programming before, you should definitely check out [Caster](https://caster.readthedocs.io/en/latest/), [dragonfly](https://dragonfly2.readthedocs.io/en/latest/introduction.html) and [Talon](https://talonvoice.com/).
3131

32+
CRITICAL UPDATE: My sincerest apologies but up to release 0.1.1 a subtle yet critical installation step was not documented, which may have prevented you from using the plug-in altogether! You can find more information [here](https://github.com/mpourmpoulis/PythonVoiceCodingPlugin/issues/15) but release 0.1.2 should make that installation step redundant for most users, so simply upgrading and [replacing the grammar files](https://github.com/mpourmpoulis/PythonVoiceCodingPlugin/issues/14) should be enough without any further action on your part! Many thanks to LexiconCode for pointing this out!
33+
3234
![](doc/gif/big37.gif)
3335

3436

37+
3538
## Contents
3639

3740
<!-- MarkdownTOC autolink="true" -->
@@ -41,9 +44,12 @@ In case you have never heard about voice programming before, you should definite
4144
- [Release and Version](#release-and-version)
4245
- [Limitations](#limitations)
4346
- [Installation](#installation)
44-
- [Package Control](#package-control)
45-
- [note for those who installed between 0.0.4 and 0.0.5](#note-for-those-who-installed-between-004-and-005)
46-
- [Git Install](#git-install)
47+
- [Install the main plugin](#install-the-main-plugin)
48+
- [Package Control](#package-control)
49+
- [Note for those who installed between 0.0.4 and 0.0.5](#note-for-those-who-installed-between-004-and-005)
50+
- [Git Install](#git-install)
51+
- [Install Grammar](#install-grammar)
52+
- [Subl Path](#subl-path)
4753
- [Support for voice coding framework](#support-for-voice-coding-framework)
4854
- [License](#license)
4955
- [Dependencies](#dependencies)
@@ -118,7 +124,7 @@ Needless to say, while coding PythonVoiceCodingPlugin , PythonVoiceCodingPlugin
118124

119125
The code is available on [github](https://github.com/mpourmpoulis/PythonVoiceCodingPlugin)
120126

121-
The latest release is 0.1.0!
127+
The latest release is 0.1.2!
122128

123129

124130
## Limitations
@@ -134,17 +140,25 @@ There are of course certain limitations which I would like to make clear from th
134140

135141
## Installation
136142

137-
In order to install, you must install both the plugging as well as the corresponding [grammar](bundles/README.md).
143+
As this is a two-part system, in order to install, you must
144+
145+
- install the main plugin
146+
147+
- install the corresponding [grammar](bundles/README.md) for the version of caster you are using
148+
149+
- put the `subl` executable which enables the communication of those two into the Windows path(from 0.1.2 and above optionally)
150+
138151

152+
### Install the main plugin
139153

140-
There are currently two installation methods for performing the first task
154+
There are currently two installation (Package Control and git) methods for performing the first task,I highly recommend using Package Control.
141155

142156

143-
### Package Control
157+
#### Package Control
144158

145-
Release 0.0.5 fixed the errors that prevented 0.0.4 from installing directly from package control. You can now install the package simply by
159+
- Firstly make sure you have Package Control installed. If not, please follow the instructions [here](https://packagecontrol.io/installation)
146160

147-
- open Command Palette
161+
- open Command Palette(Control+Shift+P)
148162

149163
- execute
150164

@@ -160,7 +174,7 @@ PythonVoiceCodingPlugin
160174

161175

162176

163-
#### note for those who installed between 0.0.4 and 0.0.5
177+
##### Note for those who installed between 0.0.4 and 0.0.5
164178

165179
previously the installation of plug-in included running
166180

@@ -178,6 +192,7 @@ https://github.com/mpourmpoulis/PythonVoiceCodingPlugin
178192
which enabled you to install directly from a master branch rather than my releases and you should be seing a fake version like v2020.01.05.( and so on ) instead of v0.0.4.
179193

180194
This was only temporary solution and I recommend that you ran
195+
181196
```
182197
Package Control:Remove Repository
183198
```
@@ -194,9 +209,9 @@ For any further installation questions, feel free to ask [here](https://github.c
194209

195210

196211

197-
### Git Install
212+
#### Git Install
198213

199-
Currently you can download the plugin directly from github and place it in sublime package folder
214+
Alternatively you can download the plugin directly from github and place it in sublime package folder
200215

201216
for windows users this should be:
202217

@@ -209,16 +224,50 @@ and on Ubuntu it is :
209224
~/.config/sublime-text-3/Packages/
210225
```
211226

212-
Currently the Master Branch and the releases 0.0.5 ships with its dependencies so the next step is not really necessary.
227+
Currently the Master Branch ships with its dependencies so you're good to go!
228+
229+
Just in case something is wrong and you want to manually install dependencies,using your installation of python (this worked for me with 3.7.4 and 3.5.2) run from inside the plug-in folder (PythonVoiceCodingPlugin):
213230

214-
To install dependencies,using your installation of python (this worked for me with 3.7.4 and 3.5.2) run from inside the plug-in folder (PythonVoiceCodingPlugin):
215231
```bash
216232
python3 -m pip install --target third_party -r requirements.txt
217233
```
218234

219235

236+
### Install Grammar
237+
238+
Furthermore, in order to use the plug-in, you must also install the grammar! You can find additional information [here](bundles/Caster/README.md) if you intend to use this on Linux via [Aenea](bundles/Aenea/README.md) you will need a few extra steps but in a nutshell:
239+
240+
- Make sure you have [Caster](https://caster.readthedocs.io/en/latest/) installed
241+
242+
- Copy the grammar files to the appropriate user directory,depending on the version of caster these should be either `C:\Users\%USERNAME%\AppData\Local\caster\rules` or `C:\Users\%USERNAME%\.caster\rules
243+
`
244+
245+
- Reboot/launch Caster and if you are using 1.0 and above do not forget to enable the rule by saying `enable python voice coding plugin`
246+
247+
in order to make this process easier, under `Preferences > Package Settings > PythonVoiceCodingPlugin
248+
` you will find utilities
249+
250+
- To retrieve those grammar files and then manually copy paste them
251+
252+
![](doc/gif/install1.gif)
253+
254+
- or to automatically install them to the appropriate directory if you are using Caster 1.x.x
255+
256+
![](doc/gif/install2.gif)
257+
258+
### Subl Path
259+
260+
The communication between the main plugin and the grammar happens via the sublime command line interface through the `subl` executable. Up to and including version 0.1.1, it was expected that this executable is in your Windows path but as pointed out by LexiconCode the corresponding documentation was missing! these was a big blunder on my part and may have prevented you from using the project altogether!
261+
262+
now you can find more information about how you can add this executable to the Windows path [here](https://stackoverflow.com/questions/9440639/sublime-text-from-command-line), but in order to work around this issue without adding an additional installation step for you, release 0.1.2 implements the following scheme:
263+
264+
* If `subl` is already in the path, it will use normally
265+
266+
* Otherwise, it will try to fall back to `C:\Program Files\Sublime Text 3\subl` which is where it should be if you have installed sublime in the classical way! In such a case, no extra steps are needed on your part!
220267

268+
if sublime is installed in another directory, you must unfortunately add it to the path yourself!
221269

270+
Please note that this does not affect Linux!
222271

223272

224273
## Support for voice coding framework
@@ -338,7 +387,7 @@ also some of the other tools I found useful developing this project
338387

339388
Last but not least many things to
340389

341-
* LexiconCode, for porting the grammar from 0.5 to 0.6 and 1.0 versions of Caster
390+
* LexiconCode, for porting the grammar from 0.5 to 0.6 and 1.0 versions of Caster and pointing out the missing documentation for putting the `subl` utility in the path.
342391

343392
* FichteFoll, for pointing out various errors during package review
344393

bundles/Caster/python_voice_coding_plugin_caster_v0-5-11.py

+28-4
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111

1212

1313
#########################################################################################
14-
14+
import json
1515
import os
16+
import platform
1617
import subprocess
17-
import json
1818

1919
#########################################################################################
2020

@@ -37,7 +37,7 @@
3737

3838
#########################################################################################
3939

40-
GRAMMAR_VERSION = (0,1,1)
40+
GRAMMAR_VERSION = (0,1,2)
4141

4242
#########################################################################################
4343

@@ -49,10 +49,34 @@ def create_arguments(command,format,**kwargs):
4949
return {"arg":p}
5050

5151

52+
53+
def validate_subl():
54+
if platform.system() != 'Windows':
55+
return "subl"
56+
try:
57+
subprocess.check_call(["subl", "-h"],stdout=subprocess.PIPE,stderr=subprocess.PIPE) # For testing purposes you can invalidate to trigger failure
58+
return "subl"
59+
except Exception as e:
60+
try :
61+
subprocess.check_call(["C:\\Program Files\\Sublime Text 3\\subl", "-h"],stdout=subprocess.PIPE,stderr=subprocess.PIPE)
62+
print("Resorting to C:\\Program Files\\Sublime Text 3\\subl.exe")
63+
return "C:\\Program Files\\Sublime Text 3\\subl"
64+
except :
65+
print("Sublime Text 3 `subl` executable was not in the Windows path")
66+
if not os.path.isdir(r'C:\\Program Files\\Sublime Text 3'):
67+
print("And there is no C:\\Program Files\\Sublime Text 3 directory to fall back to!")
68+
else:
69+
print("And it was not found under C:\\Program Files\\Sublime Text 3")
70+
print("Please add `subl` to the path manually")
71+
return "subl"
72+
73+
subl = validate_subl()
74+
75+
5276
def send_sublime(c,data):
5377
if local_settings["show_command"]:
5478
print(c + " " + json.dumps(data))
55-
subprocess.Popen(["subl","-b", "--command",c + " " + json.dumps(data)],creationflags = 0x08000000)
79+
RunCommand([subl,"-b", "--command",c + " " + json.dumps(data)],synchronous = True).execute()
5680

5781
def noob_send(command,format,**kwargs):
5882
data = create_arguments(command,format,**kwargs)

bundles/Caster/python_voice_coding_plugin_caster_v0-6-11.py

+28-4
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@
1111

1212

1313
#########################################################################################
14-
14+
import json
1515
import os
16+
import platform
1617
import subprocess
17-
import json
1818

1919
#########################################################################################
2020

@@ -37,7 +37,7 @@
3737

3838
#########################################################################################
3939

40-
GRAMMAR_VERSION = (0,1,1)
40+
GRAMMAR_VERSION = (0,1,2)
4141

4242
#########################################################################################
4343

@@ -49,10 +49,34 @@ def create_arguments(command,format,**kwargs):
4949
return {"arg":p}
5050

5151

52+
53+
def validate_subl():
54+
if platform.system() != 'Windows':
55+
return "subl"
56+
try:
57+
subprocess.check_call(["subl", "-h"],stdout=subprocess.PIPE,stderr=subprocess.PIPE) # For testing purposes you can invalidate to trigger failure
58+
return "subl"
59+
except Exception as e:
60+
try :
61+
subprocess.check_call(["C:\\Program Files\\Sublime Text 3\\subl", "-h"],stdout=subprocess.PIPE,stderr=subprocess.PIPE)
62+
print("Resorting to C:\\Program Files\\Sublime Text 3\\subl.exe")
63+
return "C:\\Program Files\\Sublime Text 3\\subl"
64+
except :
65+
print("Sublime Text 3 `subl` executable was not in the Windows path")
66+
if not os.path.isdir(r'C:\\Program Files\\Sublime Text 3'):
67+
print("And there is no C:\\Program Files\\Sublime Text 3 directory to fall back to!")
68+
else:
69+
print("And it was not found under C:\\Program Files\\Sublime Text 3")
70+
print("Please add `subl` to the path manually")
71+
return "subl"
72+
73+
subl = validate_subl()
74+
75+
5276
def send_sublime(c,data):
5377
if local_settings["show_command"]:
5478
print(c + " " + json.dumps(data))
55-
RunCommand(["subl","-b", "--command",c + " " + json.dumps(data)],synchronous = True).execute()
79+
RunCommand([subl,"-b", "--command",c + " " + json.dumps(data)],synchronous = True).execute()
5680

5781
def noob_send(command,format,**kwargs):
5882
data = create_arguments(command,format,**kwargs)

bundles/Caster/python_voice_coding_plugin_caster_v1-0-0.py

+28-3
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,10 @@
1111

1212
#########################################################################################
1313

14+
import json
1415
import os
16+
import platform
1517
import subprocess
16-
import json
1718

1819
#########################################################################################
1920

@@ -36,7 +37,7 @@
3637

3738
#########################################################################################
3839

39-
GRAMMAR_VERSION = (0,1,1)
40+
GRAMMAR_VERSION = (0,1,2)
4041

4142
#########################################################################################
4243

@@ -48,10 +49,34 @@ def create_arguments(command,format,**kwargs):
4849
return {"arg":p}
4950

5051

52+
53+
def validate_subl():
54+
if platform.system() != 'Windows':
55+
return "subl"
56+
try:
57+
subprocess.check_call(["subl", "-h"],stdout=subprocess.PIPE,stderr=subprocess.PIPE) # For testing purposes you can invalidate to trigger failure
58+
return "subl"
59+
except Exception as e:
60+
try :
61+
subprocess.check_call(["C:\\Program Files\\Sublime Text 3\\subl", "-h"],stdout=subprocess.PIPE,stderr=subprocess.PIPE)
62+
print("Resorting to C:\\Program Files\\Sublime Text 3\\subl.exe")
63+
return "C:\\Program Files\\Sublime Text 3\\subl"
64+
except :
65+
print("Sublime Text 3 `subl` executable was not in the Windows path")
66+
if not os.path.isdir(r'C:\\Program Files\\Sublime Text 3'):
67+
print("And there is no C:\\Program Files\\Sublime Text 3 directory to fall back to!")
68+
else:
69+
print("And it was not found under C:\\Program Files\\Sublime Text 3")
70+
print("Please add `subl` to the path manually")
71+
return "subl"
72+
73+
subl = validate_subl()
74+
75+
5176
def send_sublime(c,data):
5277
if local_settings["show_command"]:
5378
print(c + " " + json.dumps(data))
54-
RunCommand(["subl","-b", "--command",c + " " + json.dumps(data)],synchronous = True).execute()
79+
RunCommand([subl,"-b", "--command",c + " " + json.dumps(data)],synchronous = True).execute()
5580

5681

5782
def noob_send(command,format,**kwargs):

doc/gif/install1.gif

346 KB
Loading

doc/gif/install2.gif

311 KB
Loading

messages.json

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
{
22
"0.1.0": "messages/0.1.0.txt",
33
"0.1.1": "messages/0.1.1.txt",
4+
"0.1.2": "messages/0.1.2.txt",
45
"install": "messages/install.txt"
56
}

messages/0.1.2.txt

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
=====================
2+
CRITICAL UPDATE
3+
=====================
4+
5+
My sincerest apologies but up to release 0.1.1 a subtle yet critical installation step was not documented, which may have prevented you from using the plug-in altogether!
6+
7+
You can find more information at https://github.com/mpourmpoulis/PythonVoiceCodingPlugin/issues/15 but release 0.1.2 should make that installation step redundant for most users, so SIMPLY UPGRADING and replacing the grammar files should be enough without any further action on your part!
8+
9+
In order to rapidly upgrade your grammars, if you are using Caster 1.x.x under
10+
11+
Preferences > Package Settings > PythonVoiceCodingPlugin
12+
13+
You will find
14+
15+
Quick 1.0.0 Install
16+
17+
More information https://github.com/mpourmpoulis/PythonVoiceCodingPlugin/issues/14
18+
19+
Many thanks to LexiconCode for pointing this massive blunder out and once again I am deeply sorry!

0 commit comments

Comments
 (0)