<?xml version="1.0" encoding="UTF-8" ?>
<rdf:RDF xmlns="http://usefulinc.com/ns/doap#" xmlns:foaf="http://xmlns.com/foaf/0.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"><Project><name>buildout_script</name>
<shortdesc>zc.buildout recipes for generating script and conf files from templates.</shortdesc>
<description>===============
buildout_script
===============

:Date: $LastChangedDate: 2006-11-21 11:23:54 -0500 (Tue, 21 Nov 2006) $
:Version: $LastChangedRevision: 4737 $
:Author: Nathan R. Yergler &lt;nathan@creativecommons.org&gt;
:Organization: `Creative Commons &lt;http://creativecommons.org&gt;`_
:Copyright: 
   2006, Nathan R. Yergler, Creative Commons; 
   licensed to the public under the `MIT license 
   &lt;http://opensource.org/licenses/mit-license.php&gt;`_.

Overview
********

buildout_script is a `zc.buildout`_ recipe for generating scripts from 
a template.  Unlike scripts specified in by the ``console_scripts`` 
entry point, those generated by buildout_script are not restricted to 
Python code.  

Scripts are generated from templates and can include settings from the
buildout substituted at runtime.  

One example usage is the generation of a wrapper script for `Paste 
Script`_ to check the status of a
daemonized server process (see paster-check below). 

Usage
*****

To use the buildout_script recipe, specify it as the recipe for a 
zc.buildout part along with the ``template`` part.  For example::

  [sample_part]
  recipe = buildout_script
  template = paster-check.sh.in

The script will be created in the bin-directory.  You may also specify 
the following parameters:

target
    The filename for the generated script; if omitted, the script will have
    the template filename without the extension.

template_dir
    An optional directory to look for templates in.  Default: ``templates``
    Templates included with the recipe may also be used without specifying
    a template_dir.

Templates
*********

Templates should be formatted using Python `string formatting syntax`_.  The dictionary
used for the formatting operation is a flattened dictionary of the 
buildout settings and part settings.

For example, a trivial script template to list the files in the buildout 
installation directory would look like this::

  #!/bin/bash

  # Sample buildout_script script template
  ls %(directory)

buildout_script ships with one script template, ``paster-check.sh.in``, 
described below.  Additional template contributions are welcome.

paster-check.sh.in
==================

At Creative Commons we use `Paste Script`_
as the server for simple web applications.  We run them using the 
``--daemon`` flag, but occassionally something goes awry and the process
dies.  This template generates a script which can be called periodically
from cron to ensure the process is still running.  Note that this script
can also be used to start the server if it is not already running.

Configuration Parameters
------------------------

Configuration parameters used by this script, which should be specified
as settings in the zc.buildout part:

server_cfg
  The `Paste Deploy &lt;http://pythonpaste.org/deploy&gt;`_ configuration
  file to serve.

pid_file
  The PID file to use when starting the server (and to subsequently check).

log_file
  The log file to use.

.. _`Paste Script`: http://pythonpaste.org/script/
.. _zc.buildout: http://cheeseshop.python.org/pypi/zc.buildout
.. _`string formatting syntax`: http://www.python.org/doc/lib/typesseq-strings.html


Change History
**************

0.2a1 (2007-03-14)
==================

* Implemented ``template`` recipe for creating a non-executable file.

0.1 (2006-12-12)
================

* Initial public release


Download
********</description>
<homepage rdf:resource="http://cheeseshop.python.org/pypi/buildout_script" />
<maintainer><foaf:Person><foaf:name>Nathan R. Yergler</foaf:name>
<foaf:mbox_sha1sum>e6fd927e2c047c0aa9740bcc67f8b04fcd2d9ae5</foaf:mbox_sha1sum></foaf:Person></maintainer>
<release><Version><revision>0.2a1</revision></Version></release>
</Project></rdf:RDF>