ZC Buildout recipe for defining a file-storage
Project description
This recipe can be used to define a file-storage. It creates a ZConfig file-storage database specification that can be used by other recipes to generate ZConfig configuration files.
This recipe takes an optional path option. If none is given, it creates and uses a subdirectory of the buildout parts directory with the same name as the part.
The recipe records a zconfig option for use by other recipes.
We’ll show a couple of examples, using a dictionary as a simulated buildout object:
>>> import zc.recipe.filestorage >>> buildout = dict( ... buildout = { ... 'directory': '/buildout', ... }, ... db = { ... 'path': 'foo/Main.fs', ... }, ... ) >>> recipe = zc.recipe.filestorage.Recipe( ... buildout, 'db', buildout['db'])>>> print buildout['db']['path'] /buildout/foo/Main.fs>>> print buildout['db']['zconfig'], <zodb> <filestorage> path /buildout/foo/Main.fs </filestorage> </zodb>>>> recipe.install()>>> import tempfile >>> d = tempfile.mkdtemp() >>> buildout = dict( ... buildout = { ... 'parts-directory': d, ... }, ... db = {}, ... )>>> recipe = zc.recipe.filestorage.Recipe( ... buildout, 'db', buildout['db'])>>> print buildout['db']['path'] /tmp/tmpQo0DTB/db/Data.fs>>> print buildout['db']['zconfig'], <zodb> <filestorage> path /tmp/tmpQo0DTB/db/Data.fs </filestorage> </zodb>>>> recipe.install()>>> import os >>> os.listdir(d) ['db']
To do
Add support for various file-storage options
Create a ZODB-configuration recipe that is meant to be a base class for storage recipes and provides database-configuration options.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distributions
Hashes for zc.recipe.filestorage-1.0a1.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | c285bfbe848bc1e012b1ab256121c074ee897d96651623f61adae69e07cf78ca |
|
MD5 | 52625ee6ff1ef854d2bdcf47a7cdada2 |
|
BLAKE2b-256 | 845b5044014cf95481246e9b29c712140569a9cac11b6d692fc81cad3b81a3fc |
Hashes for zc.recipe.filestorage-1.0a1-py2.4.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 66d49036c1138b91d15bedcff73f8fc125eb57fba82307c748d3b8b5a6ec779d |
|
MD5 | 59fab01f1a330874e402ab9bfc2858cb |
|
BLAKE2b-256 | 4fc63a22d799512a5840a5ff2f15a7c05def5fbed1ff05b16dc31bb5bd09cae1 |
Hashes for zc.recipe.filestorage-1.0a1-py2.3.egg
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5e71eb0823cca65a1dcc016622ad4b0329cb08507e4508cdf2958e4bd78a7d05 |
|
MD5 | 9632cd38154462939dec9178a81786dd |
|
BLAKE2b-256 | 5204322ff9a685b7f316f14b77d09ad0c1aa99c955b758a1b65cb6ee3f32e43e |