Re: A global plugin problem


Travis Roth
 

I think this changed in python3 and I usually have to mess around until it works. I don’t know the directory structure you have, but for something like

\addon\appModules\appllicationName

 

If you then have __init__.py and myModule.py and myFunctions.py you need to tell it to look in the current directory for other files in that folder such as

import .myModule

from .myFunctions import makeBraille, makeSpeech

 

From: nvda-addons@nvda-addons.groups.io <nvda-addons@nvda-addons.groups.io> On Behalf Of Ken Perry
Sent: Friday, January 14, 2022 8:27 PM
To: nvda-addons@groups.io
Subject: [nvda-addons] A global plugin problem

 

I have an old global plug in for before NVDA was switched to  3.x   It worked fine and I have fixed all the problems that have to do with the difference in python types.

 

Here is the problem I have several python files in the global plugin.  The

 

__init__.py file has an import like this:

 

Import myclass

 

Then there is a file in the same folder

 

Myclass.py

 

 

The global plugin can not find the file I am importing.  It used to work fine is there some new thing I have to do to let the global plugin know where my other classes are? Note I have my global plugin in a folder like myplugin under the developer scratchpad folder and I know it is at least being found because if I take the class I am importing out the key press works fine and presents the message I want it to.     In the log though it says it can’t find myclass module.

 

Ken

 

Join nvda-addons@nvda-addons.groups.io to automatically receive all group messages.