This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

This module implements two simple recipes to execute either a shell script (actually batch scripts under M$-Windows) or a Python script.

Both recipes take two options, install and update: both are considered as a list of statements, one per line, that will be written in a temporary file that will be executed respectively when the recipe is installed or updated. One or the other may be missing, and in such case nothing will happen for that particular step.

When the commands to execute depend on the platform, they can be specified using the options install-linux or install-win32 that have higher priority than the generic form.

Shell scripts

The metapensiero.recipe.script:shell recipe is implemented by the ShellScript class, and can be used in the following way:

[config]
recipe = metapensiero.recipe.script:shell
ini = config.ini
install = ${buildout:bin-directory}/soladmin create-config ${:ini}

As said, some time the commands to execute depend on the particular platform they are run. In such cases, you can say:

[config]
recipe = metapensiero.recipe.script:shell
ini = config.ini
install = ${buildout:bin-directory}/soladmin create-config ${:ini}
install-win32 =
   ${buildout:bin-directory}/soladmin create-config ${:ini}
   echo Configuration created!
   pause

Python scripts

The metapensiero.recipe.script:python recipe is implemented by the PythonScript class. It is somewhat more powerful because it can easily access the whole buildout configuration.

Consider the following example:

[start_script]
recipe = metapensiero.recipe.script:python
install =
  >>> import sys
  >>> from os.path import join
  >>> basedir = buildout['buildout']['directory']
  >>> bindir = buildout['buildout']['bin-directory']
  >>> script = join(basedir, 'sol.bat' if sys.platform=='win32' else 'sol.sh')
  >>> config = join(basedir, buildout['config']['ini'])
  >>> with open(script, 'w') as f:
  >>>   if sys.platform == 'win32':
  >>>     f.write('@echo off\n')
  >>>   f.write('%s %s\n' % (join(bindir, 'solserver'), config))
  >>> installed = script

As you can see, the script can access other section settings thru the buildout local variable, a dictionary that contains the whole buildout configuration. Another local variable is options, another dictionary containing the recipe settings.

The script may set the installed variable, that can be either a simple scalar string value or a sequence of strings: it will be used as the result of the recipe, which usually is the list of the files/directories installed by the recipe itself that will be deleted whenever the recipe is removed from the configuration.

Using eggs

If the Python script uses additional eggs, they can be specified with the eggs option, like in the following example:

[extjs]
recipe = metapensiero.recipe.script:python
eggs = metapensiero.extjs.desktop
install =
  >>> from metapensiero.extjs.desktop.scripts.extjs_dl import download_and_extract, URL
  >>> download_and_extract(URL)

Changes

1.2 (2014-03-08)

  • Simple test suite
  • Fix return of installed stuff in Python scripts

1.1 (2014-03-08)

  • First release on PyPI

1.0 (2014-03-08)

  • Initial version, extracted from SoLista
Release History

Release History

1.2

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
metapensiero.recipe.script-1.2.tar.gz (6.6 kB) Copy SHA256 Checksum SHA256 Source Mar 8, 2014

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting