Skip to main content

ODT templating transforms

Project description

redomino.odttransforms

It register a new portal transforms that let you generate odt files for a given .odt template.

This products is very simple: it just interpolates odt variables with the given ones you pass calling the transformer. Therefore it performs just variable substitutions, not a real odt templating processor. No external bynaries are needed, it depends on http://ooopy.sourceforge.net/.

Tested with ooopy version 1.8.10901.

This plugin is meant for developers, it could be used for generating odt files, write a custom PloneFormGen adapter, etc.

Usage

Example:

>>> from zope.component import getUtility
>>> from Products.PortalTransforms.interfaces import IPortalTransformsTool
>>> file_contents = open('your odt file with variables').read()     # see redomino/odttransforms/tests/input.odt
>>> portal_transforms = getUtility(IPortalTransformsTool)
>>> converter = portal_transforms.convertTo(target_mimetype='application/vnd.oasis.opendocument.text.transformed',
>>>                                        orig=file_contents,
>>>                                        mimetype='application/vnd.oasis.opendocument.text',
>>>                                        mapper=dict(plone_version='4.3.2-sunny-day-beta'),
>>>                                       )
>>> transformed_odt_contents = converter.getData()

Tests

Test status:

https://secure.travis-ci.org/redomino/redomino.odttransforms.png

How to launch tests:

$ ./bin/test -m redomino.odttransforms

Authors

Changelog

0.4 (2014-02-07)

  • Added more tests [davidemoro]
  • Added uninstall profile [davidemoro]

0.3 (2014-02-07)

  • Moved all txt/md files to rst (trying to make happy both pypi and github) [davidemoro]
  • Added more specific classifiers to setup.py [davidemoro]
  • Added CI support with Travis [davidemoro]

0.2 (2014-02-06)

  • Fixed MANIFEST.in. [davidemoro]

0.1 (2014-02-06)

  • Initial release [davidemoro]

Project details


Release history Release notifications

This version
History Node

0.4

History Node

0.3

History Node

0.2

History Node

0.1

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Filename, size & hash SHA256 hash help File type Python version Upload date
redomino.odttransforms-0.4.zip (30.8 kB) Copy SHA256 hash SHA256 Source None Feb 7, 2014

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page