NatLink For Python 2.5
This version of NatLink will work with Python 2.5; the previous version of NatLink worked with Python versions up to 2.3, but there have been significant changes to Python since then. I have been running this version with Python 2.5.2 since late spring 2008 without problems. A few notes:
- This is a plain vanilla NatLink distribution; it does not include Vocola or any other NatLink add-ons. It is very similar to Joel Gould's original NatLink zip package; I have merely updated it to Python 2.5 and cleaned a few things up.
- I have done something long overdue and put EnableNL out of its misery...
- On startup, this version prints out an initialization message with the Python version it is using to the messages window.
- This package does not include a fancy installer, however it does come with...
enable.py
It has long bothered me that the only installation options for NatLink—a Python voice interface system—have been one of
- editing the registry and configuration file settings by hand
- casting vain hopes upon a rickety C++ GUI
- using the enormous .NET installer with all of its (for me unwanted) extras
After grumbling about it to my long-suffering wife and scratching my head in perplexity for a while, I finally realized that no one else was going to write a Python script to enable NatLink, so if I wanted one I'd better get to the business of writing it.
enable.py is a commandline Python script to enable/disable the NatLink Python extension to Dragon NaturallySpeaking. The script automates the process of adding/removing the appropriate NatLink config entries in the Windows registry and NaturallySpeaking configuration files. Note that it is not an installer, so it will not create entries in the Control Panel's Add/Remove Programs applet nor will it unpack anything for you; think of it more as a much needed replacement for EnableNL. That said, the installation process is fairly straightforward...
Installing NatLink with enable.py
- Make sure you have the Python for Windows extensions installed. An easy way to check if it is installed is to look for the PythonWin program (Start -> All Programs -> Python 2.5 -> PythonWin on my Windows XP system). If you don't already have it, download the installer package for your version of Python, double-click the file to run the installer, and step through the install wizard's prompts (the defaults should be fine).
- Unzip NatLink to your favorite directory, e.g. C:\Program Files\NatLink. If you already have a previous NatLink installation you want to disable/enable, copy the script to that directory.
- Run enable.py, preferably from the command shell so you can see any messages from the script. (enable.py /u uninstalls)
The script will attempt to detect your NatLink installation path, Dragon NaturallySpeaking, and Python. I have personally tested with Python versions 2.3 and 2.5 and Dragon versions 8 and 9, but it should work with Dragon versions 6 and 7 (and perhaps some versions in the 5 series) and probably any Python in the 2.0 series. It is profusely documented, so poke around in the code if you are curious about the voodoo that makes Python talk to NatLink talk to NaturallySpeaking.
Updates
September 29, 2008: I've made two significant updates to the enable script:
Jonathan Epstein uncovered a bug in the Python version selection code that caused the script to fail if more than one version of Python was installed.
The method used to update the Python path has changed. The original EnableNL program and the first version of this script used the Windows registry to set the path. Instead, the updated enable script takes advantage of Python's site module by adding path information to a text file in the site-packages directory. This approach should be easier to maintain and seems more, well, "Pythonic" than using the registry. Thanks to Speech Computing/Voice Code list user Reckoner for leading me to this simpler solution.
The script's previous behavior has been preserved and can be accessed using the commandline options /ir and /ur ("install registry" and "uninstall registry").
|