Hi,
I sent the email below to fedora-devel some time ago; there was no response. Let's try again with some additional info. :-)
I'm the fedora maintainer of pybliographer. The development version of pyblio (which I would like to push to the devel repo soon) has the capability to interact with openoffice through the pyuno component. (Bibus can do the same.) It can add citations and generate reference list in the document for example. The openoffice.org-pyuno package installs uno.py and other files under /usr/lib/openoffice.org/program/, so with the default installations and settings importing uno.py from external python programs gives an import error. Program specific patches could be used probably to add this 'strange' path to pythonpath, but wouldn't be better to make available these moduls for python at the openoffice level? See below what debian does. Any thoughts, ideas?
Zoltan
---------- Forwarded message ---------- Date: Wed, 12 Sep 2007 23:18:19 +0200 (CEST) From: Zoltan Kota z.kota@gmx.net Reply-To: Development discussions related to Fedora fedora-devel-list@redhat.com To: Fedora devel fedora-devel-list@redhat.com Subject: openoffice-pyuno and external python programs
Hi,
Files from openoffice.org-pyuno are installed under /usr/lib/openoffice.org2.0. So, 'import uno' from python gives an import error. How should we support external programs to use this module? Should we patch the program to import uno.py from this directory somehow? Or would be better to change the installation path in the openoffice.org-pyuno package? Debian for instance installs /usr/share/pycentral/python-uno/site-packages/uno.py /usr/share/pycentral/python-uno/site-packages/unohelper.py /usr/lib/python2.4/site-packages/pyuno.so
Zoltan
On Tue, 2007-10-16 at 13:06 +0200, Zoltan Kota wrote:
Hi,
The openoffice.org-pyuno package installs uno.py and other files under /usr/lib/openoffice.org/program/, so with the default installations and settings importing uno.py from external python programs gives an import error. Program specific patches could be used probably to add this 'strange' path to pythonpath, but wouldn't be better to make available these moduls for python at the openoffice level? See below what debian does. Any thoughts, ideas?
Hmm, what does readelf -d /usr/lib/python2.4/site-packages/pyuno.so | grep RPATH say on debian ? Is there an absolute entry in there so get it to find the libraries it needs ?
One work-around might be to stick this at the top of the python program
import sys import distutils.sysconfig sys.path.append(distutils.sysconfig.get_config_var('LIBDIR') + \ '/openoffice.org/program') import uno
C.
Zoltan
---------- Forwarded message ---------- Date: Wed, 12 Sep 2007 23:18:19 +0200 (CEST) From: Zoltan Kota z.kota@gmx.net Reply-To: Development discussions related to Fedora fedora-devel-list@redhat.com To: Fedora devel fedora-devel-list@redhat.com Subject: openoffice-pyuno and external python programs
Hi,
Files from openoffice.org-pyuno are installed under /usr/lib/openoffice.org2.0. So, 'import uno' from python gives an import error. How should we support external programs to use this module? Should we patch the program to import uno.py from this directory somehow? Or would be better to change the installation path in the openoffice.org-pyuno package? Debian for instance installs /usr/share/pycentral/python-uno/site-packages/uno.py /usr/share/pycentral/python-uno/site-packages/unohelper.py /usr/lib/python2.4/site-packages/pyuno.so
Zoltan
On Tue, 16 Oct 2007, Caolan McNamara wrote:
Hmm, what does readelf -d /usr/lib/python2.4/site-packages/pyuno.so | grep RPATH say on debian ? Is there an absolute entry in there so get it to find the libraries it needs ?
On Ubuntu, readelf... says: 0x0000000f (RPATH) Library rpath: [$ORIGIN:/usr/lib/openoffice/program]
On Tue, 2007-10-16 at 15:17 +0200, Zoltan Kota wrote:
On Tue, 16 Oct 2007, Caolan McNamara wrote:
Hmm, what does readelf -d /usr/lib/python2.4/site-packages/pyuno.so | grep RPATH say on debian ? Is there an absolute entry in there so get it to find the libraries it needs ?
On Ubuntu, readelf... says: 0x0000000f (RPATH) Library rpath: [$ORIGIN:/usr/lib/openoffice/program]
Yeah, so they set the rpath to find the OOo libs that libpyuno.so is linked to in /usr/lib/openoffice/ when they moved it out of there. I'd probably fall foul of the fedora packaging guidelines if I whacked in the same thing ? We (OOo) don't really have a good standard for where to stick bits of OOo when it's bundled into the distro.
C.
Caolan McNamara wrote:
On Tue, 2007-10-16 at 15:17 +0200, Zoltan Kota wrote:
On Tue, 16 Oct 2007, Caolan McNamara wrote:
Hmm, what does readelf -d /usr/lib/python2.4/site-packages/pyuno.so | grep RPATH say on debian ? Is there an absolute entry in there so get it to find the libraries it needs ?
On Ubuntu, readelf... says: 0x0000000f (RPATH) Library rpath: [$ORIGIN:/usr/lib/openoffice/program]
Yeah, so they set the rpath to find the OOo libs that libpyuno.so is linked to in /usr/lib/openoffice/ when they moved it out of there. I'd probably fall foul of the fedora packaging guidelines if I whacked in the same thing ? We (OOo) don't really have a good standard for where to stick bits of OOo when it's bundled into the distro.
If it's exporting an interface that it expects others to use (like the pythonuno bindings), it should be put into %{_libdir} directly....
Is this doable or are there things that make it non-trivial?
-Toshio
On Tue, 2007-10-16 at 13:06 +0200, Zoltan Kota wrote:
The openoffice.org-pyuno package installs uno.py and other files under /usr/lib/openoffice.org/program/, so with the default installations and settings importing uno.py from external python programs gives an import error.
And how about in rawhide now, does that work for you as you wanted...
[caolan@Jehannum ~]$ python -c "import uno" [caolan@Jehannum ~]$
C.
On Wed, 12 Dec 2007, Caolan McNamara wrote:
On Tue, 2007-10-16 at 13:06 +0200, Zoltan Kota wrote:
The openoffice.org-pyuno package installs uno.py and other files under /usr/lib/openoffice.org/program/, so with the default installations and settings importing uno.py from external python programs gives an import error.
And how about in rawhide now, does that work for you as you wanted...
[caolan@Jehannum ~]$ python -c "import uno" [caolan@Jehannum ~]$
I checked it in my rawhide box. "import uno" is ok now. I will play a bit with the devel version of pyblio to test the OOo connection through uno.
Zoltan