Skip to main content

ZC buildout recipe to build template based file

Project description

================
iw.recipe.template package
================

.. contents::

What is iw.recipe.template ?
==================

Explain here what is the purpose of iw.recipe.template.

How to use iw.recipe.template ?
=====================

We need some buildout vars::

>>> data_dir = join(test_dir, 'data')
>>> parts_dir = join(data_dir, 'parts')
>>> buildout = {'instance': {'location': test_dir},
... 'buildout': {'directory': test_dir,
... 'install-from-cache': False,
... 'download-cache':False,
... 'parts-directory': parts_dir}}
>>> name = 'template'

And a template::

>>> template = join(data_dir, 'template.py_impl')
>>> open(template, 'w').write('''My template is named "$name"''')

Then, the recipe should work::

>>> from iw.recipe.template import Recipe
>>> options = {}
>>> options['source'] = template
>>> options['destination'] = join(data_dir, 'template.py')
>>> recipe = Recipe(buildout, name, options)
>>> filename = recipe.install()

Here is the result::

>>> print open(options['destination']).read()
My template is named "template"

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

iw.recipe.template-0.1dev_r6578-py2.4.egg (8.8 kB view details)

Uploaded Source

File details

Details for the file iw.recipe.template-0.1dev_r6578-py2.4.egg.

File metadata

File hashes

Hashes for iw.recipe.template-0.1dev_r6578-py2.4.egg
Algorithm Hash digest
SHA256 009ccbc2aad0d1455ef4d75927a8aca0d472a18b99e9b7f95d88a8cc1101a0a2
MD5 6bda5adfd254c1e8f1772833c67d1553
BLAKE2b-256 5506bf80022f8da254a189bf540cb7388029eda0c0043cc73c0d1ba437548c89

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page