This recipe is for execute shell commands and get the output in another part of the buildout. The commands are defined in a section called commands, one per line and the output can be referenced from other parts using the ${…} syntax.
>>> write('dummy.py', ... ''' ... class Recipe(object): ... ... def __init__(self, buildout, name, options): ... self.options = options ... ... def install(self): ... if 'output_1' in self.options: ... print self.options['output_1'] ... if 'output_2' in self.options: ... print self.options['output_2'] ... return () ... ... def update(self): ... pass ... ''')>>> write('setup.py', ... ''' ... from setuptools import setup ... ... setup(name='dummyrecipe', ... entry_points = {'zc.buildout': ['default = dummy:Recipe']}) ... ''')>>> write('buildout.cfg', ... ''' ... [buildout] ... develop = . ... parts = ... shelloutput ... use-shelloutput ... offline = true ... ... [shelloutput] ... recipe = collective.recipe.shelloutput ... commands = ... echo_1 = echo 'ECHO' ... echo_2 = echo 'The shell says: hello.' ... ... [use-shelloutput] ... recipe = dummyrecipe ... output_1 = ${shelloutput:echo_1} ... output_2 = ${shelloutput:echo_2} ... ''')>>> print system(join('bin', 'buildout')), Develop: '/sample-buildout/.' Installing shelloutput. Installing use-shelloutput. ECHO The shell says: hello.
If we give an empty command we get a hint.
>>> write('buildout.cfg', ... ''' ... [buildout] ... develop = . ... parts = ... shelloutput ... use-shelloutput ... offline = true ... ... [shelloutput] ... recipe = collective.recipe.shelloutput ... commands = ... empty-cmd = ... ... [use-shelloutput] ... recipe = dummyrecipe ... output_1 = ${shelloutput:empty-cmd} ... ''')>>> print system(join('bin', 'buildout')), Develop: '/sample-buildout/.' Uninstalling use-shelloutput. Uninstalling shelloutput. Installing shelloutput. Installing use-shelloutput. Empty command 'empty-cmd', no output generated.
If the execution of a command generates an error, we get the error message.
>>> write('buildout.cfg', ... ''' ... [buildout] ... develop = . ... parts = ... shelloutput ... use-shelloutput ... offline = true ... ... [shelloutput] ... recipe = collective.recipe.shelloutput ... commands = ... date = date -invalid-option ... ... [use-shelloutput] ... recipe = dummyrecipe ... output_1 = ${shelloutput:date} ... ''')>>> print system(join('bin', 'buildout')), Develop: '/sample-buildout/.' Uninstalling use-shelloutput. Uninstalling shelloutput. Installing shelloutput. Installing use-shelloutput. Error 'date: invalid option ... for command 'date'...
Change history
0.1 (2010-09-21)
Initial release. [j23d]
Metadata
Release files for collective.recipe.shelloutput 0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| collective.recipe.shelloutput-0.1.tar.gz | 4.9 kB | Without provenance | Details for collective.recipe.shelloutput-0.1.tar.gz |
Release files / collective.recipe.shelloutput-0.1.tar.gz
| Download URL | collective.recipe.shelloutput-0.1.tar.gz |
|---|---|
| Size | 4.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ac55a6605fcd2f68af6565778a056ffc7c1a7a02390ffe940112c0d467f1ede9
|
|
BLAKE2b-256 checksum How to use checksums |
04528d4a23a109c9781886c718ee5eb43cfede498303ded42c5877c743915a9b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for collective.recipe.shelloutput 0.1
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.