{ "info": { "author": "Christian Zagrodnick", "author_email": "mail@gocept.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Framework :: Zope3", "Intended Audience :: Developers", "License :: OSI Approved", "License :: OSI Approved :: Zope Public License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", "Topic :: Software Development :: Libraries", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "================\n gocept.pagelet\n================\n\nEasier z3c.pagelet handling\n\n.. contents::\n\n\nCopyright (c) 2007-2016 gocept gmbh & co. kg\nAll Rights Reserved.\n\nThis software is subject to the provisions of the Zope Public License,\nVersion 2.1 (ZPL). A copy of the ZPL should accompany this distribution.\nTHIS SOFTWARE IS PROVIDED \"AS IS\" AND ANY AND ALL EXPRESS OR IMPLIED\nWARRANTIES ARE DISCLAIMED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED\nWARRANTIES OF TITLE, MERCHANTABILITY, AGAINST INFRINGEMENT, AND FITNESS\nFOR A PARTICULAR PURPOSE.\n\n\n=========\n Changes\n=========\n\n1.1 (2019-06-10)\n================\n\n- Claim support of Python 3.5, 3.6, 3.7, 3.8, PyPy and PyPy3.\n\n- Use tox for testing.\n\n\n1.0 (2016-04-06)\n================\n\n- Update `bootstrap.py` to a ``zc.buildout 2.3``.\n\n- Use py.test as test runner.\n\n- Declare the explicit support of Python 2.7.\n No other Python versions are currently supported.\n\n0.4 (2013-03-28)\n================\n\n- When registering a pagelet using ZCML which only has template, the name of\n the template is rendered in the ``repr`` the generated class to have a\n clue what is the purpose of this class when debugging.\n\n- Updated tests to use Python's `doctest` instead of deprecated\n `zope.testing.doctest`.\n\n\n0.3 (2009-12-27)\n================\n\n- Using ``zope.browserpage`` and ``zope.browsermenu`` instead of\n ``zope.app.publisher``.\n\n\n0.2 (2009-12-27)\n================\n\n- Allow arbitrary number of context elements for adaptation.\n\n0.1 (2008-09-20)\n================\n\n- First public release.\n\n\n==============\n Contributors\n==============\n\n- Michael Howitz \n\n- Christian Theune \n\n\n=============================\nEasy z3c.pagelet registration\n=============================\n\nThe `` directive allows easier registration of\nz3c.pagelets. It behaves quite like ``.\n\nSetup\n=====\n\nWe need some zcml setup:\n\n>>> import sys\n>>> from zope.configuration import xmlconfig\n>>> import gocept.pagelet\n>>> context = xmlconfig.file('meta.zcml', gocept.pagelet)\n\n\nTemplate only\n=============\n\nIt is possible to just use a template as pagelet. A class is not required:\n\n>>> context = xmlconfig.string(\"\"\"\n... \n... \n... \n... \"\"\", context)\n\nWe should now have a page:\n\n>>> import zope.component\n>>> from zope.publisher.browser import TestRequest\n>>> pagelet = zope.component.getMultiAdapter(\n... (object, TestRequest()), name='index.html')\n>>> pagelet\n\n>>> pagelet.__name__\nu'index.html'\n\nWhen we render the pagelet the test-template is used:\n\n>>> pagelet.render()\nu'Hello from the test template.\\n'\n\n\nClass only\n==========\n\nOf course it's also possible to register a class without a template. Create a\nclass and make it available in a module:\n\n\n>>> from z3c.pagelet.browser import BrowserPagelet\n>>> class MyPagelet(BrowserPagelet):\n... \"\"\"Custom pagelet\"\"\"\n... def render(self):\n... return u\"Hello from the custom pagelet.\"\"\"\n\nMake it available under the fake package ``custom``:\n\n>>> sys.modules['custom'] = type(\n... 'Module', (),\n... {'MyPagelet': MyPagelet})()\n\n\nMake it available via ZCML:\n\n>>> context = xmlconfig.string(\"\"\"\n... \n... \n... \n... \"\"\", context)\n\nGet the pagelet:\n\n>>> pagelet = zope.component.getMultiAdapter(\n... (object, TestRequest()), name='class.html')\n>>> pagelet\n\n>>> pagelet.render()\nu'Hello from the custom pagelet.'\n\n\n\nClass and template\n==================\n\nIt's for course also possible to specify both class and template. So create\nanother pagelet class and register it:\n\n>>> class MyPagelet2(BrowserPagelet):\n... \"\"\"Custom pagelet\"\"\"\n... i_am_very_custom = True\n>>> sys.modules['custom'] = type(\n... 'Module', (),\n... {'MyPagelet': MyPagelet2})()\n\n\nMake it available via zcml:\n\n>>> context = xmlconfig.string(\"\"\"\n... \n... \n... \n... \"\"\", context)\n\n>>> pagelet = zope.component.getMultiAdapter(\n... (object, TestRequest()), name='class-template.html')\n>>> pagelet\n\n>>> pagelet.render()\nu'Hello from the test template.\\n'\n>>> pagelet.i_am_very_custom\nTrue", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://bitbucket.org/gocept/gocept.pagelet", "keywords": "easy z3c.pagelet zope3 pagelet zope", "license": "ZPL 2.1", "maintainer": "", "maintainer_email": "", "name": "gocept.pagelet", "package_url": "https://pypi.org/project/gocept.pagelet/", "platform": "", "project_url": "https://pypi.org/project/gocept.pagelet/", "project_urls": { "Homepage": "https://bitbucket.org/gocept/gocept.pagelet" }, "release_url": "https://pypi.org/project/gocept.pagelet/1.1/", "requires_dist": null, "requires_python": "", "summary": "Easier z3c.pagelet handling", "version": "1.1" }, "last_serial": 5379814, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "36d8c07d818d8bfca8e69219c658ff7b", "sha256": "d6ed99e9aec0a77a203f6e71e44ee5f19321b346df0de0cd8540557e77ab91c4" }, "downloads": -1, "filename": "gocept.pagelet-0.1.tar.gz", "has_sig": false, "md5_digest": "36d8c07d818d8bfca8e69219c658ff7b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5736, "upload_time": "2008-09-20T12:06:38", "url": "https://files.pythonhosted.org/packages/de/e4/f2b69736b53721b6a23a37bcc5bb77a5062b1ede8b9cb0a19a4a3a7b663a/gocept.pagelet-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "ca4a389294a7731d509ea29520694441", "sha256": "fc59d857e6f1b6d41fe8131aa50f250f77a90e13930e752a0a44f384278baeb2" }, "downloads": -1, "filename": "gocept.pagelet-0.2.tar.gz", "has_sig": false, "md5_digest": "ca4a389294a7731d509ea29520694441", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6600, "upload_time": "2009-12-27T13:12:15", "url": "https://files.pythonhosted.org/packages/37/2c/b54f98eb24524a3bad90f9618c01c2a49098d9d34085a26aab3398499867/gocept.pagelet-0.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "42a45e917b0d470e5dd4f92d1d9575d7", "sha256": "0c122b70c266a832ab879b18031145a98e5ddcbee3ce02941efff165b83d9404" }, "downloads": -1, "filename": "gocept.pagelet-0.3.tar.gz", "has_sig": false, "md5_digest": "42a45e917b0d470e5dd4f92d1d9575d7", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6643, "upload_time": "2009-12-27T13:42:37", "url": "https://files.pythonhosted.org/packages/35/67/7964c3ef7e7bc33687dd5f29146ec2c1bc901280c207029b4e28a19a40be/gocept.pagelet-0.3.tar.gz" } ], "0.4": [ { "comment_text": "", "digests": { "md5": "aebebc4e00e551cba8413122bc5c915b", "sha256": "7c31aacf51fd0a7a7f80bf2c398ba42492e34d9d33c35393e147a0859a74992a" }, "downloads": -1, "filename": "gocept.pagelet-0.4.zip", "has_sig": false, "md5_digest": "aebebc4e00e551cba8413122bc5c915b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17465, "upload_time": "2013-03-28T09:13:45", "url": "https://files.pythonhosted.org/packages/80/b3/f42be9ca11785884bc8bdaa903d612075bf13ac0ca044adeaf1a7a276b35/gocept.pagelet-0.4.zip" } ], "1.0": [ { "comment_text": "", "digests": { "md5": "47a6ce0ece830efd247f5516b37c9ad4", "sha256": "c8c04c1927d8ae5df83961ce9069f5fb07d9ed55dd43949d40e764ee3039a32b" }, "downloads": -1, "filename": "gocept.pagelet-1.0.tar.gz", "has_sig": false, "md5_digest": "47a6ce0ece830efd247f5516b37c9ad4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11503, "upload_time": "2016-04-06T14:46:03", "url": "https://files.pythonhosted.org/packages/d4/aa/272f4fa979f69517087be99f9b55639fbb543fe1574c7b32c959bb5a9fc2/gocept.pagelet-1.0.tar.gz" } ], "1.1": [ { "comment_text": "", "digests": { "md5": "e705511380308c6f40cfe17addb1463c", "sha256": "7593adf2a86584972c03d7b315c1eec711fda1985b2e60f9bf9930cc2737017f" }, "downloads": -1, "filename": "gocept.pagelet-1.1.tar.gz", "has_sig": false, "md5_digest": "e705511380308c6f40cfe17addb1463c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9865, "upload_time": "2019-06-10T05:18:19", "url": "https://files.pythonhosted.org/packages/df/53/bfc0530403139a8d8290572f4383727bd6672034355d8b7bd956928e45b4/gocept.pagelet-1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e705511380308c6f40cfe17addb1463c", "sha256": "7593adf2a86584972c03d7b315c1eec711fda1985b2e60f9bf9930cc2737017f" }, "downloads": -1, "filename": "gocept.pagelet-1.1.tar.gz", "has_sig": false, "md5_digest": "e705511380308c6f40cfe17addb1463c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9865, "upload_time": "2019-06-10T05:18:19", "url": "https://files.pythonhosted.org/packages/df/53/bfc0530403139a8d8290572f4383727bd6672034355d8b7bd956928e45b4/gocept.pagelet-1.1.tar.gz" } ] }