Christopher Pross, il 18/05/2020 14.33, ha scritto:
a short question, it is possible to do some tasks while add-on installations?Alberto:
yes, there is onInstall() function, called during add-on installation. It must be contained in installTasks.py, that must be located in add-on root directory (where is manifest.ini, to be clear).
There is onUninstall() too.
I need to register a python package in the python enviroment from nvda for my current project. and I don't know how to do that, while the add-on installing.Alberto:
hmm, what you mean exactly with "register a python package"?
Because you cannot (you should not) register a package in strict and static sense. The thing usually done is:
- include the package sources/binaries in a folder called "mypackage" (for example);
- put this folder in a folder called "lib" (for example) in add-on root directory;
- where necessary, do:
libPath = os.path.join(os.path.dirname(__file__), "..", "lib")
...your code using mypackage...
At my knowledge, this should be the better organized and most secure way.