Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

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

.. contents::

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

iw.recipe.template is a zc.buildout recipe to build template based
file/scripts

It also provide some recipe to build Zope2, Zope3 and Squid vhosts config
file for apache.

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

We need a buildout config file::

>>> server = start_server(test_dir)

>>> write(sample_buildout, 'buildout.cfg',
... """
... [buildout]
... parts = template.txt
...
... [template.txt]
... recipe = iw.recipe.template
... source = %s/template.txt_impl
... destination = %s/
... """ % (sample_buildout, sample_buildout))

And a template::

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


Then, the recipe should work::

>>> print system(buildout)
Installing template.txt.
template.txt: Generated file 'template.txt'.



Here is the result::

>>> print open(join(sample_buildout, 'template.txt')).read()
My template is named "template.txt"


Now we can generate an executable::

>>> write(sample_buildout, 'buildout.cfg',
... """
... [buildout]
... parts = script
...
... [script]
... recipe = iw.recipe.template:script
... source = %s/template.py_impl
... destination = %s/
... """ % (sample_buildout, sample_buildout))


And a template::

>>> template = join(sample_buildout, 'template.py_impl')
>>> open(template, 'w').write('''
... import sys
... print 'this is the script named "$name"'
... ''')


>>> print system(buildout)
Uninstalling template.txt.
Installing script.
script: Generated script 'script'.

Here is the result::

>>> print open(join(sample_buildout, 'script')).read()
#!/.../bin/python
<BLANKLINE>
import sys
print 'this is the script named "script"'
<BLANKLINE>

>>> print system(join(sample_buildout, 'script'))
this is the script named "script"

Release files for iw.recipe.template 0.1dev-r6596

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for iw.recipe.template 0.1dev-r6596
File Interpreter ABI Platform
iw.recipe.template-0.1dev_r6596-py2.4.egg Legacy Egg format - - Details

Release files / iw.recipe.template-0.1dev_r6596-py2.4.egg

Download URL iw.recipe.template-0.1dev_r6596-py2.4.egg
Size 12.8 kB
Tags Egg
SHA-256 checksum
How to use checksums
f1bac8376b7e99035efde4c68ed5b6b89fa0b27d3c538519964b90b961afb282
BLAKE2b-256 checksum
How to use checksums
2f2264f96e30c8b42cdb4f1459199f10698bae5b079d120e9b1c7f647c486520
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

0.2

2 release files

0.1

1 release file

This release

0.1dev-r6596 This release

1 release file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page