ZC Buildout recipe for creating text files out of templates.
Project description
This is a very simple recipe which generates a textfile from a template.
The template can be everything, and may contain python-style string formatters. The values will be replaced with the options you set inside the buildout.cfg section.
Example
An example buildout.cfg:
[buildout] parts=test.txt template-dir=${buildout:directory}/templates [test.txt] recipe=inquant.recipe.mktemplate template=${buildout:template-dir}/test.txt.in output=${buildout:directory}/test.txt avalue=foo anothervalue=bar
An example text template:
This is just a test template=%(template)s output=%(output)s This is just text %(avalue)s and %(anothervalue)s got replaced. See?
The recipe will read the template and replace the strings yielding something like:
This is just a test template=/Users/seletz/develop/plone/buildout/templates/test.txt.in output=/Users/seletz/develop/plone/buildout/test.txt This is just text foo and bar got replaced. See?
vim: set ft=rst ts=2 sw=2 expandtab:
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for inquant.recipe.textfile-0.1dev-r1954.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9a4216e6c808f788e530b9b9a7cc8a31928f43bc6a5343b063a0f8ff36027765 |
|
MD5 | 2dab30a098b1ccb7d450b9cabd32c99b |
|
BLAKE2b-256 | c066d53d8106610e87d2b13acdff58929921dd0e07a89fa1e31415c4c8c0f499 |
Close
Hashes for inquant.recipe.textfile-0.1dev_r1954-py2.4.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 13a59c02ec8d9a3218af96b90b862168cf0685028d12f5ce98396f0c313f8106 |
|
MD5 | 37b4f3494031faaf94759d027470127c |
|
BLAKE2b-256 | 5364963ba5625386468334a5a68199737a923ce54b662ac8b1277062a235c1be |