Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython
INSTALL>
pypm install collective.recipe.realpath

How to install collective.recipe.realpath

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install collective.recipe.realpath
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
0.1 Available View build log
Windows (64-bit)
0.1 Available View build log
Mac OS X (10.5+)
0.1 Available View build log
Linux (32-bit)
0.1 Available View build log
Linux (64-bit)
0.1 Available View build log
 
Author
License
MIT
Dependencies
Lastest release
version 0.1 on Jun 22nd, 2011

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.

Overview

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.

Usage

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
... notpath.here = something else
... path.parent = ${buildout:directory}/..
... path.to.nowhere = /dev/null
... path.var = ${buildout:directory}/var
... """)

We run this buildout...

>>> print 'start', system(buildout) # doctest:+ELLIPSIS
start...
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
[buildout]
...
[paths]
...
notpath.here = something else
path.parent = ...
path.to.nowhere = /dev/null
path.var = /sample-buildout/var
...

LICENSE / CREDITS

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

Subscribe to package updates

Last updated Jun 22nd, 2011

Download Stats

Last month:1

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.