Bug 145025 - Break socket mediated pyuno out into a standalone module
Summary: Break socket mediated pyuno out into a standalone module
Status: UNCONFIRMED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: sdk (show other bugs)
Version:
(earliest affected)
Inherited From OOo
Hardware: All All
: medium enhancement
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2021-10-10 06:19 UTC by Andrew Lentvorski
Modified: 2023-10-10 06:06 UTC (History)
1 user (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Andrew Lentvorski 2021-10-10 06:19:17 UTC
The fact that pyuno is welded to a specific instantiation of LibreOffice/OO and the included version of Python causes a lot of grief.

If LibreOffice is running headless and talking over a socket, data and requests are being serialized into some wire format, right?

Is there a reason why this wire format can't be documented and then broken out into an independent Python module so that the user's choice of Python could access and control LibreOffice via the socket?

Thanks.
Comment 1 Noel Grandin 2023-10-09 18:48:10 UTC
So what you are asking for is effectively the python equivalent of the URE, which is the set of C++ libraries and headers that can be used to build C++ applications that talk to LibreOffice.

Doing a URE for python is technically possible, but quite a lot of work.
Comment 2 Andrew Lentvorski 2023-10-09 22:25:49 UTC
I can't say I'm surprised.  I figured that if it were easy to do, then it would have been done already.

This isn't unique to LO.  Nobody has a good answer to this.  Blender wrote its own widgets in order to communicate effectively with Python.  LO and KiCad weld in specific versions of Python.  I don't know of anybody who has a complex application which allows external processes to drive them effectively.  (I haven't tried VBScript or AppleScript in a long time, so I can't comment about those.)

I presume that the only effective way would be to convert the URE into a serialization layer with and have IPC/RPC use that.

And I say this as someone who is sitting here, writing what is effectively a crappy web spreadsheet in Javascript *again*, when what is really needed is to drive LO in real-time from an outside process.

I know it won't happen soon.  But, if I don't at least file something, it will happen *never*.
Comment 3 Noel Grandin 2023-10-10 06:06:46 UTC
Its not quite that hard, it is mostly a packaging problem of copying the right subset of stuff into some place that is convenient for an external python to consume.

But then there are likely to be a variety of difficult issues around python's native code loading stuff which will require some coding chops to solve.