下载并安装openoffice.org的zc.buildout配方

z3c.recipe.openoffice的Python项目详细描述


This recipe download openoffice in your buildout, it can also (optional) create egg with pyuno and change the default python used by openoffice.

More info about Python UNO: http://udk.openoffice.org/python/python-bridge.html

We are using this to generate OpenOffice documents from zope/python

构建配置:

Add this section to your buildout configuration:

[buildout]
parts =
    ... your other parts ...
    openoffice
...

[openoffice]
recipe = z3c.recipe.openoffice

This will just download and install openoffice in your buildout

To create the pyuno egg add the fallowing config:

[openoffice]
recipe = z3c.recipe.openoffice
install-pyuno-egg = yes

To also change openoffice python, add the following config:

[openoffice]
recipe = z3c.recipe.openoffice
install-pyuno-egg = yes
hack-openoffice-python = yes

By default it will fetch version OpenOffice 2.3 but you might want to install from another location or another version like this:

[openoffice]
recipe = z3c.recipe.openoffice
install-pyuno-egg = yes
hack-openoffice-python = yes
version = 2.3.1
download-url = ftp://ftp.openoffice.skynet.be/pub/ftp.openoffice.org/stable/2.3.1/OOo_2.3.1_LinuxIntel_install_en-US.tar.gz

注:

For this to work an OpenOffice process need to be running in background. As this require a X server and you don’t want to install a real X server in a production environment you might want to use Xvfb. Here are the lines we use to start openoffice:

$ cd myBuildout
$ Xvfb :3 -ac -screen sn 800x600x16 &
$ ./parts/openoffice/program/soffice "-accept=socket,host=localhost,port=2002;urp;" -display :3 &
$ ./bin/instance start

This recipe only works with linux at the moment

To test pyuno (requires zopepy in buildout.cfg):

$ ./bin/zopepy
>>> import pyuno

If you get the fallowing error:

"SystemError: dynamic module not initialized properly"

Do:

$ ldconfig YOURBUILDOUTFOLDER/parts/openoffice/program

If you still face the same error, you might try:

$  export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"YOURBUILDOUTFOLDER/parts/openoffice/program"

Be careful that the first time you will run soffice in server mode, openoffice will oblige you to pass throught a wizard run first openoffice on your normal display or copy an .openoffice2 folder in the home of the user which is running the command.

This recipe requires rpm2cpio and cpio to be installed on your system.

作者:

Original author: Martijn Faassen - faassen@infrae.com

Modified by: Jean-Francois Roche - jfroche@affinitic.be

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
具有未知数量条件的java If语句   java如何在Spark中使用两个“条件”进行过滤?   雅加达ee为ColdFusion提供的最佳Java ee服务器   java如何在jersey的MessageBodyWriter方法中获取writeTo中的anotations值?   java从脚本文件调用jar文件中的函数   java在执行insert语句后,如何获得id值为的语句?   在OS X上设置OpenCV Java绑定   java使用for循环遍历数组x。以字符串形式返回x的元素,其中每个元素由一个空格分隔   ApacheiClientBuilder为Algolia Java创建的APIClient是线程安全的吗?   java在DFS/BFS算法中获取邻居时避免内存分配?   java使用AES/CBC/PKCS5P加密大文件(2GB)   允许保存/加载列布局的Java DB网格组件   队列大小为1的java Spring调度   跑步带有Java参数的exe   java正则表达式将所有“<”和“>”标记替换为“&lt;”及“&gt;”在<<![CDATA]>标签?   java何时同步变量?