Skip to main content

Buildout recipe normalizes directory/path options.

Project description

This buildout recipe allows for a part containing fixed and/or relative filesystem paths as configuration options; these options are normalized in during the run of the part, making the real (full) filesystem path of the referenced paths available for use by other parts.

0.1 (2011-06-21)

  • Initial release.


This recipe normalizes any option value for the part it manages if said option value begins with ‘path.’ – such options are assumed to be paths. This recipe replaces relative paths of all sorts with real, full system path to files or directories.

This recipe is useful as a replacement for using non-part sections for holding path configuration; instead, use a part with this recipe, and both relative and absolute paths can be stored for use by other parts in your buildout.


Let’s create a buildout with a single part containing the configuration options we want to either preserve or normalize:

>>> write('buildout.cfg',
... """
... [buildout]
... parts =
...     paths
... [paths]
... recipe = collective.recipe.realpath
... = something else
... path.parent = ${buildout:directory}/..
... = /dev/null
... path.var = ${buildout:directory}/var
... """)

We run this buildout…

>>> print 'start', system(buildout) # doctest:+ELLIPSIS
Installing paths.

We can see that (only) the necesssary options have normalized path values:

>>> from os.path import dirname, realpath
>>> builddir = dirname(dirname(buildout))
>>> buildout_parent = realpath('%s/..'% builddir)
>>> cat('.installed.cfg') # doctest: +ELLIPSIS
... = something else
path.parent = ... = /dev/null
path.var = /sample-buildout/var


MIT-style license – See docs/COPYING.txt Author: Sean Upton / University of Utah / Upstream:

Project details

Release history Release notifications | RSS feed

This version


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

collective.recipe.realpath-0.1.tar.gz (4.2 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page