Re: UNO connection problems (GSOC Report Week 3)

2019-06-20 Thread Michael Stahl

On 20.06.19 08:52, Stephan Bergmann wrote:

On 19/06/2019 22:32, Rasmus Jonsson wrote:

On Wed, 19 Jun 2019 08:07:15 +0200
Stephan Bergmann  wrote:

This worked, thanks. However, the project requires using whichever
LibreOffice installation is available.


For C++ and Java there is helper functionality in the LO SDK for 
3rd-party apps to find and access a LO installation, see 
 
and 
, 
respectively.  But I don't think something like that has ever been 
implemented for Python.


there is the program/officehelper.py file, which has a bootstrap 
function, which is supposed to be the way to launch soffice from python 
- but as you say, it doesn't try to find a LO installation, it expects 
the environment to be set up already so that "import uno" works.


but there are basically just 2 different kinds of LO installations:
1) via upstream packaging on all platforms: you always have
   instdir/program/python[.exe], so you use that...
2) via some downstream Linux/*BSD/etc. packages: here the distro package
   is responsible for putting the officehelper.py and LO's uno module
   somewhere so that if you use the distro's default python
   installation, using officehelper works out of the box
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice

Re: UNO connection problems (GSOC Report Week 3)

2019-06-20 Thread Markus Mohrhard
Hey,

you can also have a look at the existing OfficeConnection class from
https://cgit.freedesktop.org/libreoffice/core/tree/uitest/libreoffice/connection.py

That one should contain quite some logic to handle different corner cases
and should warn if the environment is not set-up correctly.

Markus

On Thu, Jun 20, 2019 at 2:59 PM Stephan Bergmann 
wrote:

> On 19/06/2019 22:32, Rasmus Jonsson wrote:
> > On Wed, 19 Jun 2019 08:07:15 +0200
> > Stephan Bergmann  wrote:
> >
> > This worked, thanks. However, the project requires using whichever
> > LibreOffice installation is available.
>
> For C++ and Java there is helper functionality in the LO SDK for
> 3rd-party apps to find and access a LO installation, see
> <
> https://wiki.openoffice.org/wiki/Documentation/DevGuide/ProUNO/C%2B%2B/Transparent_Use_of_Office_UNO_Components>
>
> and
> <
> https://wiki.openoffice.org/wiki/Documentation/DevGuide/ProUNO/Java/Transparent_Use_of_Office_UNO_Components>,
>
> respectively.  But I don't think something like that has ever been
> implemented for Python.
>
> >> The python interpreter needs to know about LO's UNO files, and a
> >
> > Which are these UNO files?
>
> Look into what instdir/program/python (a shell script) is doing before
> executing instdir/program/python.bin (the actual python executable).
> ___
> LibreOffice mailing list
> LibreOffice@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/libreoffice
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice

Re: UNO connection problems (GSOC Report Week 3)

2019-06-20 Thread Stephan Bergmann

On 19/06/2019 22:32, Rasmus Jonsson wrote:

On Wed, 19 Jun 2019 08:07:15 +0200
Stephan Bergmann  wrote:

This worked, thanks. However, the project requires using whichever
LibreOffice installation is available.


For C++ and Java there is helper functionality in the LO SDK for 
3rd-party apps to find and access a LO installation, see 
 
and 
, 
respectively.  But I don't think something like that has ever been 
implemented for Python.



The python interpreter needs to know about LO's UNO files, and a


Which are these UNO files?


Look into what instdir/program/python (a shell script) is doing before 
executing instdir/program/python.bin (the actual python executable).

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice

Re: UNO connection problems (GSOC Report Week 3)

2019-06-19 Thread sunnysunny
 The information you have posted is very useful. The sites you have referred
was good. Thanks for sharing
webnovel   



--
Sent from: 
http://document-foundation-mail-archive.969070.n3.nabble.com/Dev-f1639786.html
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice

Re: UNO connection problems (GSOC Report Week 3)

2019-06-19 Thread Rasmus Jonsson
On Wed, 19 Jun 2019 08:07:15 +0200
Stephan Bergmann  wrote:

This worked, thanks. However, the project requires using whichever
LibreOffice installation is available. 

> The python interpreter needs to know about LO's UNO files, and a

Which are these UNO files?

> system python3 presumably doesn't know about your locally-built LO's
> files. The easiest thing should be to configure LO with something
> like --enable-python=internal and then run `instdir/program/python 
> myscript.py` from your locally-built LO.

In this script that I found online they set PYTHONPATH and so on, is
this what you're talking about? Because that still doesn't work:

http://paste.debian.net/1088549/
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice

Re: UNO connection problems (GSOC Report Week 3)

2019-06-19 Thread Stephan Bergmann

On 19/06/2019 00:41, Rasmus Jonsson wrote:

However, when I ran the same script `python3 myscript.py` I got this,

http://paste.debian.net/1088386/


The python interpreter needs to know about LO's UNO files, and a system 
python3 presumably doesn't know about your locally-built LO's files. 
The easiest thing should be to configure LO with something like 
--enable-python=internal and then run `instdir/program/python 
myscript.py` from your locally-built LO.

___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice

UNO connection problems (GSOC Report Week 3)

2019-06-18 Thread Rasmus Jonsson
So last week (until June 16th) I ran into issues with integrating my
program with LibreOffice using UNO. The goal is to start LibreOffice
Impress, connect to it (initially using the Impress Remote Protocol, but
it was decided that UNO would be more suitable), and open/ play/ control
slideshows this way.

Below is some information on what was done.

LibreOffice was started thus,

soffice --impress "--accept=socket,host=localhost,port=2002;urp;"

or thus,

soffice --impress "--accept=pipe,name=hello;urp;"

My mentor was able to run the following script and successfully connect
to LibreOffice,

http://paste.debian.net/1088385/

However, when I ran the same script `python3 myscript.py` I got this,

http://paste.debian.net/1088386/

My mentor advised to run `make UITest_demo_ui` which ran fine, but
`make UITest` failed with the same error as above,

http://paste.debian.net/hidden/ca319a53/

Would be great if anyone had any advice on how to solve this. 

rasmus
___
LibreOffice mailing list
LibreOffice@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/libreoffice