Skip to content

Commit

Permalink
Fix version, restore new private windows (#30)
Browse files Browse the repository at this point in the history
* version stuff corrected

* add diagnostics

* added notes about our fork vs the other fork

* useful extensions

* restored private window, edge now works
  • Loading branch information
dougransom authored Dec 9, 2024
1 parent 17aef4e commit 841f88f
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 2 deletions.
9 changes: 9 additions & 0 deletions .vscode/extensions.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{ "recommendations": [
"tamasfe.even-better-toml",
"github.vscode-github-actions",
"ms-python.vscode-pylance",
"ms-python.python",
"ms-python.debugpy",
"charliermarsh.ruff",
"eamodio.gitlens" ]
}
14 changes: 14 additions & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,14 @@ Features:
Complete documentation can be found at the <a
href="http://vocola.net/">Vocola website</a>.

**Note. This version in https://github.com/dictation-toolbox/Vocola2 is a fork of an older Vocola 2.8.6 that
was ported to Python 3 by developers who wanted to use it with Python 3 around 2020.** We made the effort to
package Vocola, so it can be installed with pip both from PyPi, github, or as an editable install, and use the logging facility of Python to log messages to the Natlink message window. We have been using increasing version numbers 3.x to mark progress.


In the meantime, maintainers of the Vocola project have advanced Vocola using the 2.x version numbers. If you are desiring the features 2.8.7 or later highlighted on
https://vocola.net/v2/VocolaVersions, be sure to install Vocola using the directions on that page. Be sure to uninstall any version of Vocola you have installed with pip first.


## Examples

Expand Down Expand Up @@ -134,3 +142,9 @@ MIT (see LICENSE.txt)
sample commands installed with Vocolas2 will be installed in:
the Lib\site-packages\vocola2\samples subfolder of your
Python installation. Good ones to start with include msedge.vcl for sending commands to Microsoft Edge.

If you want to use any of these samples, you have to copy them to the Vocola user directory specified in natlink.ini in the vocola section:
```
[vocola]
vocolauserdirectory = ~\Documents\vocola_yourname
```
2 changes: 2 additions & 0 deletions src/vocola2/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
"""Vocola"""

#version number now in project.toml
import importlib.metadata
__version__ = importlib.metadata.version(__package__) #version set in pyproject.toml now.

"""utility functions, to get calling directory of module (in site-packages),
Expand Down
4 changes: 3 additions & 1 deletion src/vocola2/_vocola_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,17 +76,19 @@

## when natlinkmain is already there, the Logger and Config variables are ignored...
Logger = logging.getLogger('natlink')
Logger.debug(f'checking if Vocola is enabled')
Config = config.NatlinkConfig.from_first_found_file(loader.config_locations())
natlinkmain = loader.NatlinkMain(Logger, Config)
# natlinkmain.setup_logger()

# print('status: %s'% status)
VocolaEnabled = bool(status.getVocolaUserDirectory())
print(f'VocolaEnabled: {VocolaEnabled}')
Logger.info(f'VocolaEnabled: {VocolaEnabled}')
if VocolaEnabled:
VocolaGrammarsDirectory = status.getVocolaGrammarsDirectory()
VocolaUserDirectory = status.getVocolaUserDirectory()
VocolaDirectory = status.getVocolaDirectory()
Logger.debug(f"VocolaGrammarsDirectory: {VocolaGrammarsDirectory}\nVocolaUserDirectory: {VocolaUserDirectory}\nVocolaDirectory: {VocolaDirectory}")
if not os.path.isdir(VocolaUserDirectory):
raise OSError(f'VocolaUserDirectory does not exist, please create: "{VocolaUserDirectory}, or re-configure Natlink.')
if not os.path.isdir(VocolaGrammarsDirectory):
Expand Down
2 changes: 1 addition & 1 deletion src/vocola2/samples/msedge.vcl
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ show history = {Ctrl+h};
show downloads = {Ctrl+j};
reload = {Ctrl+r};
paste and go = {Ctrl+Shift+l};
#private window = {Ctrl+Shift+n}; #not working in Version 81.0.416.77 (Official build) (64-bit)
private window = {Ctrl+Shift+n};

#searching within the page
find <_anything> = {Ctrl+f} $1;
Expand Down

0 comments on commit 841f88f

Please sign in to comment.