[Libreoffice] candidate for a new python section in SDK examples page
Stephan Bergmann
sbergman at redhat.com
Thu Dec 8 00:56:47 PST 2011
On 12/07/2011 06:11 PM, Caolán McNamara wrote:
> On Wed, 2011-12-07 at 17:07 +0100, Miklos Vajna wrote:
>> In short, it checks if there is a funcion named "g_ImplementationHelper"
>> in "actual python-module-name".
>
> g_ImplementationHelper can be googled for, or opengroked. Its the "magic
> smoke" which pyuno queries to find out what services a python component
> provides, here's the bit from the mailmerge.py, which I think is the
> only working python component we have in-tree.
>
> # pythonloader looks for a static g_ImplementationHelper variable
> g_ImplementationHelper = unohelper.ImplementationHelper()
> g_ImplementationHelper.addImplementation( \
> PyMailServiceProvider,
> "org.openoffice.pyuno.MailServiceProvider",
> ("com.sun.star.mail.MailServiceProvider",),)
> g_ImplementationHelper.addImplementation( \
> PyMailMessage, "org.openoffice.pyuno.MailMessage",
> ("com.sun.star.mail.MailMessage",),)
>
> I've no idea what's the right way that passive registration supersedes
> this "classic" pyuno "active" registration.
See desktop/test/deployment/{active,passive}/ for working Python UNO
components (as well as C++ and Java ones) using both active (deprecated)
and passive registration (and all wrapped into ready-to-install extensions).
Stephan
More information about the LibreOffice
mailing list