{ "info": { "author": "Souheil Chelfouh", "author_email": "trollfot@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Environment :: Web Environment", "Framework :: Zope3", "Intended Audience :: Other Audience", "License :: OSI Approved :: GNU General Public License (GPL)", "Operating System :: OS Independent", "Programming Language :: Python" ], "description": "==============\ndolmen.storage\n==============\n\n`dolmen.storage` defines a clear high-level API to deal with pluggable\nstorage components.\n\nComponents\n==========\n\nStorage\n-------\n\nA storage is a component dedicated to store contents. It behaves like\na container and provides the interface `dolmen.storage.IStorage`.\n\nOut of the box, two IStorage components are available, based on ZODB\nBTrees::\n\n >>> from dolmen.storage import IStorage\n >>> from dolmen.storage import container\n >>> from zope.container.interfaces import IContainer\n\n >>> otree = container.OOBTreeStorage()\n >>> itree = container.IOBTreeStorage()\n\n >>> IStorage.extends(IContainer)\n True\n\n >>> from zope.interface import verify\n >>> verify.verifyObject(IStorage, otree)\n True\n >>> verify.verifyObject(IStorage, itree)\n True\n\n\nDelegated storage\n-----------------\n\nA delegated storage is a component behaving like a Storage but\ndelegating all the container-level methods to a `storage`\nattribute::\n\n >>> from dolmen.storage import IDelegatedStorage, DelegatedStorage\n \n >>> class MyStorage(DelegatedStorage):\n ... def __init__(self):\n ... self.storage = container.OOBTreeStorage()\n >>> container = MyStorage()\n\n >>> verify.verifyObject(IDelegatedStorage, container)\n True\n\n >>> container['manfred'] = 'mammoth'\n >>> 'manfred' in container\n True\n >>> 'manfred' in container.storage\n True\n\nThe `storage` attribute has to be a valid IStorage::\n\n >>> class FailingStorage(DelegatedStorage):\n ... def __init__(self):\n ... self.storage = list()\n >>> container = FailingStorage()\n Traceback (most recent call last):\n ...\n SchemaNotProvided\n\n\nAnnotations\n===========\n\nThese storage components are used to provide a very flexible\nannotation storage facility.\n\nAnnotation Storage\n------------------\n\n.. attention::\n\n This functionality is detailed in the package's tests. Please, read\n the tests for more information concerning the `AnnotationStorage`.\n\nThe annotation storage provides a way to delegate the storage in an\nannotation container::\n\n >>> import grokcore.component as grok\n >>> from dolmen.storage import AnnotationStorage\n >>> from zope.annotation.interfaces import IAnnotations\n >>> from zope.annotation.interfaces import IAttributeAnnotatable\n\n >>> class Mammoth(object):\n ... '''A furry creature\n ... '''\n ... grok.implements(IAttributeAnnotatable)\n\n >>> class NamedStorage(AnnotationStorage):\n ... grok.name('some.name')\n\n >>> manfred = Mammoth()\n >>> named_storage = NamedStorage(manfred)\n >>> IDelegatedStorage.providedBy(named_storage)\n True\n\n >>> named_storage['test'] = 'This is a simple test'\n >>> list(named_storage.values())\n ['This is a simple test']\n\n >>> annotations = IAnnotations(manfred).get(\"some.name\")\n >>> annotations == named_storage.storage\n True\n >>> annotations['test']\n 'This is a simple test'\n\n\nAnnotation property\n-------------------\n\n.. attention::\n\n This functionality is detailed in the package's tests. Please, read\n the tests for more information concerning the `AnnotationProperty`.\n\nThe annotation property allows a direct access to an annotation\nstorage or value via a FieldProperty-like property::\n\n >>> from zope.schema import TextLine\n >>> from zope.interface import Interface\n >>> from dolmen.storage import AnnotationProperty\n \n >>> class WildMammoth(object):\n ... '''A furry creature\n ... '''\n ... grok.implements(IAttributeAnnotatable)\n\n >>> class IRidingMount(Interface):\n ... rider = TextLine(title=u'Name of the rider', default=None)\n \n >>> class MammothRiding(grok.Adapter):\n ... rider = AnnotationProperty(IRidingMount['rider'])\n\n >>> wooly = WildMammoth()\n >>> annotator = MammothRiding(wooly)\n >>> annotator.rider = u'Grok'\n \n >>> IAnnotations(wooly).get(\"rider\")\n u'Grok'\n\n\nChangelog\n=========\n\n0.4 (2010-12-23)\n----------------\n\n* The delegated ``AnnotationStorage`` now uses a\n ``zope.location.LocationProxy`` to avoid writting the location\n information directly on the storage object. This removes all related\n read/write conflicts.\n\n\n0.3 (2010-02-21)\n----------------\n\n* Cleaned all dependencies. Now, ``dolmen.storage`` is 100% zope.app\n free.\n\n\n0.2 (2009-12-26)\n----------------\n\n* ZTK compatibility imports change.\n\n\n0.1 (2009-10-19)\n----------------\n\n* Initial release", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://gitweb.dolmen-project.org", "keywords": "Grok Zope3 CMS Dolmen", "license": "GPL", "maintainer": null, "maintainer_email": null, "name": "dolmen.storage", "package_url": "https://pypi.org/project/dolmen.storage/", "platform": "Any", "project_url": "https://pypi.org/project/dolmen.storage/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://gitweb.dolmen-project.org" }, "release_url": "https://pypi.org/project/dolmen.storage/0.4/", "requires_dist": null, "requires_python": null, "summary": "Dolmen Zope3 Grok Storage Annotation", "version": "0.4" }, "last_serial": 791339, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "46cb8a19cf7d58df59b46c874a34ce92", "sha256": "0d3c21eb64b921fa07f9d5dfdb810c2cd38f7fa531069659e2f6982db9e6624e" }, "downloads": -1, "filename": "dolmen.storage-0.1.tar.gz", "has_sig": false, "md5_digest": "46cb8a19cf7d58df59b46c874a34ce92", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9445, "upload_time": "2009-10-19T19:45:15", "url": "https://files.pythonhosted.org/packages/dd/cd/290a2235a1c852ace46b5d2794d58c4c044bb66b2150c52c09cca44fd85e/dolmen.storage-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "1093e46f8c83043673767a8fe4cadc51", "sha256": "922caedc1a2b9a7ba777ed5cdbbc3c02543270030b2ccb69d31afcc849251b4c" }, "downloads": -1, "filename": "dolmen.storage-0.2.tar.gz", "has_sig": false, "md5_digest": "1093e46f8c83043673767a8fe4cadc51", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8424, "upload_time": "2009-12-26T19:18:53", "url": "https://files.pythonhosted.org/packages/20/e0/4d1be11995b762bc3bdb77eab64109e217055a6822688a39cefcafaa4e41/dolmen.storage-0.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "58be6b5b8f3b207f9076d567490f5a2e", "sha256": "c3471f09daaf2802ba165649ec23e54738ce9f7945538c873e9bf447f44d3fab" }, "downloads": -1, "filename": "dolmen.storage-0.3.tar.gz", "has_sig": false, "md5_digest": "58be6b5b8f3b207f9076d567490f5a2e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10165, "upload_time": "2010-02-21T19:29:34", "url": "https://files.pythonhosted.org/packages/e8/76/7641f5dd35016cfcac6842fa052c3f8481b60fbe2ce3d508ac039c21cbaf/dolmen.storage-0.3.tar.gz" } ], "0.4": [ { "comment_text": "", "digests": { "md5": "153b60946be0e3a5fde663e4229cece4", "sha256": "41e9c23c4ca73a9ed43dfb0ed1a40e78ed458850576afd2d6bbf4f6134bea775" }, "downloads": -1, "filename": "dolmen.storage-0.4.tar.gz", "has_sig": false, "md5_digest": "153b60946be0e3a5fde663e4229cece4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10211, "upload_time": "2010-12-23T20:38:51", "url": "https://files.pythonhosted.org/packages/34/e7/5d38afe3bc5884d2ceda2860a8e0995ef2490e43d8b33900aac84c16113d/dolmen.storage-0.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "153b60946be0e3a5fde663e4229cece4", "sha256": "41e9c23c4ca73a9ed43dfb0ed1a40e78ed458850576afd2d6bbf4f6134bea775" }, "downloads": -1, "filename": "dolmen.storage-0.4.tar.gz", "has_sig": false, "md5_digest": "153b60946be0e3a5fde663e4229cece4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10211, "upload_time": "2010-12-23T20:38:51", "url": "https://files.pythonhosted.org/packages/34/e7/5d38afe3bc5884d2ceda2860a8e0995ef2490e43d8b33900aac84c16113d/dolmen.storage-0.4.tar.gz" } ] }