pod(python open document):生成odt文档的模板引擎
appy.pod的Python项目详细描述
*此包已弃用!改用“appy”软件包*
简介
pod(python open document)是一个允许轻松生成 内容是动态的文档。
原理很简单:创建一个odf(开放文档格式)文本 文档(例如使用OpenOffice Writer 2.0或更高版本),您可以插入 一些python代码在里面的某些地方,以及从任何编写的程序 在python中,可以调用pod,输入opendocument文件和 一堆python对象。pod生成另一个odf文本文档(odt) 包含所需结果的。如果你想得到结果 另一种格式,pod可以在服务器模式下调用openoffice来生成 结果为pdf、doc、rtf或txt格式。
更改日志
0.3.0【2009-03-25】
new function “document” that allows to integrate, in a pod template, the content of an external document or image.
converter.py: instead of asking to OpenOffice to convert an odt file into pdf, doc, etc, converter.py can now ask to update an odt document (refresh indexes and table of contents, resolve external links). Resolving external links is needed if you use the new “document” function (excepted for images and pdfs).
new boolean parameter to the renderer: “forceOoCall”. If True, OpenOffice will be contacted in server mode even if the result is asked in odt. This way, OpenOffice will update indexes and resolve external links. Set this parameter to True when using the new “document” function.
you may now create pod templates with OpenOffice 3.x (parsing problem with notes is solved)
OO conversion: connection to OO in server mode under Windows solved (“import socket” before “import uno”)
instruction “do … for …’ accepts now all Python objects implementing the iterator protocol, like iterators from Django query sets (querySet.iterator())