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
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file iw.recipe.cmd-0.1dev_r6528-py2.4.egg.
File metadata
- Download URL: iw.recipe.cmd-0.1dev_r6528-py2.4.egg
- Upload date:
- Size: 8.5 kB
- Tags: Egg
- Uploaded using Trusted Publishing? No
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c7403ade3e1c11718abbcc6c35cd278a11bfe107dfbbc799cb080ba3ea0844de
|
|
| MD5 |
27df205686da4f9a1879ef3e2af0f813
|
|
| BLAKE2b-256 |
3b0d465e8e03796438cf7dbd9b6fb24ad9f178a475c84e7c082bedadf13b3cf0
|