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:
Metadata
Release files for collective.recipe.realpath 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.realpath-0.1.tar.gz | 4.2 kB | Without provenance | Details for collective.recipe.realpath-0.1.tar.gz |
Release files / collective.recipe.realpath-0.1.tar.gz
| Download URL | collective.recipe.realpath-0.1.tar.gz |
|---|---|
| Size | 4.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
88b88f9f69dcb982a68375eb83062313a3dfc91ea43c5a8bfdd2da17734a6a5a
|
|
BLAKE2b-256 checksum How to use checksums |
4c1f16ddee2972019476dc0bf8cc53d3d080fdd73a55fda4627dcf51fa58411d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
Security for collective.recipe.realpath 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.