{ "info": { "author": "Zope Corporation and Contributors", "author_email": "zope-dev@zope.org", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Environment :: Web Environment", "Framework :: Zope3", "Intended Audience :: Developers", "License :: OSI Approved :: Zope Public License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python", "Topic :: Internet :: WWW/HTTP" ], "description": "This Zope 3 package provides an XML-RPC introspection mechanism.\n\n\nDetailed Documentation\n======================\n\n\n====================\nXMLRPC Introspection\n====================\n\nWhat's introspection now ?\n--------------------------\n\nThis Zope 3 package provides an xmlrpcintrospection mechanism,\nas defined here:\n\n http://xmlrpc-c.sourceforge.net/xmlrpc-howto/xmlrpc-howto-api-introspection.html\n\nIt registers three new xmlrpc methods:\n\n - `listMethods()`: Lists all xmlrpc methods (ie views) registered for the\n current object\n\n - `methodHelp(method_name)`: Returns the method documentation of the given\n method.\n\n - `methodSignature(method_name)`: Returns the method documentation of the\n given method.\n\n\nHow do I use it ?\n-----------------\n\nBasically, if you want to add introspection into your XMLRPCView, you just\nhave to add a decorator for each method of the view, that specifies the return\ntype of the method and the argument types.\n\nThe decorator is called `xmlrpccallable`\n\n >>> from zope.app.xmlrpcintrospection.xmlrpcintrospection import xmlrpccallable\n >>> from zope.app.publisher.xmlrpc import XMLRPCView\n >>> class MySuperXMLRPCView(XMLRPCView):\n ... @xmlrpccallable(str, str, str, str)\n ... def myMethod(self, a, b, c):\n ... \"\"\" my help \"\"\"\n ... return '%s %s, %s, lalalala, you and me, lalalala' % (a, b, c)\n\n`myMethod()` will then be introspectable. (find a full examples below, grep\nfor (*))\n\n\nHow does it works ?\n-------------------\n\nIt is based on introspection mechanisms provided by the apidoc package.\n\n***** ripped form xmlrpc doctests *****\n\nLet's write a view that returns a folder listing:\n\n >>> class FolderListing:\n ... def contents(self):\n ... return list(self.context.keys())\n\nNow we'll register it as a view:\n\n >>> from zope.configuration import xmlconfig\n >>> ignored = xmlconfig.string(\"\"\"\n ... \n ... \n ... \n ...\n ... \n ... \n ... \"\"\")\n\nNow, we'll add some items to the root folder:\n\n >>> print http(r\"\"\"\n ... POST /@@contents.html HTTP/1.1\n ... Authorization: Basic bWdyOm1ncnB3\n ... Content-Length: 73\n ... Content-Type: application/x-www-form-urlencoded\n ...\n ... type_name=BrowserAdd__zope.site.folder.Folder&new_value=f1\"\"\")\n HTTP/1.1 303 See Other\n ...\n\n >>> print http(r\"\"\"\n ... POST /@@contents.html HTTP/1.1\n ... Authorization: Basic bWdyOm1ncnB3\n ... Content-Length: 73\n ... Content-Type: application/x-www-form-urlencoded\n ...\n ... type_name=BrowserAdd__zope.site.folder.Folder&new_value=f2\"\"\")\n HTTP/1.1 303 See Other\n ...\n\nAnd call our xmlrpc method:\n\n >>> print http(r\"\"\"\n ... POST / HTTP/1.0\n ... Authorization: Basic bWdyOm1ncnB3\n ... Content-Length: 102\n ... Content-Type: text/xml\n ...\n ... \n ... \n ... contents\n ... \n ... \n ... \n ... \"\"\")\n HTTP/1.0 200 OK\n ...\n \n \n \n \n \n f1\n f2\n \n \n \n \n \n\n***** end of ripped form xmlrpc doctests *****\n\nNow we want to provide to that view introspection.\nLet's add three new xmlrcp methods, that published\nthe introspection api.\n\n >>> ignored = xmlconfig.string(\"\"\"\n ... \n ... \n ... \n ... \n ... \n ... \"\"\")\n\nThey are linked to XMLRPCIntrospection class, that actually\n knows how to lookup to all interfaces\n\nAnd call our xmlrpc method, that should list the content method:\n\n >>> print http(r\"\"\"\n ... POST / HTTP/1.0\n ... Content-Type: text/xml\n ...\n ... \n ... \n ... listMethods\n ... \n ... \n ... \n ... \"\"\", handle_errors=False)\n HTTP/1.0 200 OK\n ...\n \n \n ...\n contents\n ...\n \n \n\nLet's try to add another method, to se if it gets listed...\n\n >>> class FolderListing2:\n ... def contents2(self):\n ... return list(self.context.keys())\n >>> from zope.configuration import xmlconfig\n >>> ignored = xmlconfig.string(\"\"\"\n ... \n ... \n ... \n ...\n ... \n ... \n ... \"\"\")\n >>> print http(r\"\"\"\n ... POST / HTTP/1.0\n ... Content-Type: text/xml\n ...\n ... \n ... \n ... listMethods\n ... \n ... \n ... \n ... \"\"\", handle_errors=False)\n HTTP/1.0 200 OK\n ...\n \n \n ...\n contents\n contents2\n ...\n \n \n\nNo we want to test methodHelp and methodSignature, to check that it returns,\n\n - The method doc\n\n - The list of attributes\n\nIn RPC, the list of attributes has to be return in an array of type:\n\n[return type, param1 type, param2 type]\n\nSince in Python we cannot have a static type for the method return type,\nwe introduce here a new mechanism based on a decorator, that let the xmlrpcview\ndeveloper add his own signature.\n\nIf the signature is not given, a defaut list is returned:\n\n[None, None, None...]\n\nThe decorator append to the function objet two new parameters,\nto get back the signature.\n\n >>> from zope.app.xmlrpcintrospection.xmlrpcintrospection import xmlrpccallable\n >>> class JacksonFiveRPC:\n ... @xmlrpccallable(str, str, str, str)\n ... def says(self, a, b, c):\n ... return '%s %s, %s, lalalala, you and me, lalalala' % (a, b, c)\n\nLet's try to get back the signature:\n\n >>> JacksonFiveRPC().says.return_type\n \n >>> JacksonFiveRPC().says.parameters_types\n (, , )\n\nThe method is still callable as needed:\n\n >>> JacksonFiveRPC().says('a', 'b', 'c')\n 'a b, c, lalalala, you and me, lalalala'\n\nLet's try out decorated and not decorated methods signatures (*):\n\n >>> class JacksonFiveRPC:\n ... @xmlrpccallable(str, str, str, str)\n ... def says(self, a, b, c):\n ... return '%s %s, %s, lalalala, you and me, lalalala' % (a, b, c)\n ... def says_not_decorated(self, a, b, c):\n ... return '%s %s, %s, lalalala, you and me, lalalala' % (a, b, c)\n >>> from zope.configuration import xmlconfig\n >>> ignored = xmlconfig.string(\"\"\"\n ... \n ... \n ... \n ...\n ... \n ... \n ... \"\"\")\n\nNow let's try to get the signature for `says()`:\n\n >>> print http(r\"\"\"\n ... POST / HTTP/1.0\n ... Content-Type: text/xml\n ...\n ... \n ... \n ... methodSignature\n ... \n ... \n ... says\n ... \n ... \n ... \n ... \"\"\", handle_errors=False)\n HTTP/1.0 200 OK\n ...\n \n \n \n \n \n \n str\n str\n str\n str\n \n \n \n \n \n \n\nNow let's try to get the signature for says_not_decorated()`:\n\n >>> print http(r\"\"\"\n ... POST / HTTP/1.0\n ... Content-Type: text/xml\n ...\n ... \n ... \n ... methodSignature\n ... \n ... \n ... says_not_decorated\n ... \n ... \n ... \n ... \"\"\", handle_errors=False)\n HTTP/1.0 200 OK\n ...\n \n \n \n \n \n \n undef\n undef\n undef\n undef\n \n \n \n \n \n \n\nLast, but not least, the method help:\n\n >>> class JacksonFiveRPCDocumented:\n ... @xmlrpccallable(str, str, str, str)\n ... def says(self, a, b, c):\n ... \"\"\" this is the help for\n ... says()\n ... \"\"\"\n ... return '%s %s, %s, lalalala, you and me, lalalala' % (a, b, c)\n ... def says_not_documented(self, a, b, c):\n ... return '%s %s, %s, lalalala, you and me, lalalala' % (a, b, c)\n >>> from zope.configuration import xmlconfig\n >>> ignored = xmlconfig.string(\"\"\"\n ... \n ... \n ... \n ...\n ... \n ... \n ... \"\"\")\n >>> print http(r\"\"\"\n ... POST / HTTP/1.0\n ... Content-Type: text/xml\n ...\n ... \n ... \n ... methodHelp\n ... \n ... \n ... says\n ... \n ... \n ... \n ... \"\"\", handle_errors=False)\n HTTP/1.0 200 OK\n ...\n \n \n \n \n this is the help for\n says()\n \n \n \n \n \n >>> print http(r\"\"\"\n ... POST / HTTP/1.0\n ... Content-Type: text/xml\n ...\n ... \n ... \n ... methodHelp\n ... \n ... \n ... says_not_documented\n ... \n ... \n ... \n ... \"\"\", handle_errors=False)\n HTTP/1.0 200 OK\n ...\n \n \n \n \n undef\n \n \n \n \n\n\n\n=======\nCHANGES\n=======\n\n3.5.1 (2010-02-06)\n------------------\n\n- Fix test by including zope.login\n- Include ftesting.zcml from zope.app.securitypolicy.browser.tests\n- Include meta.zcml from zope.securitypolicy \n\n3.5.0 (2009-02-01)\n------------------\n\n- Update ``zope.app.folder`` with ``zope.site``.\n\n3.4.0 (2007-11-03)\n------------------\n\n- Initial release independent of the main Zope tree.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://pypi.python.org/pypi/zope.app.xmlrpcintrospection", "keywords": "zope3 xmlrpcintrospection site local component", "license": "ZPL 2.1", "maintainer": null, "maintainer_email": null, "name": "zope.app.xmlrpcintrospection", "package_url": "https://pypi.org/project/zope.app.xmlrpcintrospection/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/zope.app.xmlrpcintrospection/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://pypi.python.org/pypi/zope.app.xmlrpcintrospection" }, "release_url": "https://pypi.org/project/zope.app.xmlrpcintrospection/3.5.1/", "requires_dist": null, "requires_python": null, "summary": "XML-RPC Method Introspection Support for Zope 3", "version": "3.5.1" }, "last_serial": 805080, "releases": { "3.4.0": [ { "comment_text": "", "digests": { "md5": "4589b14688814caa01457848a12aee96", "sha256": "dfffa9894ffc4b696ed1f10f5bf96996e4fee34809d8fb77f1b5511ca87cb9af" }, "downloads": -1, "filename": "zope.app.xmlrpcintrospection-3.4.0.tar.gz", "has_sig": false, "md5_digest": "4589b14688814caa01457848a12aee96", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12426, "upload_time": "2007-11-04T20:43:11", "url": "https://files.pythonhosted.org/packages/ba/3b/d4181cc10734dafa70fb3aa8b845fc313c5926134dabba19a9df4c7c3e9c/zope.app.xmlrpcintrospection-3.4.0.tar.gz" } ], "3.5.0": [ { "comment_text": "", "digests": { "md5": "2864239ae890bc37715a63683f5df41c", "sha256": "df6288d0a7f26d03c7b5b694072023257d781a55112a356ec9013315f86c5e5b" }, "downloads": -1, "filename": "zope.app.xmlrpcintrospection-3.5.0.tar.gz", "has_sig": false, "md5_digest": "2864239ae890bc37715a63683f5df41c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12167, "upload_time": "2009-02-01T19:38:47", "url": "https://files.pythonhosted.org/packages/9d/82/d0d108ec73b5ebc6e8591000c9210adde7cd031c40620ab55365857abe97/zope.app.xmlrpcintrospection-3.5.0.tar.gz" } ], "3.5.0dev": [], "3.5.1": [ { "comment_text": "", "digests": { "md5": "8cf0e7fc13ece3743f96f92d05682d74", "sha256": "fead926e3f1f7f39bc62f5906634d143973d00b7b34f24e691cc2b5bfe7870a6" }, "downloads": -1, "filename": "zope.app.xmlrpcintrospection-3.5.1.tar.gz", "has_sig": false, "md5_digest": "8cf0e7fc13ece3743f96f92d05682d74", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10269, "upload_time": "2010-02-06T04:07:06", "url": "https://files.pythonhosted.org/packages/4c/b9/ec4ad5e62eca449af19c9bb3fb3ef1e0de05a260f0a60e1ca59c9e5e2878/zope.app.xmlrpcintrospection-3.5.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "8cf0e7fc13ece3743f96f92d05682d74", "sha256": "fead926e3f1f7f39bc62f5906634d143973d00b7b34f24e691cc2b5bfe7870a6" }, "downloads": -1, "filename": "zope.app.xmlrpcintrospection-3.5.1.tar.gz", "has_sig": false, "md5_digest": "8cf0e7fc13ece3743f96f92d05682d74", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10269, "upload_time": "2010-02-06T04:07:06", "url": "https://files.pythonhosted.org/packages/4c/b9/ec4ad5e62eca449af19c9bb3fb3ef1e0de05a260f0a60e1ca59c9e5e2878/zope.app.xmlrpcintrospection-3.5.1.tar.gz" } ] }