{ "info": { "author": "Sebastian Wehrmann", "author_email": "sw@gocept.com", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "License :: OSI Approved :: Zope Public License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Database" ], "description": "===================\nsw.objectinspection\n===================\n\nObjectInspection is a tool, that provides you with a generic API to inspect\nobjects for their attributes and their children objects. It comes with two\nbasic inspectors (`BasicAttributesInspector` and `BasicChildrenInspector`)\nwhich can be easily replaced with your own inspectors.\n\n\nSetup\n=====\n\nCreate some objects, which are inspected later on:\n\n >>> class Child1(object):\n ... pass\n >>> class Child2(object):\n ... pass\n >>> class Child3(object):\n ... pass\n >>> class Child4(object):\n ... misc = Child1()\n >>> class ToInspect(object):\n ... some_var = [\"some tupel\", (Child2(), Child3())]\n ... other_var = {\"foo\": \"bar\"}\n ... _private_var = 10\n ... desc = Child4()\n ...\n ... def some_method(self):\n ... pass\n\n\nInspecting for attributes\n=========================\n\nGet the `AttributesInspector` by adapting to `IAttributesInspector`:\n\n >>> from sw.objectinspection import IAttributesInspector\n >>> inspector = IAttributesInspector(ToInspect())\n\nBecause there is no specialized inspector for the `ToInspect` object registered,\nthe `BasicAttributesInspector` is used:\n\n >>> inspector\n \n\nTo start the inspection, simply call the inspector:\n\n >>> inspector()\n ['desc', 'other_var', 'some_var']\n\n\nInspecting for children\n=======================\n\nInspection for children works the same way like inspection for attributes:\n\n >>> from sw.objectinspection import IChildrenInspector\n >>> inspector = IChildrenInspector(ToInspect())\n\n >>> inspector\n \n\n >>> sorted(inspector())\n [,\n ,\n ]\n\n\nWriting own inspectors\n======================\n\nYou can write your own inspector and register it as a more special adapter than\nthe basic ones which come with this package:\n\n >>> from sw.objectinspection import BasicInspector\n >>> import zope.component\n >>> import zope.interface\n\n >>> class DummyAttributesInspector(BasicInspector):\n ... zope.component.adapts(ToInspect)\n ... zope.interface.implements(IAttributesInspector)\n ...\n ... def __call__(self):\n ... # The object, which is to be inspected, can be accessed\n ... # with self._inspecting\n ... return ['foo', 'bar']\n\n >>> gsm = zope.component.getGlobalSiteManager()\n >>> gsm.registerAdapter(DummyAttributesInspector)\n\nNow, when inspecting `ToInspect` for attributes, we get our\n`DummyAttributesInspector`:\n\n >>> inspector = IAttributesInspector(ToInspect())\n >>> inspector\n \n >>> inspector()\n ['foo', 'bar']\n\n\n=======\nCHANGES\n=======\n\n\n1.0.1 (2009-08-13)\n==================\n\n- Fix the checker for the memory address for systems running windows.\n\n\n1.0 (2009-07-29)\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": "UNKNOWN", "keywords": null, "license": "ZPL 2.1", "maintainer": null, "maintainer_email": null, "name": "sw.objectinspection", "package_url": "https://pypi.org/project/sw.objectinspection/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/sw.objectinspection/", "project_urls": { "Download": "UNKNOWN", "Homepage": "UNKNOWN" }, "release_url": "https://pypi.org/project/sw.objectinspection/1.0.1/", "requires_dist": null, "requires_python": null, "summary": "Provides an API to access an objects references (children).", "version": "1.0.1" }, "last_serial": 800284, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "a49678312f26def906bda06fbf6b2b2c", "sha256": "a56c68685f89e6e0aee8bf65802d8782a223406e67e0985d6cea79e36f5fbbfa" }, "downloads": -1, "filename": "sw.objectinspection-1.0.tar.gz", "has_sig": true, "md5_digest": "a49678312f26def906bda06fbf6b2b2c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6016, "upload_time": "2009-07-29T09:11:39", "url": "https://files.pythonhosted.org/packages/0c/f7/e28b0640f2cbea78934793d805f0506c55e750a84e3b1f81f17ba0e3993e/sw.objectinspection-1.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "c6317db01973baf4af7b88bd785d4664", "sha256": "7b1706b842ce031968bb38858eec9053a9ced316a755f1af78c77a264b6e6eea" }, "downloads": -1, "filename": "sw.objectinspection-1.0.1.tar.gz", "has_sig": false, "md5_digest": "c6317db01973baf4af7b88bd785d4664", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6158, "upload_time": "2009-08-13T16:25:29", "url": "https://files.pythonhosted.org/packages/72/87/0aa066ed3d1cce67d46e7cdb7c93f6177c6963e4014d6dc6922c2a137a1a/sw.objectinspection-1.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c6317db01973baf4af7b88bd785d4664", "sha256": "7b1706b842ce031968bb38858eec9053a9ced316a755f1af78c77a264b6e6eea" }, "downloads": -1, "filename": "sw.objectinspection-1.0.1.tar.gz", "has_sig": false, "md5_digest": "c6317db01973baf4af7b88bd785d4664", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6158, "upload_time": "2009-08-13T16:25:29", "url": "https://files.pythonhosted.org/packages/72/87/0aa066ed3d1cce67d46e7cdb7c93f6177c6963e4014d6dc6922c2a137a1a/sw.objectinspection-1.0.1.tar.gz" } ] }