Extension run on LibreOffice startup?
Is it possible to have an extension run python code on start of LibreOffice without any extra configuration?
My goal to to write and extension that contains a python module that also includes sub-modules.
This would be for the OooDev module.
I am envisioning users being able to write/run macros using OooDev
by simply importing as if the ooo-dev-tools
was pip installed.
# example import in macro
from ooodev.utils.lo import Lo
from ooodev.office.calc import Calc
...
I know that the ooo-dev-tools
package can be pip installed, I wrote some guides on this. However, it is not always reliable and more confusing to end user then installing an extension.
What I need to do is to have an extension include itself on the python path when LibreOffice starts.
I noticed that the MRI and the APSO extension have a pythonpath
sub-directory. When the APSO console is run it includes it’s pythonpath
in python’s sys.path
.
The MRI pythonpath
does not show up in the sys.path
until it is run, as in starting MRI from the menu.
I am the author of OooDev
however I have no real experience with extensions at this time, I spent all day reading and experimenting.
I am figuring that it would be best to find out is my goal is even possible before I learn the rest.