{ "info": { "author": "Thomas Lotze", "author_email": "thomas@thomas-lotze.de", "bugtrack_url": null, "classifiers": [ "Environment :: Web Environment", "License :: OSI Approved :: Zope Public License", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.6", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 2 :: Only", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: Dynamic Content" ], "description": "===================================================================\r\nOphelia \u2013 build a web site from templates with zero code repetition\r\n===================================================================\r\n\r\nOphelia creates XHTML pages from templates written in TAL, the Zope Template\r\nAttribute Language. It is designed to reduce code repetition to zero.\r\n\r\nOphelia is a WSGI application. The package includes a wsgiref-based server\r\nconfigured to run Ophelia as well as an application factory for use with\r\npaster.\r\n\r\nThe package requires Python 2.6 or 2.7.\r\n\r\nDocumentation files cited below can be found inside the package directory,\r\nalong with a number of doctests for the modules.\r\n\r\n\r\nEntry points\r\n============\r\n\r\nAfter you installed Ophelia and wrote some templates, how can you make it\r\nrender web pages?\r\n\r\nUse Ophelia as a WSGI application\r\n Ophelia defines an application class compliant with the WSGI standard,\r\n :PEP:`333`: ``ophelia.wsgi.Application``. You can either try it by running\r\n Ophelia's own wsgiref-based HTTP server or run it by any WSGI server you\r\n might care to use.\r\n\r\nTry the wsgiref-based server that comes with Ophelia\r\n A rather simplistic and non-production-ready wsgiref-based server set up\r\n to use the provided WSGI application is installed as the\r\n ``ophelia-wsgiref`` executable. Its script entry point is\r\n ``ophelia.wsgi.wsgiref_server``.\r\n\r\n The script provides some usage instructions when called with the\r\n ``--help`` option. It reads a configuration file; see CONFIGURATION.txt\r\n for details.\r\n\r\nUse paster to plug the application into a WSGI server\r\n Ophelia provides a ``paste.app_factory#main`` entry point at\r\n ``ophelia.wsgi.Application.paste_app_factory``. This can be used to run\r\n Ophelia inside any WSGI server that can read paste \"ini\" files. See\r\n CONFIGURATION.txt for an example.\r\n\r\n\r\nWhat kind of sites is Ophelia good for?\r\n=======================================\r\n\r\nStatic content\r\n--------------\r\n\r\nConsider Ophelia as SSI on drugs. It's not fundamentally different, just a\r\nlot friendlier and more capable.\r\n\r\nUse Ophelia for sites where you basically write your HTML yourself, except\r\nthat you need write the recurring stuff only once. Reducing repetition to zero\r\ncomes at a price: your site must follow a pattern for Ophelia to combine your\r\ntemplates the right way.\r\n\r\nConsider your site's layout to be hierarchical: there's a common look to all\r\nyour pages, sections have certain characteristics, and each page has unique\r\ncontent. It's crucial to Ophelia that this hierarchy reflect in the file\r\nsystem organization of your documents; how templates combine is deduced from\r\ntheir places in the hierarchy of directories.\r\n\r\nDynamic content\r\n---------------\r\n\r\nOphelia makes the Python language available for including dynamic content.\r\nEach template file may include a Python script. Python scripts and templates\r\ncontributing to a page share a common set of variables to modify and use.\r\n\r\nOphelia's content model is very simple and works best if each content object\r\nyou publish is its own view: the page it is represented on. If you get content\r\nfrom external resources anyway (e.g. a database or a version control\r\nrepository), it's still OK to use Ophelia even with multiple views per content\r\nobject as long as an object's views don't depend on the object's type or even\r\nthe object itself.\r\n\r\nTrying to use Ophelia on a more complex site will lead to an ugly entanglement\r\nof logic and presentation. Don't use Ophelia for sites that are actually web\r\ninterfaces to applications, content management systems and the like.\r\n\r\n\r\nHow Ophelia works\r\n=================\r\n\r\nTemplate files\r\n--------------\r\n\r\nFor each request, Ophelia looks for a number of template files. It takes one\r\nfile named \"__init__\" from each directory on the path from the site root to\r\nthe page, and a final one for the page itself. The request is served by\r\nOphelia if that final template is found.\r\n\r\nWhen building the page, the page's template is evaluated and its content\r\nstored in what is called the inner slot. Then each template on the way back\r\nfrom the page to the root is evaluated in turn and may include the current\r\ncontent of the inner slot. The result is stored in the inner slot after each\r\nstep.\r\n\r\nThe result of processing the root template is served as the page.\r\n\r\nPython scripts\r\n--------------\r\n\r\nEach template file may start with a Python script. In that case, the script is\r\nseparated from the template by the first occurrence of an \"\" tag on a\r\nline of its own (except for whitespace left or right). If the template file\r\ncontains only a Python script but not actually a template, put \"\" in\r\nits last line.\r\n\r\nPython scripts are executed in order while traversing from the site root to\r\nthe page. They are run in the same namespace of variables that is later used\r\nas the evaluation context of the templates. Variables that are set by a Python\r\nscript may be used and modified by any scripts run later, as well as by TALES\r\nexpressions used in the templates.\r\n\r\nThe namespace is initialized by Ophelia with a single variable, __request__,\r\nthat references the request object. Thus, scripts have access to request\r\ndetails and traversal internals. In addition to setting variables, scripts may\r\nalso import modules, define functions, access the file system, and generally\r\ndo anything a Python program can do.\r\n\r\nDocuments on disk\r\n-----------------\r\n\r\nGenerally, a site will include documents that cannot be assembled from\r\ntemplates as described above. These are assets like images, javascript files\r\nand style sheets as well as pages that, e.g., may have been exported by some\r\nother system such as a source-code documentation generator.\r\n\r\nIn order to mix such content into the URL space of an Ophelia-generated site,\r\nthe template hierarchy must omit the relevant paths and a second directory\r\nhierarchy which directly corresponds to the URL-space needs to contain the\r\ndocuments to be delivered from disk. If Ophelia then finds that it cannot\r\nserve a request using the templates, it will fall back to the on-disk\r\ndocuments. Only if the latter do not include a file corresponding to the\r\nrequested URL will a \"404 Not found\" error response be sent.\r\n\r\n\r\nHow Ophelia behaves\r\n===================\r\n\r\nURL canonicalization and redirection\r\n------------------------------------\r\n\r\nIf Ophelia encounters a URL that corresponds to a directory it behaves\r\nsimilarly to Apache in its default configuration: If the URL doesn't end with\r\na slash, it will redirect the browser to add the slash. If the slash is there,\r\nit will try to find a template named index.html by default, and render it as\r\nthe directory \"index\".\r\n\r\nDepending on configuration, explicit requests for directory index pages may be\r\nredirected to bare directory URLs without the final path segment. This would\r\nturn into .\r\n\r\nAdditionally, Ophelia canonicalizes URLs containing path segments \".\" and \"..\"\r\naccording to :RFC:`3986` on generic URI syntax, and removes empty path\r\nsegments which are not at the end of the path. If the URL is changed by these\r\nrules, Ophelia redirects the browser accordingly.\r\n\r\n\r\nLanguages and APIs used in templates and scripts\r\n================================================\r\n\r\nFor the Python language, see .\r\n\r\nFor the Template attribute language, see\r\n.\r\n\r\nFor WSGI, the web server gateway interface, see\r\n.\r\n\r\nFor the Ophelia API and predefined script and template variables, see API.txt.\r\n\r\n\r\n.. Local Variables:\r\n.. mode: rst\r\n.. End:\r\n\r\n\r\n=============\r\nAbout Ophelia\r\n=============\r\n\r\n:Author:\r\n `Thomas Lotze `_ \r\n\r\n:Web home:\r\n http://thomas-lotze.de/en/software/ophelia/\r\n\r\n:Online documentation:\r\n http://packages.python.org/ophelia/ and\r\n http://ophelia.readthedocs.org/\r\n\r\n:PyPI page:\r\n http://pypi.python.org/pypi/ophelia/\r\n\r\n:Issue tracker:\r\n https://bitbucket.org/tlotze/ophelia/issues/\r\n\r\n:Source code:\r\n https://bitbucket.org/tlotze/ophelia/ and\r\n https://github.com/tlotze/ophelia\r\n\r\n:Current change log:\r\n https://bitbucket.org/tlotze/ophelia/raw/tip/CHANGES.txt\r\n\r\n:Support the project:\r\n * .. image:: http://api.flattr.com/button/flattr-badge-large.png\r\n :alt: Flattr this\r\n :target:\r\n http://flattr.com/thing/515106/Ophelia-build-web-sites-from-templates-with-zero-code-repetition\r\n * Donate by Paypal to .\r\n\r\n.. Local Variables:\r\n.. mode: rst\r\n.. End:", "description_content_type": null, "docs_url": "https://pythonhosted.org/ophelia/", "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://thomas-lotze.de/en/software/ophelia/", "keywords": "web template xhtml tal wsgi python", "license": "ZPL 2.1", "maintainer": "", "maintainer_email": "", "name": "ophelia", "package_url": "https://pypi.org/project/ophelia/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/ophelia/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://thomas-lotze.de/en/software/ophelia/" }, "release_url": "https://pypi.org/project/ophelia/0.4.1/", "requires_dist": null, "requires_python": null, "summary": "Ophelia builds a web site from TAL templates with zero code repetition.", "version": "0.4.1" }, "last_serial": 1944423, "releases": { "0.3": [ { "comment_text": "", "digests": { "md5": "07061da9ea4d37275d35a32e35b74d1c", "sha256": "be6fe357297c4cdf527ad82d23f336bf461fce54d2745d3455636a87aaaa0947" }, "downloads": -1, "filename": "ophelia-0.3-py2.4.egg", "has_sig": true, "md5_digest": "07061da9ea4d37275d35a32e35b74d1c", "packagetype": "bdist_egg", "python_version": "2.4", "requires_python": null, "size": 63869, "upload_time": "2007-07-06T17:19:17", "url": "https://files.pythonhosted.org/packages/53/2d/6eedaf7fc239d32acb553c97881a5be3907990a855163a7755ea5043074f/ophelia-0.3-py2.4.egg" }, { "comment_text": "", "digests": { "md5": "46e2e7b855889054340808145d41aca9", "sha256": "5d0bff8126571930b828026b5089bcb4c224cdd071ad8cef271ae19c7d3265e6" }, "downloads": -1, "filename": "ophelia-0.3.tar.gz", "has_sig": true, "md5_digest": "46e2e7b855889054340808145d41aca9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 36128, "upload_time": "2007-07-06T17:19:03", "url": "https://files.pythonhosted.org/packages/66/32/a62682f5f8e42a7831266d480a91cd221b3df137c76584d1b3d6a66097e6/ophelia-0.3.tar.gz" } ], "0.3.1": [ { "comment_text": "", "digests": { "md5": "bb54acdfd0aa8307e2f68f45af34909c", "sha256": "6fedafe42fc23513b5bd88293d20ef89b87dd87017819a52aefc114247514cb8" }, "downloads": -1, "filename": "ophelia-0.3.1.tar.gz", "has_sig": true, "md5_digest": "bb54acdfd0aa8307e2f68f45af34909c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 37846, "upload_time": "2007-12-07T22:15:42", "url": "https://files.pythonhosted.org/packages/94/bf/f3f39e628f13310201131eaca11d275b5fe14592162e54d37ced78a7fa0c/ophelia-0.3.1.tar.gz" } ], "0.3.2": [ { "comment_text": "", "digests": { "md5": "bb33c5f2c0672c08a40e40d754bbc885", "sha256": "7b01b88dee1a2531586504f1717ce09441ce84dc2757ec12f76854b97781b347" }, "downloads": -1, "filename": "ophelia-0.3.2.tar.gz", "has_sig": true, "md5_digest": "bb33c5f2c0672c08a40e40d754bbc885", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 38529, "upload_time": "2008-01-08T21:01:36", "url": "https://files.pythonhosted.org/packages/43/3f/b48d9a2b13f55473639a9a379dc5e1f11a00fc1e9f2c9dbf5b1dfc4f16c0/ophelia-0.3.2.tar.gz" } ], "0.3.3": [ { "comment_text": "", "digests": { "md5": "a92dac78ad73508a567974db61a8e85a", "sha256": "257f920c1bde9ce46a1d4580de2aa70ec0152a25734e3d0d332696e14fe38735" }, "downloads": -1, "filename": "ophelia-0.3.3.tar.gz", "has_sig": true, "md5_digest": "a92dac78ad73508a567974db61a8e85a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 39039, "upload_time": "2008-12-02T22:32:10", "url": "https://files.pythonhosted.org/packages/66/97/fb0aad63259a447437194791c587ea90da8737fa13ad3c289a7810dd6ab0/ophelia-0.3.3.tar.gz" } ], "0.3.4": [ { "comment_text": "", "digests": { "md5": "9b2cf2e5c2b0c605145a648fbeb3b826", "sha256": "12505584da3fbdbae9599ee377226445265cb5c5b4a76ec5d58ea7e3badee4ea" }, "downloads": -1, "filename": "ophelia-0.3.4.tar.gz", "has_sig": true, "md5_digest": "9b2cf2e5c2b0c605145a648fbeb3b826", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 40767, "upload_time": "2011-04-14T16:44:03", "url": "https://files.pythonhosted.org/packages/75/d2/25582e2a0ac44a98cf9fed33d27f41f55bc40e759c4ebfa00053117c03b4/ophelia-0.3.4.tar.gz" } ], "0.3.5": [ { "comment_text": "", "digests": { "md5": "eb4bb9062c39a77bca6d8dcb664fd43f", "sha256": "3928f3b78897fbb33be8f00074e5f82f5454f07d750a353a6bd00d275657465c" }, "downloads": -1, "filename": "ophelia-0.3.5.tar.gz", "has_sig": true, "md5_digest": "eb4bb9062c39a77bca6d8dcb664fd43f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 46635, "upload_time": "2012-02-18T23:43:32", "url": "https://files.pythonhosted.org/packages/5a/0c/6fb5c394d4b1e68fa67092225463dccbd55d08b441edd658c1a7e134f16c/ophelia-0.3.5.tar.gz" } ], "0.4": [ { "comment_text": "", "digests": { "md5": "6c346716cf1e2efe8de9ce18ca387b95", "sha256": "6fbafb022f301918f6bc9f94031a2a3aa29038f01b16dffa18830265b69179f8" }, "downloads": -1, "filename": "ophelia-0.4.tar.gz", "has_sig": true, "md5_digest": "6c346716cf1e2efe8de9ce18ca387b95", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 44862, "upload_time": "2013-01-02T18:06:35", "url": "https://files.pythonhosted.org/packages/2d/b2/0104f6c73cba23c0426dbad6860162efe98bad13b8a6d21ad6169d82d0ff/ophelia-0.4.tar.gz" } ], "0.4.1": [ { "comment_text": "", "digests": { "md5": "ce9b3da6d63a1ce3ac8dd7df1d1bb919", "sha256": "f63b8ee6e06256cc68fcdcec52322dbfeb19781301bbd178bf73dbfe746db6c8" }, "downloads": -1, "filename": "ophelia-0.4.1.tar.gz", "has_sig": true, "md5_digest": "ce9b3da6d63a1ce3ac8dd7df1d1bb919", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 47869, "upload_time": "2013-05-07T19:53:14", "url": "https://files.pythonhosted.org/packages/70/3c/e39486f25ec22909a56324d0fb1c0c82b14d72c964cc4c100d32e653398b/ophelia-0.4.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ce9b3da6d63a1ce3ac8dd7df1d1bb919", "sha256": "f63b8ee6e06256cc68fcdcec52322dbfeb19781301bbd178bf73dbfe746db6c8" }, "downloads": -1, "filename": "ophelia-0.4.1.tar.gz", "has_sig": true, "md5_digest": "ce9b3da6d63a1ce3ac8dd7df1d1bb919", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 47869, "upload_time": "2013-05-07T19:53:14", "url": "https://files.pythonhosted.org/packages/70/3c/e39486f25ec22909a56324d0fb1c0c82b14d72c964cc4c100d32e653398b/ophelia-0.4.1.tar.gz" } ] }