Metadata-Version: 1.0
Name: iw.recipe.cmd
Version: 0.3
Summary: ZC Buildout recipe to execute a commande line
Home-page: http://plone.org/products/iw-recipes
Author: Ingeniweb
Author-email: support@ingeniweb.com
License: GPL
Description: .. contents::
        
        .. Note to recipe author!
        ---------------------
        Update the following URLs to point to your:
        
        - code repository
        - bug tracker
        - questions/comments feedback mail
        (do not set a real mail, to avoid spams)
        
        Or remove it if not used.
        
        - Code repository: https://ingeniweb.svn.sourceforge.net/svnroot/ingeniweb/iw.recipe.cmd/trunk
        - Questions and comments to support@ingeniweb.com
        - Report bugs at http://trac.ingeniweb.com/
        
        
        Change history
        **************
        
        trunk (2008-04-22)
        ==================
        
        - xxx [Ingeniweb]
        
        0.3 (2008-04-22)
        ================
        
        - apply last version of the recipe template
        [gawel]
        
        0.2 (2008-04-22)
        ================
        
        - run commands in one process
        [gawel]
        
        - win32 tests compat
        [gawel]
        
        
        Detailed Documentation
        **********************
        
        Supported options
        =================
        
        The recipe supports the following options:
        
        .. Note to recipe author!
        ----------------------
        For each option the recipe uses you shoud include a description
        about the purpose of the option, the format and semantics of the
        values it accepts, whether it is mandatory or optional and what the
        default value is if it is omitted.
        
        on_install
        
        true if the commands must run on install
        
        on_update
        
        true if the commands must run on update
        
        cmds
        
        a set of command lines
        
        shell
        
        a valid interpreter (POSIX only)
        
        Example usage
        =============
        
        .. Note to recipe author!
        ----------------------
        zc.buildout provides a nice testing environment which makes it
        relatively easy to write doctests that both demonstrate the use of
        the recipe and test it.
        You can find examples of recipe doctests from the PyPI, e.g.
        
        http://pypi.python.org/pypi/zc.recipe.egg
        
        The PyPI page for zc.buildout contains documentation about the test
        environment.
        
        http://pypi.python.org/pypi/zc.buildout#testing-support
        
        Below is a skeleton doctest that you can start with when building
        your own tests.
        
        We need a config file::
        
        >>> cfg = """
        ... [buildout]
        ... parts = cmds
        ...
        ... [cmds]
        ... recipe = iw.recipe.cmd
        ... on_install=true
        ... cmds= %s
        ... """
        
        >>> test_file = join(sample_buildout, 'test.txt')
        >>> cmds = 'echo "bouh" > %s' % test_file
        >>> write(sample_buildout, 'buildout.cfg', cfg % cmds)
        
        Ok, so now we can touch a file for testing::
        
        >>> print system(buildout)
        Installing cmds.
        
        >>> 'test.txt' in os.listdir(sample_buildout)
        True
        
        And remove it::
        
        >>> test_file = join(sample_buildout, 'test.txt')
        >>> if sys.platform == 'win32':
        ...    cmds = 'del %s' % test_file
        ... else:
        ...    cmds = 'rm -f %s' % test_file
        >>> write(sample_buildout, 'buildout.cfg', cfg % cmds)
        
        >>> print system(buildout)
        Uninstalling cmds.
        Installing cmds.
        
        >>> 'test.txt' in os.listdir(sample_buildout)
        False
        
        We can run more than one commands::
        
        >>> if sys.platform == 'win32':
        ...     cmds = '''
        ... echo "bouh" > %s
        ... del %s
        ... ''' % (test_file, test_file)
        ... else:
        ...     cmds = '''
        ... echo "bouh" > %s
        ... rm -f %s
        ... ''' % (test_file, test_file)
        
        >>> test_file = join(sample_buildout, 'test.txt')
        >>> if sys.platform == 'win32':
        ...     cmds = 'del %s' % test_file
        ... else:
        ...     cmds = 'rm -f %s' % test_file
        >>> write(sample_buildout, 'buildout.cfg', cfg % cmds)
        
        >>> print system(buildout)
        Updating cmds.
        
        >>> 'test.txt' in os.listdir(sample_buildout)
        False
        
        We can also run some python code::
        
        >>> cfg = """
        ... [buildout]
        ... parts = py py2
        ...
        ... [py]
        ... recipe = iw.recipe.cmd:py
        ... on_install=true
        ... cmds=
        ...   >>> sample_buildout = buildout.get('directory', '.')
        ...   >>> print sorted(os.listdir(sample_buildout))
        ...   >>> os.remove(os.path.join(sample_buildout, ".installed.cfg"))
        ...   >>> print sorted(os.listdir(sample_buildout))
        ... [py2]
        ... recipe = iw.recipe.cmd:py
        ... on_install=true
        ... cmds=
        ...   >>> def myfunc(value):
        ...   ...     return value and True or False
        ...   >>> v = 20
        ...   >>> print myfunc(v)
        ... """
        
        >>> write(sample_buildout, 'buildout.cfg', cfg)
        
        Ok, so now we run it::
        
        >>> print system(buildout)
        Uninstalling cmds.
        Installing py.
        ['.installed.cfg', 'bin', 'buildout.cfg', 'develop-eggs', 'eggs', 'parts']
        ['bin', 'buildout.cfg', 'develop-eggs', 'eggs', 'parts']
        Installing py2.
        True
        
        
        
        
        Contributors
        ************
        
        Gael Pasgrimaud
        
        
        Download
        ********
        
Keywords: buildout recipe
Platform: UNKNOWN
Classifier: Framework :: Buildout
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development :: Build Tools
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: License :: OSI Approved :: GNU General Public License (GPL)
