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

Xisco Faulí anistenis at gmail.com
Tue Aug 16 10:29:05 PDT 2011


Thank you for pointing out this file but I don't really understand how it
works.
The wizard is called here :
http://opengrok.libreoffice.org/xref/core/officecfg/registry/data/org/openoffice/Office/UI/WriterCommands.xcu#441
where
MailMergeWizard is the service register in Writer.xcu (
http://opengrok.libreoffice.org/xref/core/officecfg/registry/data/org/openoffice/Office/Writer.xcu#30
)
but then how libo knows that this service refers to mailmerge.py ?

Greetings

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

> On Mon, 2011-08-15 at 19:02 +0200, Xisco Faulí wrote:
> > Hello everybody,
> >
> >
> > before I merge the gsoc branch into master I'd like to integrate the
> > python code into libo and get rid of the java code.
> > I know i have to edit this file
> >
> http://opengrok.libreoffice.org/xref/core/officecfg/registry/data/org/openoffice/Office/Common.xcubut i can't figure out how to call the python code.  I've tried to call this
> file
> http://opengrok.libreoffice.org/xref/core/pyuno/demo/hello_world_comp.pyusing this value:
> <value>service:org.openoffice.comp.pyuno.demo.HelloWorld?insert</value> but
> it doesn't work. Any idea ?
>
> Perhaps hello_world_comp.py isn't registered as a service ?
>
> Did you look at how the mailmerge.py example is installed ?, i.e.
> http://opengrok.libreoffice.org/search?q=mailmerge.py for a python
> component which is bundled into LibreOffice.
>
> You may have to do pretty much the same thing for it be available via
> service:...?foo out-of-the-box. There's some preamble at the top of
> mailmerge.py about how to manually register that component for testing
> purposes, which is probably the archaic way to do it these-days, but
> probably still works.
>
> C.
>
>
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20110816/3d108ac8/attachment-0001.htm>


More information about the LibreOffice mailing list