Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #18812 > unrolled thread

Re: open office in another language?

Started byStefan Behnel <stefan_ml@behnel.de>
First post2012-01-11 10:08 +0100
Last post2012-01-11 14:06 +0100
Articles 3 — 2 participants

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: open office in another language? Stefan Behnel <stefan_ml@behnel.de> - 2012-01-11 10:08 +0100
    Re: open office in another language? Paul Rudin <paul.nospam@rudin.co.uk> - 2012-01-11 10:17 +0000
      Re: open office in another language? Stefan Behnel <stefan_ml@behnel.de> - 2012-01-11 14:06 +0100

#18812 — Re: open office in another language?

FromStefan Behnel <stefan_ml@behnel.de>
Date2012-01-11 10:08 +0100
SubjectRe: open office in another language?
Message-ID<mailman.4635.1326272939.27778.python-list@python.org>
Sean Wolfe, 10.01.2012 22:43:
> I'm a somewhat-satisfied openoffice.org user. I mean it works, but if
> it weren't in Java I'd be doing some of my own tweaking. But since
> it's in Java I stay away... no likey.

It's been in C++ ever since the old StarOffice days, others have commented
on that already. Java is only one way of extending it, and it's not even
required by the installation.


> Has there been any talk of doing another similar office suite, or
> maybe just writer + spreadsheet, in a better language eg python? I
> expect it's a huge undertaking but ... thought I'd ask around at
> least.

OOo has been fully scriptable in Python for ages. It even comes with an
embedded Python runtime for that purpose (at least on
non-package-management systems like Windows). So, Python is actually a
standard component in all installations, whereas Java is not, and is
therefore not necessarily available in a deployment. Basically, if you want
your scripts to run in all OpenOffice/LibreOffice installations, you either
have to write it in StarBasic, or use Python.

The OOo extension API is called UNO, so look for the PyUNO bridge.
Admittedly, it's somewhat badly documented, but it basically works the same
way as the other UNO-API incarnations in other languages, so any UNO
documentation will generally apply just fine.

Also look for LibreOffice, as Ben Finney hinted. Since Oracle dropped Sun's
OOo commitment, many regard it as the future of OOo. It's certainly the
place where the development happens these days.

Stefan

[toc] | [next] | [standalone]


#18816

FromPaul Rudin <paul.nospam@rudin.co.uk>
Date2012-01-11 10:17 +0000
Message-ID<87hb02y259.fsf@no-fixed-abode.cable.virginmedia.net>
In reply to#18812
Stefan Behnel <stefan_ml@behnel.de> writes:


> OOo has been fully scriptable in Python for ages. It even comes with an
> embedded Python runtime for that purpose (at least on
> non-package-management systems like Windows). So, Python is actually a
> standard component in all installations, whereas Java is not, and is
> therefore not necessarily available in a deployment. Basically, if you want
> your scripts to run in all OpenOffice/LibreOffice installations, you either
> have to write it in StarBasic, or use Python.
>
> The OOo extension API is called UNO, so look for the PyUNO bridge.
> Admittedly, it's somewhat badly documented, but it basically works the same
> way as the other UNO-API incarnations in other languages, so any UNO
> documentation will generally apply just fine.
>
> Also look for LibreOffice, as Ben Finney hinted. Since Oracle dropped Sun's
> OOo commitment, many regard it as the future of OOo. It's certainly the
> place where the development happens these days.

I have dabbled with PyUNO in the past. One issue is that the api seems
rather unpythonic (to me, at least).



[toc] | [prev] | [next] | [standalone]


#18825

FromStefan Behnel <stefan_ml@behnel.de>
Date2012-01-11 14:06 +0100
Message-ID<mailman.4643.1326287200.27778.python-list@python.org>
In reply to#18816
Paul Rudin, 11.01.2012 11:17:
> Stefan Behnel writes:
>> OOo has been fully scriptable in Python for ages. It even comes with an
>> embedded Python runtime for that purpose [...]
> 
> I have dabbled with PyUNO in the past. One issue is that the api seems
> rather unpythonic (to me, at least).

Sure, UNO wasn't designed for Python. It's mostly a 1:1 mapping of the C++
API. I didn't find anything in a quick web search, but I'm pretty sure the
wrapper is auto-generated in some way.

But still: it's there, it's usable and it's even object oriented. And I
estimate that it's much easier to use from Python than from C++ (which I
never tried). If you want something better, feel free to write a pythonic
Cython wrapper of the C++ UNO API. May take a while, though, and you'll
also have to rewrite the entire UNO documentation to match your new
wrapper, so that people can actually start using it effectively.

Stefan

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web