I’m just making my first foray into writing Python macros for Calc and every function I define shows up in the list of available macros, even those which are purely helper functions which don’t make any sense as macros. I’ve tried using underscore prefix to the function name but they still show up. So far the only way I have found of hiding them is to either put them in an imported module or in a class.
Standard Pythonesqe coding is that function names beginning with one or more underscores, eg. _hidden() or __private(), are not imported into other modules. I would have thought LibreOffice shouldn’t be showing these functions - is there something I’m missing? Should I report this as a bug?
You can used tuple: g_exportedScripts in then end fo you library
def macro1():
return
def macro2():
return
def _util1():
return
def _util2():
return
g_exportedScripts = (macro1, macro2)
User only view macro1, macro2, etc
Thanks/Gracias - that sorts it. Although I’d be happier if LO followed Python standards.
Now I just need to find a way of hiding python modules from LO while still being able to import them in my Python code.
You can compress in zip, and LO not see it, but you can import in Python
Please, mark like correct this answer.