Hello,
j'essaie de faire fonctionner python 2.7 avec LibreOffice 4.3.4.1 sous Ubuntu 14.04,ceci à des fins de compatibilité avec l'addon aeroo pour openerp. Comme vous le savez LibreOffice depuis la version 4.0 utilise python 3.x maintenant. Pour réaliser l'opération je refabrique libreoffice avec ce script :
L'opération s'effectue correctement ( il faut 5 heures pour compiler et plus de 30 Go d'espace libre sur son disque).
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51 # we need some fixes from 14.10 sudo add-apt-repository --enable-source ppa:libreoffice/libreoffice-4-3 # fetch this repository sudo apt-get update # update your libreoffice installation sudo apt-get install libreoffice # get all build dependencies for libreoffice sudo apt-get build-dep libreoffice # that strangely enough doesn't come with the above sudo apt-get install gcj-jdk python-dev # get the actual source code cd /tmp apt-get source libreoffice # the folder name is versioned cd libreoffice* # we want to have python2 sed -ie 's/^\(ENABLE_PYTHON2=\)n$/\1y/' debian/rules # and we add the package description to the control file (this is from the debian package) echo " Package: python-uno Provides: \${python:Provides} XB-Python-Version: \${python:Versions} Section: oldlibs Priority: extra Architecture: alpha amd64 armel armhf hppa i386 ia64 kfreebsd-amd64 kfreebsd-i386 mips mipsel powerpc powerpcspe ppc64 s390 s390x sparc Enhances: libreoffice Depends: libreoffice-core (= \${binary:Version}), \${misc:Depends}, \${python:Depends}, \${shlibs:Depends} Breaks: libreoffice-common (<< 1:3.5~), libreoffice-core (<< 1:3.5~) Conflicts: python3-uno, python3.3-uno Description: Python-UNO bridge (support for old python 2) The Python-UNO bridge allows use of the standard LibreOffice API with the Python scripting language. It additionally allows others to develop UNO components in Python, thus Python UNO components may be run within the LibreOffice process and can be called from C++ or the built in StarBasic scripting language. . This package is for compatibility with applications/libraries not ported to python 3 yet. Prefer python3-uno over this. Homepage: http://udk.openoffice.org/python/python-bridge.html" >> debian/control # do the build dpkg-buildpackage -us -uc # have coffee. a lot of it # install updated metapackage and the script provider so as not to depend on python3-uno any more sudo dpkg --install ../libreoffice_*.deb ../libreoffice-script-provider-python*.deb # remove python3-uno sudo apt-get remove python3-uno # and finally install the package we want sudo dpkg --install ../python-uno*.deb
Le problème est le suivant :
quand j'utilise le package python-uno qui correspond à python 2.7 python-uno , dans swriter Outils>Macros>Gérer>Python>Libreoffice macros
je ne vois pas les exemples de macros (par exemple HelloWorld)
quand j'utilise le package python3-uno qui correspond à python 3, je vois les macros exemples et je peux les exécuter.
Quelqu'un a-t-il une idée sur l'origine du problème ?
Ami calmant J.P
Partager