This project has been archived by its maintainers, and is no longer receiving any updates.
Recipe for setting up a filestorage
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'], end='') <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'], end='') <zodb> <filestorage> path /tmp/tmpQo0DTB/db/Data.fs </filestorage> </zodb>>>> recipe.install() ()>>> import os >>> os.listdir(d) ['db']
The update method doesn’t do much, as the database part’s directory already exists, but it is present, so buildout doesn’t complain and doesn’t accidentally run install() again:
>>> recipe.update()
If the storage’s directory is removed, is it re-added by the update method:
>>> os.rmdir(os.path.join(d, 'db')) >>> os.listdir(d) [] >>> recipe.update() >>> os.listdir(d) ['db']
This is useful in development when the directory containing the database is removed in order to start the database from scratch.
CHANGES
2.0 (2023-02-10)
Drop support for Python 2.6, 2.7, 3.2, 3.3, 3.4, 3.5, 3.6.
Add support for Python 3.7, 3.8, 3.9, 3.10, 3.11, PyPy3.
1.1.2 (2014-02-21)
Fixed: packaging bug that caused ‘pip install zc.recipe.filestorage’ to fail with an error about missing README.txt
1.1.1 (2014-02-16)
Fixed: packaging bug that caused a test failure in a test runner that didn’t use buildout to run setup.py.
1.1.0 (2014-02-14)
Python 3 compatibility
Using Python’s doctest module instead of deprecated zope.testing.doctest.
Removed ‘shared-blob-dir’ from blobstorage section.
1.0.0 (2007-11-03)
Initial release.
Metadata
Release files for zc.recipe.filestorage 2.0
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 |
|---|---|---|---|---|
| zc.recipe.filestorage-2.0.tar.gz | 7.4 kB | Without provenance | Details for zc.recipe.filestorage-2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| zc.recipe.filestorage-2.0-py3-none-any.whl | Python 3 | none | any | Details for zc.recipe.filestorage-2.0-py3-none-any.whl |
Total release size: 15.2 kB
Release files / zc.recipe.filestorage-2.0.tar.gz
| Download URL | zc.recipe.filestorage-2.0.tar.gz |
|---|---|
| Size | 7.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5042205100fdf572479186a59964b261b6f1b71b1b4265e06ab70e0e4f8b7b67
|
|
BLAKE2b-256 checksum How to use checksums |
e7b6d5bb0ef89885b9af2ecb83fdb3ba48d38a40dfebb6d249a1e4e3f0c453eb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.16
|
Release files / zc.recipe.filestorage-2.0-py3-none-any.whl
| Download URL | zc.recipe.filestorage-2.0-py3-none-any.whl |
|---|---|
| Size | 7.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
de6a600e790314d8ccc932900e54746d011cccdb7e8d8e6d7ee665434a2fde0e
|
|
BLAKE2b-256 checksum How to use checksums |
7b4a7b7d12712c0d27cdd9f9016ada0d66cdd94764c77f9dc7ce4a5350d19f38
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.2 CPython/3.9.16
|
Security for zc.recipe.filestorage 2.0
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.