Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# Changelog

## [0.1.2]

### Added

- Utility to automatically upgrade scripts in the preferences menu

### Fixed

- Fixed the massive subl blunder


## [0.1.1]

Expand Down
8 changes: 7 additions & 1 deletion Main.sublime-menu
Original file line number Diff line number Diff line change
Expand Up @@ -122,15 +122,21 @@

},
{
"caption": "Grammar Installation",
"caption": "Grammar Installation Doc",
"command": "open_url",
"args":{
"url": "https://github.com/mpourmpoulis/PythonVoiceCodingPlugin/blob/master/bundles/README.md"
}
},
{
"caption": "Quick 1.0.0 Installation",
"command": "quick_install_python_voice_coding_plugin",
"args":{}
}




]
}
]
Expand Down
79 changes: 64 additions & 15 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,9 +29,12 @@ when coding python 3 by voice. It ships with an integrated [Caster](https://git

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/).

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!

![](doc/gif/big37.gif)



## Contents

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

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

The latest release is 0.1.0!
The latest release is 0.1.2!


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

## Installation

In order to install, you must install both the plugging as well as the corresponding [grammar](bundles/README.md).
As this is a two-part system, in order to install, you must

- install the main plugin

- install the corresponding [grammar](bundles/README.md) for the version of caster you are using

- put the `subl` executable which enables the communication of those two into the Windows path(from 0.1.2 and above optionally)


### Install the main plugin

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


### Package Control
#### Package Control

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
- Firstly make sure you have Package Control installed. If not, please follow the instructions [here](https://packagecontrol.io/installation)

- open Command Palette
- open Command Palette(Control+Shift+P)

- execute

Expand All @@ -160,7 +174,7 @@ PythonVoiceCodingPlugin



#### note for those who installed between 0.0.4 and 0.0.5
##### Note for those who installed between 0.0.4 and 0.0.5

previously the installation of plug-in included running

Expand All @@ -178,6 +192,7 @@ https://github.com/mpourmpoulis/PythonVoiceCodingPlugin
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.

This was only temporary solution and I recommend that you ran

```
Package Control:Remove Repository
```
Expand All @@ -194,9 +209,9 @@ For any further installation questions, feel free to ask [here](https://github.c



### Git Install
#### Git Install

Currently you can download the plugin directly from github and place it in sublime package folder
Alternatively you can download the plugin directly from github and place it in sublime package folder

for windows users this should be:

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

Currently the Master Branch and the releases 0.0.5 ships with its dependencies so the next step is not really necessary.
Currently the Master Branch ships with its dependencies so you're good to go!

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):

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):
```bash
python3 -m pip install --target third_party -r requirements.txt
```


### Install Grammar

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:

- Make sure you have [Caster](https://caster.readthedocs.io/en/latest/) installed

- 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
`

- 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`

in order to make this process easier, under `Preferences > Package Settings > PythonVoiceCodingPlugin
` you will find utilities

- To retrieve those grammar files and then manually copy paste them

![](doc/gif/install1.gif)

- or to automatically install them to the appropriate directory if you are using Caster 1.x.x

![](doc/gif/install2.gif)

### Subl Path

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!

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:

* If `subl` is already in the path, it will use normally

* 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!

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

Please note that this does not affect Linux!


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

Last but not least many things to

* LexiconCode, for porting the grammar from 0.5 to 0.6 and 1.0 versions of Caster
* 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.

* FichteFoll, for pointing out various errors during package review

Expand Down
32 changes: 28 additions & 4 deletions bundles/Caster/python_voice_coding_plugin_caster_v0-5-11.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@


#########################################################################################

import json
import os
import platform
import subprocess
import json

#########################################################################################

Expand All @@ -37,7 +37,7 @@

#########################################################################################

GRAMMAR_VERSION = (0,1,1)
GRAMMAR_VERSION = (0,1,2)

#########################################################################################

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



def validate_subl():
if platform.system() != 'Windows':
return "subl"
try:
subprocess.check_call(["subl", "-h"],stdout=subprocess.PIPE,stderr=subprocess.PIPE) # For testing purposes you can invalidate to trigger failure
return "subl"
except Exception as e:
try :
subprocess.check_call(["C:\\Program Files\\Sublime Text 3\\subl", "-h"],stdout=subprocess.PIPE,stderr=subprocess.PIPE)
print("Resorting to C:\\Program Files\\Sublime Text 3\\subl.exe")
return "C:\\Program Files\\Sublime Text 3\\subl"
except :
print("Sublime Text 3 `subl` executable was not in the Windows path")
if not os.path.isdir(r'C:\\Program Files\\Sublime Text 3'):
print("And there is no C:\\Program Files\\Sublime Text 3 directory to fall back to!")
else:
print("And it was not found under C:\\Program Files\\Sublime Text 3")
print("Please add `subl` to the path manually")
return "subl"

subl = validate_subl()


def send_sublime(c,data):
if local_settings["show_command"]:
print(c + " " + json.dumps(data))
subprocess.Popen(["subl","-b", "--command",c + " " + json.dumps(data)],creationflags = 0x08000000)
RunCommand([subl,"-b", "--command",c + " " + json.dumps(data)],synchronous = True).execute()

def noob_send(command,format,**kwargs):
data = create_arguments(command,format,**kwargs)
Expand Down
32 changes: 28 additions & 4 deletions bundles/Caster/python_voice_coding_plugin_caster_v0-6-11.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@


#########################################################################################

import json
import os
import platform
import subprocess
import json

#########################################################################################

Expand All @@ -37,7 +37,7 @@

#########################################################################################

GRAMMAR_VERSION = (0,1,1)
GRAMMAR_VERSION = (0,1,2)

#########################################################################################

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



def validate_subl():
if platform.system() != 'Windows':
return "subl"
try:
subprocess.check_call(["subl", "-h"],stdout=subprocess.PIPE,stderr=subprocess.PIPE) # For testing purposes you can invalidate to trigger failure
return "subl"
except Exception as e:
try :
subprocess.check_call(["C:\\Program Files\\Sublime Text 3\\subl", "-h"],stdout=subprocess.PIPE,stderr=subprocess.PIPE)
print("Resorting to C:\\Program Files\\Sublime Text 3\\subl.exe")
return "C:\\Program Files\\Sublime Text 3\\subl"
except :
print("Sublime Text 3 `subl` executable was not in the Windows path")
if not os.path.isdir(r'C:\\Program Files\\Sublime Text 3'):
print("And there is no C:\\Program Files\\Sublime Text 3 directory to fall back to!")
else:
print("And it was not found under C:\\Program Files\\Sublime Text 3")
print("Please add `subl` to the path manually")
return "subl"

subl = validate_subl()


def send_sublime(c,data):
if local_settings["show_command"]:
print(c + " " + json.dumps(data))
RunCommand(["subl","-b", "--command",c + " " + json.dumps(data)],synchronous = True).execute()
RunCommand([subl,"-b", "--command",c + " " + json.dumps(data)],synchronous = True).execute()

def noob_send(command,format,**kwargs):
data = create_arguments(command,format,**kwargs)
Expand Down
31 changes: 28 additions & 3 deletions bundles/Caster/python_voice_coding_plugin_caster_v1-0-0.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@

#########################################################################################

import json
import os
import platform
import subprocess
import json

#########################################################################################

Expand All @@ -36,7 +37,7 @@

#########################################################################################

GRAMMAR_VERSION = (0,1,1)
GRAMMAR_VERSION = (0,1,2)

#########################################################################################

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



def validate_subl():
if platform.system() != 'Windows':
return "subl"
try:
subprocess.check_call(["subl", "-h"],stdout=subprocess.PIPE,stderr=subprocess.PIPE) # For testing purposes you can invalidate to trigger failure
return "subl"
except Exception as e:
try :
subprocess.check_call(["C:\\Program Files\\Sublime Text 3\\subl", "-h"],stdout=subprocess.PIPE,stderr=subprocess.PIPE)
print("Resorting to C:\\Program Files\\Sublime Text 3\\subl.exe")
return "C:\\Program Files\\Sublime Text 3\\subl"
except :
print("Sublime Text 3 `subl` executable was not in the Windows path")
if not os.path.isdir(r'C:\\Program Files\\Sublime Text 3'):
print("And there is no C:\\Program Files\\Sublime Text 3 directory to fall back to!")
else:
print("And it was not found under C:\\Program Files\\Sublime Text 3")
print("Please add `subl` to the path manually")
return "subl"

subl = validate_subl()


def send_sublime(c,data):
if local_settings["show_command"]:
print(c + " " + json.dumps(data))
RunCommand(["subl","-b", "--command",c + " " + json.dumps(data)],synchronous = True).execute()
RunCommand([subl,"-b", "--command",c + " " + json.dumps(data)],synchronous = True).execute()


def noob_send(command,format,**kwargs):
Expand Down
Binary file added doc/gif/install1.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added doc/gif/install2.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions messages.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"0.1.0": "messages/0.1.0.txt",
"0.1.1": "messages/0.1.1.txt",
"0.1.2": "messages/0.1.2.txt",
"install": "messages/install.txt"
}
19 changes: 19 additions & 0 deletions messages/0.1.2.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
=====================
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 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!

In order to rapidly upgrade your grammars, if you are using Caster 1.x.x under

Preferences > Package Settings > PythonVoiceCodingPlugin

You will find

Quick 1.0.0 Install

More information https://github.com/mpourmpoulis/PythonVoiceCodingPlugin/issues/14

Many thanks to LexiconCode for pointing this massive blunder out and once again I am deeply sorry!
Loading