dictation-toolbox / dragonfly

Speech recognition framework allowing powerful Python-based scripting and extension of Dragon NaturallySpeaking (DNS), Windows Speech Recognition (WSR), Kaldi and CMU Pocket Sphinx
GNU Lesser General Public License v3.0
383 stars 75 forks source link

Update natlink import namespacing #354

Open MarkRx opened 3 years ago

MarkRx commented 3 years ago

Now that natlink is a module that can be installed with pip it has namespacing. References need to be updated to use the proper namespacing.

from natlinkcore import natlink

example

drmfinlay commented 3 years ago

I'll make the necessary changes.

As I have said elsewhere, Python 2.7 support will not be dropped for core features or for most of the SR engine back-ends, including the one for Natlink. Dragonfly will continue to support the way this was done in previous versions of Natlink, e.g. version 4.2.

drmfinlay commented 2 years ago

It seems that the NatlinkModule/init.py file was changed to import everything from natlinkcore in October. This issue is out of date.

quintijn commented 2 years ago

sorry to read this only now. The calling of natlink functions (from the .pyd file, like execScript, playString etc) and the calling of the modules like loader and natlinkstatus may need another change, as we are still experimenting with the most clear procedure.

drmfinlay commented 2 years ago

That's all right, Quintijn. I am sorry to only reply to your comment today.

I have updated the procedures that use the natlinkstatus module. Dragonfly will attempt to import this module with the following incantations (in order):

  1. import natlinkstatus
  2. from natlinkcore import natlinkstatus

As we have discussed privately, no changes will be necessary to use the natlink ext. module, so what I've done should allow the library to work with older and newer versions of Natlink. The changes will be available in the next Dragonfly release version. I'll leave this issue open until then.