{ "info": { "author": "Robert Niederreiter", "author_email": "dev@bluedynamics.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Framework :: Zope3", "License :: OSI Approved :: Python Software Foundation License", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Software Development" ], "description": ".. contents:: **Table of Contents**\n\nRequires\n========\n\n- Python2.4+\n\nUsage\n=====\n\nZodict\n------\n\nOrdered dictionary which implements the corresponding\n``zope.interface.common.mapping`` interface.\n::\n\n >>> from zope.interface.common.mapping import IFullMapping\n >>> from zodict import Zodict\n >>> zod = Zodict()\n >>> IFullMapping.providedBy(zod)\n True\n\nNode\n----\n\nThis is a ``zodict`` which provides a location. Location the zope way means\neach item in the node-tree knows its parent and its own name.\n::\n\n >>> from zope.location.interface import ILocation\n >>> from zodict import Node\n >>> root = Node('root')\n >>> ILocation.providedBy(Node)\n True\n\n >>> root['child'] = Node()\n >>> root['child'].path\n ['root', 'child']\n\n >>> child = root['child']\n >>> child.__name__\n 'child'\n\n >>> child.__parent__\n \n\nThe ``filtereditems`` function.\n::\n\n >>> from zope.interface import Interface\n >>> from zope.interface import alsoProvides\n >>> class IMarker(Interface): pass\n >>> alsoProvides(root['child']['subchild'], IMarker)\n >>> IMarker.providedBy(root['child']['subchild'])\n True\n\n >>> for item in root['child'].filtereditems(IMarker):\n ... print item.path\n ['root', 'child', 'subchild']\n\nUUID related operations on Node.\n::\n\n >>> uuid = root['child']['subchild'].uuid\n >>> uuid\n UUID('...')\n\n >>> root.node(uuid).path\n ['root', 'child', 'subchild']\n\n >>> root.uuid = uuid\n Traceback (most recent call last):\n ...\n ValueError: Given uuid was already used for another Node\n\n >>> import uuid\n >>> newuuid = uuid.uuid4()\n\n >>> root.uuid = newuuid\n >>> root['child'].node(newuuid).path\n ['root']\n\nNode insertion (an insertafter function exist as well).\n::\n\n >>> root['child1'] = Node()\n >>> root['child2'] = Node()\n\n >>> node = Node('child3')\n >>> root.insertbefore(node, root['child2'])\n >>> root.printtree()\n : root\n : child1\n : child3\n : child2\n\nMove a node. Therefor we first need to detach the node we want to move from\ntree. Then insert the detached node elsewhere. In general, you can insert the\ndetached node or subtree to a complete different tree.\n::\n\n >>> len(root._index.keys())\n 6\n\n >>> node = root.detach('child4')\n >>> node\n \n\n >>> len(node._index.keys())\n 1\n >>> len(root._index.keys())\n 5\n\n >>> len(root.values())\n 4\n\n >>> root.insertbefore(node, root['child1'])\n >>> root.printtree()\n : root\n : child4\n : child1\n : child3\n : child5\n : child2\n\nMerge 2 Node Trees.\n::\n\n >>> tree1 = Node()\n >>> tree1['a'] = Node()\n >>> tree1['b'] = Node()\n >>> tree2 = Node()\n >>> tree2['d'] = Node()\n >>> tree2['e'] = Node()\n >>> tree1._index is tree2._index\n False\n\n >>> len(tree1._index.keys())\n 3\n\n >>> tree1.printtree()\n : None\n : a\n : b\n\n >>> len(tree2._index.keys())\n 3\n\n >>> tree2.printtree()\n : None\n : d\n : e\n\n >>> tree1['c'] = tree2\n >>> len(tree1._index.keys())\n 6\n\n >> sorted(tree1._index.values(), key=lambda x: x.__name__)\n\n >>> tree1._index is tree2._index\n True\n\n >>> tree1.printtree()\n : None\n : a\n : b\n : c\n : d\n : e\n\nLifecycleNode\n-------------\n\nThe ``LifecycleNode`` is able to send out notifies with object-events based on\n``zope.lifecycleevent`` subclasses.\n\nCreation of Node\n ``zodict.events.NodeCreatedEvent`` implementing\n ``zodict.interfaces.INodeCreatedEvent``.\n\nAdding childs to Node\n ``zodict.events.NodeAddedEvent`` implementing\n ``zodict.interfaces.INodeAddedEvent``.\n\nDeleting childs from Node\n ``zodict.events.NodeRemovedEvent`` implementing\n ``zodict.interfaces.INodeRemovedEvent``.\n\nDetaching childs from Node\n ``zodict.events.NodeDetachedEvent`` implementing\n ``zodict.interfaces.INodeDetachedEvent``.\n\nIn subclasses of Node the event classes can be exchanged by modifying the\nclass attribute ``events`` on the node. It is a dictionary with the keys:\n``['created', 'added', 'removed', 'detached']``\n\nThread safe Locking of a Tree\n-----------------------------\n\nNot ``Node`` nor ``LifecycleNode`` are thread safe. Application-builder are\nresponsible for this. Major reason: Acquiring and releasing locks is an\nexpensive operation.\n\nThe module ``zodict.locking`` provides a mechanism to lock the whole tree\nthread safe. A class and a decorator is provided. The class is intended to be\nused standalone with some Node, the decorator to be used on subclasses of\n``Node`` or ``LifecycleNode``.\n\n``zodict.locking.TreeLock`` is a adapter like class on a Node. It can be used\nin Python > 2.6 within the ``with`` statement.\n::\n\n >>> node = Node()\n >>> with TreeLock(node):\n >>> # do something on the locked tree\n >>> node['foo'] = Node()\n\nAlternative it can be used in older Python version with in a try: finally.\n::\n\n >>> from zodict.locking import TreeLock\n >>> lock = TreeLock(node)\n >>> lock.acquire()\n >>> try:\n >>> # do something on the locked tree\n >>> node['bar'] = Node()\n >>> finally:\n >>> lock.release()\n\n``zodict.locking.locktree`` Decorator for methods of a (sub-)class of ``Node``.\n::\n\n >>> from zodict.locking import locktree\n >>> class LockedNode(Node):\n ...\n ... @locktree\n ... def __setitem__(self, key, val):\n ... super(LockedNode, self).__setitem__(key, val)\n\nChanges\n=======\n\nVersion 1.9.3\n-------------\n\n- Provide abstract ``_Node`` implementation.\n [rnix, 2010-07-08]\n\n- Typos in documentation.\n [thet, 2010-07-06]\n\n- BBB imports in except block rather than trying it first.\n [thet, 2010-07-06]\n\n- Buildout configuration for testing purposes.\n [thet, 2010-07-06]\n\nVersion 1.9.2\n-------------\n\n- set ``child.__name__`` and ``child.__parent__`` before ``child.keys()`` call\n for index check in ``Node.__setitem__``. ``keys()`` of child might depend\n on those.\n [rnix, 2010-05-01]\n\n- Separated ``AttributedNode`` from ``LifecycleNode``, so attributes can be used\n without events now.\n [jensens, 2010-04-28]\n\nVersion 1.9.1\n-------------\n\n- Add test for bool evaluation\n [rnix, 2010-04-21]\n\n- Add ``__setattr__`` and ``__getattr__`` to ``NodeAttributes`` object.\n [rnix, 2010-04-21]\n\n- BBB compatibility for zope2.9\n [rnix, jensens, 2010-02-17]\n\nVersion 1.9.0\n-------------\n\n- Make zodict compatible with python 2.4 again, BBB\n [jensens, 2009-12-23]\n\n- Add locking test\n [rnix, 2009-12-23]\n\n- Refactor locking, remove tree-locking from Node base implementations.\n Add easy to use locking class and a decorator intended to be used in\n applications and subclasses of ``Node``.\n [jensens, 2009-12-23]\n\n- Introduce ``ICallableNode``, ``ILeaf`` and ``IRoot`` interfaces.\n [rnix, 2009-12-23]\n\n- Change Lisence to PSF\n [rnix, 2009-12-22]\n\n- Add ``zodict.node.NodeAttributes`` object.\n [rnix, 2009-12-22]\n\n- Add ``attributes`` Attribute to ``LifecycleNode``.\n [rnix, 2009-12-22]\n\n- Add ``ILifecycleNode`` and ``INodeAttributes`` interfaces.\n [rnix, 2009-12-22]\n\n- Removed typo in private variable name. added notify-suppress to setitem of\n ``LifecycleNode``.\n [jensens, 2009-12-22]\n\nVersion 1.8.0\n-------------\n\n- Added ``zope.lifecycle`` events to the new ``LifecycleNode``. You can\n easiely override them with your own events.\n [jensens, 2009-12-21]\n\n- Renamed class ``zodict`` to ``Zodict``, renamed module ``zodict.zodict`` to\n ``zodict._zodict``. This avoids ugly clashes on import (package vs. module\n vs.class). BBB import is provided in the 1.x release series.\n [jensens, 2009-12-21]\n\nVersion 1.7.0\n-------------\n\n- Add ``Node.detach`` function. Needed for node or subtree moving. This is\n done due to performance reasons.\n [rnix, 2009-12-18]\n\n- ``Node.index`` returns now a ``NodeIndex`` object, which implements\n ``zope.interface.common.mapping.IReadMapping``. This functions convert uuid\n instances to integers before node lookup. So we still fit the contract of\n returning nodes from index by uuid.\n [rnix, 2009-12-18]\n\n- Change type of keys of ``Node._index`` to int. ``uuid.UUID.__hash__``\n function was called too often\n [jensens, rnix, 2009-12-18]\n\n- make ``Node`` thread safe.\n [jensens, rnix, 2009-12-18]\n\nVersion 1.6.1\n-------------\n\n- make ``Node`` trees merge properly.\n [rnix, 2009-12-15]\n\n- make getter and setter functions of ``uuid`` property private.\n [rnix, 2009-12-15]\n\nVersion 1.6.0\n-------------\n\n- remove the ``traverser`` module.\n [rnix, 2009-11-28]\n\n- improve ``insertbefore`` and ``insertafter`` a little bit.\n [rnix, 2009-11-28]\n\n- add ``index`` Attribute to ``Node``. Allows access to the internal\n ``_index`` attribute.\n [rnix, 2009-11-28]\n\n- remove ``@accept`` and ``@return`` decorators. Just overhead.\n [rnix, 2009-11-28]\n\nVersion 1.5.0\n-------------\n\n- add ``insertbefore`` and ``insertafter`` function to ``Node``.\n [rnix, 2009-11-27]\n\n- fix ``printtree`` if ``Node.__name__`` is ``None``.\n [rnix, 2009-11-20]\n\n- add ``printtree`` debug helper function to ``Node``.\n [rnix, 2009-11-09]\n\n- define own Traverser interface and reduce dependencies.\n [rnix, 2009-10-28]\n\n- removed import of tests from zodicts ``__init__``. this caused import errors\n if ``interlude`` wasnt installed.\n [jensens, 2009-07-16]\n\nVersion 1.4.0\n-------------\n\n- Don't allow classes as values of a ``Node``. Attribute ``__name__``\n conflicts.\n [jensens, 2009-05-06]\n\n- ``repr(nodeobj)`` now returns the real classname and not fixed\n ``\n\n- Contributions and ideas by Jens Klein ", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://svn.plone.org/svn/archetypes/AGX/zodict", "keywords": "odict zodict tree node leaf datamodel container", "license": "Python Software Foundation License", "maintainer": null, "maintainer_email": null, "name": "zodict", "package_url": "https://pypi.org/project/zodict/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/zodict/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://svn.plone.org/svn/archetypes/AGX/zodict" }, "release_url": "https://pypi.org/project/zodict/1.9.3/", "requires_dist": null, "requires_python": null, "summary": "zope.interface compliant ordered dictionary and zope.location aware node.", "version": "1.9.3" }, "last_serial": 802319, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "5bdf8f6ee93b38dbab8bc39009880cec", "sha256": "4f60bbaf858e83a838cf6ccecf5da433f9df4c0135c4fd042f3d060b535db2cb" }, "downloads": -1, "filename": "zodict-1.0.tar.gz", "has_sig": false, "md5_digest": "5bdf8f6ee93b38dbab8bc39009880cec", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1642, "upload_time": "2009-03-17T12:47:32", "url": "https://files.pythonhosted.org/packages/10/7c/f6e6fa3f18e18d52b8401f64939fe392ac1bb7547b065ec97916f25bc1fd/zodict-1.0.tar.gz" } ], "1.1": [ { "comment_text": "", "digests": { "md5": "e87d4508cc733b8cdd47f612b160588c", "sha256": "eef33b44559dcc85232b20fd283a625b73aedfd02e1a9926dcde07bd55ad41d2" }, "downloads": -1, "filename": "zodict-1.1.tar.gz", "has_sig": false, "md5_digest": "e87d4508cc733b8cdd47f612b160588c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2937, "upload_time": "2009-03-18T10:38:37", "url": "https://files.pythonhosted.org/packages/b3/c3/c902a15c9147e7af733a8b5df5300a64b8ec113e19d0cf2538fefb8b3566/zodict-1.1.tar.gz" } ], "1.2": [ { "comment_text": "", "digests": { "md5": "6b8252a086a29831a522c1079efcadd4", "sha256": "470c3eb0398ee01adf384f890cae8eba8ff4c42d24626c1c59b0a61936eed60c" }, "downloads": -1, "filename": "zodict-1.2.tar.gz", "has_sig": false, "md5_digest": "6b8252a086a29831a522c1079efcadd4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3165, "upload_time": "2009-03-22T15:43:48", "url": "https://files.pythonhosted.org/packages/2a/43/62fb3ed32bfc991b1ceb0e28dabb690ebb1165b703903f42c9ea82491ad2/zodict-1.2.tar.gz" } ], "1.3": [ { "comment_text": "", "digests": { "md5": "129b13e3729fbd187554831bd9387bda", "sha256": "2b5ac7fccd5e0ba67b11c7b9126400c6db3c2e9a9c60af01038dc3b338d6d5a8" }, "downloads": -1, "filename": "zodict-1.3.tar.gz", "has_sig": false, "md5_digest": "129b13e3729fbd187554831bd9387bda", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4222, "upload_time": "2009-03-23T10:56:42", "url": "https://files.pythonhosted.org/packages/50/3d/724cd8fcfe1ff6b37a8a522b705c16f020999c8a11648b77dd1d1c824eed/zodict-1.3.tar.gz" } ], "1.3.1": [ { "comment_text": "", "digests": { "md5": "29264cd1e882c534d976bdb74659462c", "sha256": "899defbce47c2bc66abfe8d3efeb167ecc68a99923206672590a621c4e09352d" }, "downloads": -1, "filename": "zodict-1.3.1.tar.gz", "has_sig": false, "md5_digest": "29264cd1e882c534d976bdb74659462c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4549, "upload_time": "2009-04-16T16:08:26", "url": "https://files.pythonhosted.org/packages/b8/b4/52bdda0f28de50b2a41e850d32825b5eb4bfa0dfae0a6b4f5cce812e047b/zodict-1.3.1.tar.gz" } ], "1.4.0": [ { "comment_text": "", "digests": { "md5": "6d3f6d443c83187f828655711d656848", "sha256": "6229aa07dc4a477d8d1772013b9ca67575e6168321911475631a6e4dda7fa27e" }, "downloads": -1, "filename": "zodict-1.4.0.tar.gz", "has_sig": false, "md5_digest": "6d3f6d443c83187f828655711d656848", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5558, "upload_time": "2009-07-16T13:57:59", "url": "https://files.pythonhosted.org/packages/97/59/7c30a3e279bbe4b1a979679f46046a28291bdc279e64b5c9c81d1a25d872/zodict-1.4.0.tar.gz" } ], "1.4.1": [ { "comment_text": "", "digests": { "md5": "a0c1a4d0fa222d00a6f6be44817abc18", "sha256": "931e55232432b96091ecb0dbdc2bc872b46b242f42c32540649f88dfea775acb" }, "downloads": -1, "filename": "zodict-1.4.1.tar.gz", "has_sig": false, "md5_digest": "a0c1a4d0fa222d00a6f6be44817abc18", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5718, "upload_time": "2009-08-03T14:43:50", "url": "https://files.pythonhosted.org/packages/d5/39/4a604281c6b52ca74018dd60292e583a1791a4933dfcfec309eae60fd6a8/zodict-1.4.1.tar.gz" } ], "1.5.0": [ { "comment_text": "", "digests": { "md5": "0f88b9c9bf8ab26aa7f73ba570f8373b", "sha256": "3957ee0e9f560430e4bd8ca11313b37dd43e68a7d84a9d9d3084b4888029961f" }, "downloads": -1, "filename": "zodict-1.5.0.tar.gz", "has_sig": false, "md5_digest": "0f88b9c9bf8ab26aa7f73ba570f8373b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8008, "upload_time": "2009-11-27T21:22:51", "url": "https://files.pythonhosted.org/packages/b8/36/8d750e5159dd9996af3dc3fa8e26a67fdca08e3971fd6c718a96dfcfcff7/zodict-1.5.0.tar.gz" } ], "1.6.0": [ { "comment_text": "", "digests": { "md5": "13d260262132a75e95db1d8fa80c58ac", "sha256": "6e8c2071e47c9bbcefc480ab8898de8be6d09f92a93cd1e847a965bfd10bbb22" }, "downloads": -1, "filename": "zodict-1.6.0.tar.gz", "has_sig": false, "md5_digest": "13d260262132a75e95db1d8fa80c58ac", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6882, "upload_time": "2009-11-30T09:16:22", "url": "https://files.pythonhosted.org/packages/e8/57/8851432615d5682b2c56974ed55f795bfc6386bf1389618d4c334058b38a/zodict-1.6.0.tar.gz" } ], "1.6.1": [ { "comment_text": "", "digests": { "md5": "b1d0de9f5b6b67315a33ff05286d9ed0", "sha256": "01d1fbbff39f4db2cbf36c626b826d143eba5141aeddb1db02d8269cdc038096" }, "downloads": -1, "filename": "zodict-1.6.1.tar.gz", "has_sig": false, "md5_digest": "b1d0de9f5b6b67315a33ff05286d9ed0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7349, "upload_time": "2009-12-15T18:37:52", "url": "https://files.pythonhosted.org/packages/ee/34/af227250ed5ab1304bd9d4ad5b59fc1240656cc4635fdb62f565e645fed0/zodict-1.6.1.tar.gz" } ], "1.7.0": [ { "comment_text": "", "digests": { "md5": "ff19fe41ea85ba0c1c6c87af7ab01a93", "sha256": "5234624b8898d6b47616a81c522cbaeceba246d11cb90c61d571fc792d45914d" }, "downloads": -1, "filename": "zodict-1.7.0.tar.gz", "has_sig": false, "md5_digest": "ff19fe41ea85ba0c1c6c87af7ab01a93", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9338, "upload_time": "2009-12-18T22:05:05", "url": "https://files.pythonhosted.org/packages/45/1a/6efa377d5c9999d3848efcc9cf33d36c4fee5163f2416d54358c4b532ea9/zodict-1.7.0.tar.gz" } ], "1.8.0": [ { "comment_text": "", "digests": { "md5": "320fb09174e88646f526774317d870b1", "sha256": "f1c6084df5e9efaefc04adf4b0b402662cb9ed7b104e246da59306604b6efcaa" }, "downloads": -1, "filename": "zodict-1.8.0.tar.gz", "has_sig": false, "md5_digest": "320fb09174e88646f526774317d870b1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10258, "upload_time": "2009-12-21T17:05:10", "url": "https://files.pythonhosted.org/packages/7d/b8/887f0c180a9762c023a6a5cee305cc33153579870242b81b459913a7c14f/zodict-1.8.0.tar.gz" } ], "1.9.0": [ { "comment_text": "", "digests": { "md5": "715d0f93e4ed39c4e7a3401308510445", "sha256": "2fe9de8ab4e17e23c61d2bcd9140181a0f112ae7c0d524db76ab260802dfbce0" }, "downloads": -1, "filename": "zodict-1.9.0.tar.gz", "has_sig": false, "md5_digest": "715d0f93e4ed39c4e7a3401308510445", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14345, "upload_time": "2009-12-23T17:51:08", "url": "https://files.pythonhosted.org/packages/5d/ea/ee9388aed419596c1c0aa1d6f24f7839923e83a08f45977d3f61334ac1a8/zodict-1.9.0.tar.gz" } ], "1.9.1": [ { "comment_text": "", "digests": { "md5": "9671d69cd3925a4afc14043d7dc81b65", "sha256": "4756b1432279ca9555098e1aa0726542494b7f92e4c1bcc2955f1aa2cbbf7eef" }, "downloads": -1, "filename": "zodict-1.9.1.tar.gz", "has_sig": false, "md5_digest": "9671d69cd3925a4afc14043d7dc81b65", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15593, "upload_time": "2010-04-24T10:45:44", "url": "https://files.pythonhosted.org/packages/bd/0b/6c06060963f43d072a3d766d359e47707c065f4582cd1f03710e8fd85b7c/zodict-1.9.1.tar.gz" } ], "1.9.2": [ { "comment_text": "", "digests": { "md5": "862237c8441e973d0a67c22bc591f08a", "sha256": "fd99e49c2776e6c01e149d61f949f8debff6ce24520c578e817803c1be8b2a08" }, "downloads": -1, "filename": "zodict-1.9.2.tar.gz", "has_sig": false, "md5_digest": "862237c8441e973d0a67c22bc591f08a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15885, "upload_time": "2010-05-01T10:40:24", "url": "https://files.pythonhosted.org/packages/f2/d6/3379cae508643b17ef421378520e530dc26fcfe2de6f0c3816ad08a7ac7e/zodict-1.9.2.tar.gz" } ], "1.9.3": [ { "comment_text": "", "digests": { "md5": "dce7c57b6b5e2f60d4725a4cc0400885", "sha256": "a3d3e5cbb82d0e8ded9e4c80d11b01e02367c32acab8ac3ae9ae60b9812b4dff" }, "downloads": -1, "filename": "zodict-1.9.3.tar.gz", "has_sig": false, "md5_digest": "dce7c57b6b5e2f60d4725a4cc0400885", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18028, "upload_time": "2010-07-08T15:05:11", "url": "https://files.pythonhosted.org/packages/f0/9f/aba250ff7309fafe22aa6ea28d8cfdf02088151b5a1eb4093b5e08172659/zodict-1.9.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "dce7c57b6b5e2f60d4725a4cc0400885", "sha256": "a3d3e5cbb82d0e8ded9e4c80d11b01e02367c32acab8ac3ae9ae60b9812b4dff" }, "downloads": -1, "filename": "zodict-1.9.3.tar.gz", "has_sig": false, "md5_digest": "dce7c57b6b5e2f60d4725a4cc0400885", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18028, "upload_time": "2010-07-08T15:05:11", "url": "https://files.pythonhosted.org/packages/f0/9f/aba250ff7309fafe22aa6ea28d8cfdf02088151b5a1eb4093b5e08172659/zodict-1.9.3.tar.gz" } ] }