IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

OpenOffice & LibreOffice Discussion :

Utiliser python 2.7 avec LibreOffice 4.3.4.1 sous Ubuntu 14.04 [LibreOffice]


Sujet :

OpenOffice & LibreOffice

  1. #1
    Expert éminent
    Avatar de jurassic pork
    Homme Profil pro
    Bidouilleur
    Inscrit en
    Décembre 2008
    Messages
    3 951
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Bidouilleur
    Secteur : Industrie

    Informations forums :
    Inscription : Décembre 2008
    Messages : 3 951
    Points : 9 280
    Points
    9 280
    Par défaut Utiliser python 2.7 avec LibreOffice 4.3.4.1 sous Ubuntu 14.04
    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 :
    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
    L'opération s'effectue correctement ( il faut 5 heures pour compiler et plus de 30 Go d'espace libre sur son disque).
    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
    Jurassic computer : Sinclair ZX81 - Zilog Z80A à 3,25 MHz - RAM 1 Ko - ROM 8 Ko

  2. #2
    Expert éminent
    Avatar de jurassic pork
    Homme Profil pro
    Bidouilleur
    Inscrit en
    Décembre 2008
    Messages
    3 951
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Bidouilleur
    Secteur : Industrie

    Informations forums :
    Inscription : Décembre 2008
    Messages : 3 951
    Points : 9 280
    Points
    9 280
    Par défaut
    hello,
    mon problème semblait venir du fait que j'étais sous un UBUNTU 14.04 migré à partir d'une 12.04 (ou alors d'une configuration bancale). Avec un UBUNTU 14.04 fraîchement installé je n'ai plus le problème
    Jurassic computer : Sinclair ZX81 - Zilog Z80A à 3,25 MHz - RAM 1 Ko - ROM 8 Ko

  3. #3
    Expert éminent
    Avatar de jurassic pork
    Homme Profil pro
    Bidouilleur
    Inscrit en
    Décembre 2008
    Messages
    3 951
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France

    Informations professionnelles :
    Activité : Bidouilleur
    Secteur : Industrie

    Informations forums :
    Inscription : Décembre 2008
    Messages : 3 951
    Points : 9 280
    Points
    9 280
    Par défaut
    hello,

    bon ben finalement, je viens de trouver ce qui n'allait pas sur mon ancienne configuration : j'avais un package uno-0.3.3 dans le répertoire /usr/local/lib/python2.7/dist-packages qui traînait. En le mettant à la poubelle, miracle python remarche dans libreoffice.
    Jurassic computer : Sinclair ZX81 - Zilog Z80A à 3,25 MHz - RAM 1 Ko - ROM 8 Ko

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. Réponses: 0
    Dernier message: 12/10/2014, 16h51
  2. Utiliser ce Fichier xls avec une Cbx dans un Usf sous Word
    Par vaucluseimmo dans le forum Macros et VBA Excel
    Réponses: 0
    Dernier message: 13/11/2009, 23h25
  3. Comment utiliser Python avec un RAD
    Par marjal dans le forum EDI/RAD
    Réponses: 3
    Dernier message: 10/03/2007, 19h07
  4. Utilisation simple d'@@IDENTITY avec asp
    Par Ajrarn dans le forum MS SQL Server
    Réponses: 2
    Dernier message: 23/10/2003, 10h37
  5. Comment utiliser les styles XP avec Dev-C++?
    Par abraxas dans le forum Dev-C++
    Réponses: 3
    Dernier message: 05/10/2003, 19h47

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo