Skip to main content
Pre-release

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

This recipe is used to run one or more command lines

We need some buildout vars:

>>> import os
>>> join = os.path.join
>>> data_dir = join(test_dir, 'data')
>>> parts_dir = join(data_dir, 'parts')
>>> buildout = {'instance': {'location': test_dir},
...             'buildout': {'directory': test_dir,
...             'parts-directory': test_dir}}
>>> name = 'cmds'

Ok, so now we can touch a file in data_dir:

>>> test_file = join(data_dir, 'test.txt')

>>> options = {'cmds': 'touch %s' % test_file,
...            'on_install':'true'}

>>> from iw.recipe.cmd import Recipe
>>> recipe = Recipe(buildout, name, options)
>>> path = recipe.install()
>>> 'test.txt' in os.listdir(data_dir)
True

And remove it:

>>> options = {'cmds': 'rm -f %s' % test_file,
...            'on_install':'true'}
>>> recipe = Recipe(buildout, name, options)
>>> path = recipe.install()
>>> 'test.txt' in os.listdir(data_dir)
False

We can run more than one commands:

>>> cmds = '''
... touch %s
... rm -f %s
... ''' % (test_file, test_file)

>>> options = {'cmds': cmds,
...            'on_install':'true'}
>>> recipe = Recipe(buildout, name, options)
>>> path = recipe.install()
>>> 'test.txt' in os.listdir(data_dir)
False

Metadata

Release files for iw.recipe.cmd 0.1dev-r6528

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.cmd 0.1dev-r6528
File Interpreter ABI Platform Actions
iw.recipe.cmd-0.1dev_r6528-py2.4.egg Legacy Egg format - - Details for iw.recipe.cmd-0.1dev_r6528-py2.4.egg

Release files / iw.recipe.cmd-0.1dev_r6528-py2.4.egg

Download URL iw.recipe.cmd-0.1dev_r6528-py2.4.egg
Size 8.5 kB
Tags Egg
SHA-256 checksum
How to use checksums
c7403ade3e1c11718abbcc6c35cd278a11bfe107dfbbc799cb080ba3ea0844de
BLAKE2b-256 checksum
How to use checksums
3b0d465e8e03796438cf7dbd9b6fb24ad9f178a475c84e7c082bedadf13b3cf0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for iw.recipe.cmd 0.1dev-r6528

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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