[Libreoffice] [GSOC] how to call python code from the menu

Xisco Faulí anistenis at gmail.com
Tue Sep 6 10:49:33 PDT 2011


Hello,

I've tried to follow your steps but placing the code in
wizards/com/sun/star/wizards/fax/CallWizard.py. So far I haven't been able
to build it successfully. It complains and says: ERROR: File not found:
CallWizard.py

I attach a file with the changes I've done.

Greetings

2011/8/17 Caolán McNamara <caolanm at redhat.com>

> On Wed, 2011-08-17 at 09:06 +0100, Caolán McNamara wrote:
> > I imagine that if you basically opengrok for mailmerge.py and
> > mailmerge.component and follow the same pattern for your one that it'll
> > get you a lot closer.
>
> Seeing as this is a bit tricky to get up and running, attached is a
> rough-and-ready patch to turn wizards->letter into "hello world" in
> python.
>
> i.e.
>
> a) add a "hello_world.component" (which gets run through the usual xslt
> script via the local makefile.mk to tweak it to give the right location
> where the .py will finally get installed) that describes a
> hello_world.py component. The .component has the implementation name,
> e.g. org.openoffice.comp.pyuno.demo.HelloWorld in it and the services it
> implements, e.g. com.sun.star.task.Job
>
> b) I added a hello_world.py that implements that, see its
> g_ImplementationHelper.addImplementation for the matching implementation
> name and services
>
> c) add that hello_world.component to "postprocess" where it will be
> basically added as an entry into the services.rdb in the final install
> sets install/program/services.rdb (which is an xml file these days. That
> should end up having "<component loader="com.sun.star.loader.Python"
> uri="vnd.openoffice.pymodule:hello_world"><implementation
> name="org.openoffice.comp.pyuno.demo.HelloWorld"><service
> name="com.sun.star.task.Job"/></implementation></component></components>"
> in it).
>
> d) change the wizards->letter line in officecfg to call it
>
> e) modify scp2 to install it
>
> f) I haven't a clue what the entry in instsetoo_native does anymore, I
> think I used to know :-)
>
> hope this helps.
>
> C.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20110906/9eeec6f5/attachment-0001.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-call-callwizard.patch
Type: text/x-patch
Size: 12924 bytes
Desc: not available
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20110906/9eeec6f5/attachment-0001.bin>


More information about the LibreOffice mailing list