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

Xisco Faulí anistenis at gmail.com
Sun Sep 18 05:30:28 PDT 2011


Hello,

I've tried your patch and it works perfectly. What i'm trying now is to
import from CallWizard.py another file.
Let's imagine I have a file in fax/ called Test.py that looks like this:

class Test():

    def __init__(self):
        print "it works"

I add it to Pyuno_fax.mk

$(eval $(call gb_Pyuno_add_files,fax,\
    CallWizard.py \
    Test.py \
))

and then I import it in CallWizard.py like: from Test import Test but it
doesn't work ( I've also tried from com.sun.star.wizards.fax.Test import
Test )

any idea ?

2011/9/7 Caolán McNamara <caolanm at redhat.com>

> On Wed, 2011-09-07 at 11:24 +0100, Caolán McNamara wrote:
> > On Tue, 2011-09-06 at 19:49 +0200, Xisco Faulí wrote:
> > > 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 see that wizards has been converted to gmake in the meantime, so it no
> > longer uses dmake makefile.mk stuff, we need some gbuild support for
> > copying .py files into their final locations with some form of
> > pyuno .component file support support.
>
> dtardon was good enough to put together the gmake stuff needed to get
> this bootstrapped, which are now committed to master.
>
> So here's your patch back again, except "gbuildified" so this should
> work to make wizards->fax stick hello world into writer.
>
> There's still a lot of nasty things, dumping the .py directly into
> "program" as opposed to making some sort of subdir into which they can
> go, but maybe it'll help
>
> C.
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.freedesktop.org/archives/libreoffice/attachments/20110918/b03eae2d/attachment.html>


More information about the LibreOffice mailing list