././@PaxHeader0000000000000000000000000000003400000000000011452 xustar000000000000000028 mtime=1700321442.6250424 aiohttp-jinja2-1.6/0000755000175100001770000000000000000000000015011 5ustar00runnerdocker00000000000000././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1700321430.0 aiohttp-jinja2-1.6/.coveragerc0000644000175100001770000000007100000000000017130 0ustar00runnerdocker00000000000000# .coveragerc to control coverage.py [run] branch = True ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1700321430.0 aiohttp-jinja2-1.6/CHANGES.rst0000644000175100001770000000765200000000000016625 0ustar00runnerdocker00000000000000======= CHANGES ======= .. towncrier release notes start 1.6 (2023-11-18) ================ - Switch to ``aiohttp.web.AppKey``, and deprecate the old 'static_root_url' key. - Drop Python 3.7, add Python 3.12. 1.5.1 (2023-02-01) ================== - Add support for Python 3.11. - Drop support for decorating non-async functions with @template (deprecated since 0.16). 1.5 (2021-08-21) ================ - Drop support for jinaj2 <3. Add support for 3+. - Don't require ``typing_extensions`` on Python 3.8+. 1.4.2 (2020-11-23) ================== - Add CHANGES.rst to MANIFEST.in and sdist #402 1.4.1 (2020-11-22) ================== - Document async rendering functions #396 1.4.0 (2020-11-12) ================== - Fix type annotation for ``context_processors`` argument #354 - Bump the minimal supported ``aiohttp`` version to 3.6.3 to avoid problems with uncompatibility between ``aiohttp`` and ``yarl`` - Add async rendering support #393 1.3.0 (2020-10-30) ================== - Remove Any from template annotations #343 - Fix type annotation for filters in ``aiohttp_jinja2.setup`` #330 - Drop Python 3.5, support Python 3.9 1.2.0 (2019-10-21) ================== - Add type hints #285 1.1.1 (2019-04-25) ================== - Bump minimal supported ``jinja2`` version to 2.10.1 to avoid security vulnerability problem. 1.1.0 (2018-09-05) ================== - Bump minimal supported ``aiohttp`` version to 3.2 - Use ``request.config_dict`` for accessing ``jinja2`` environment. It allows to reuse jinja rendering engine from parent application. 1.0.0 (2018-03-12) ================== - Allow context_processors to compose from parent apps #195 0.17.0 (2018-03-12) =================== - Auto-cast ``int`` values in ``url()`` jinja function to ``str`` #191 0.16.0 (2018-02-12) =================== - Pin to aiohttp 3.0+ - Deprecate non-async handlers support 0.15.0 (2018-01-30) =================== - Upgrade middleware to new style from aiohttp 2.3+ #182 - Autoescape all templates by default #179 0.13.0 (2016-12-14) =================== - Avoid subtle errors by copying context processor data #51 0.12.0 (2016-12-02) =================== - Add autodeploy script #46 0.11.0 (2016-11-24) =================== - Add jinja2 filters support #41 0.10.0 (2016-10-20) =================== - Rename package to aiohttp-jinja2 #31 0.9.0 (2016-09-26) ================== - Fix reason parameter in HTTPInternalServerError when template is not found #33 0.8.0 (2016-07-12) ================== - Add ability to render template without context #28 0.7.0 (2015-12-30) ================== - Add ability to decorate class based views (available in aiohttp 0.20) #18 - Upgrade aiohttp requirement to version 0.20.0+ 0.6.2 (2015-11-22) ================== - Make app_key parameter from render_string coroutine optional 0.6.0 (2015-10-29) ================== - Fix a bug in middleware (missed coroutine decorator) #16 - Drop Python 3.3 support (switched to aiohttp version v0.18.0) - Simplify context processors initialization by adding parameter to `setup()` 0.5.0 (2015-07-09) ================== - Introduce context processors #14 - Bypass StreamResponse #15 0.4.3 (2015-06-01) ================== - Fix distribution building: add manifest file 0.4.2 (2015-05-21) ================== - Make HTTPInternalServerError exceptions more verbose on console output 0.4.1 (2015-04-05) ================== - Documentation update 0.4.0 (2015-04-02) ================== - Add `render_string` method 0.3.1 (2015-04-01) ================== - Don't allow non-mapping context - Fix tiny documentation issues - Change the library logo 0.3.0 (2015-03-15) ================== - Documentation release 0.2.1 (2015-02-15) ================== - Fix `render_template` function 0.2.0 (2015-02-05) ================== - Migrate to aiohttp 0.14 - Add `status` parameter to template decorator - Drop optional `response` parameter 0.1.0 (2015-01-08) ================== - Initial release ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1700321430.0 aiohttp-jinja2-1.6/LICENSE0000644000175100001770000002610600000000000016023 0ustar00runnerdocker00000000000000Apache License Version 2.0, January 2004 http://www.apache.org/licenses/ TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 1. Definitions. "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. "You" (or "Your") shall mean an individual or Legal Entity exercising permissions granted by this License. "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. "Object" form shall mean any form resulting from mechanical transformation or translation of a Source form, including but not limited to compiled object code, generated documentation, and conversions to other media types. "Work" shall mean the work of authorship, whether in Source or Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work (an example is provided in the Appendix below). "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. "Contribution" shall mean any work of authorship, including the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare Derivative Works of, publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. 3. Grant of Patent License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses granted to You under this License for that Work shall terminate as of the date such litigation is filed. 4. Redistribution. You may reproduce and distribute copies of the Work or Derivative Works thereof in any medium, with or without modifications, and in Source or Object form, provided that You meet the following conditions: (a) You must give any other recipients of the Work or Derivative Works a copy of this License; and (b) You must cause any modified files to carry prominent notices stating that You changed the files; and (c) You must retain, in the Source form of any Derivative Works that You distribute, all copyright, patent, trademark, and attribution notices from the Source form of the Work, excluding those notices that do not pertain to any part of the Derivative Works; and (d) If the Work includes a "NOTICE" text file as part of its distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and do not modify the License. You may add Your own attribution notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. 7. Disclaimer of Warranty. Unless required by applicable law or agreed to in writing, Licensor provides the Work (and each Contributor provides its Contributions) on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. 8. Limitation of Liability. In no event and under no legal theory, whether in tort (including negligence), contract, or otherwise, unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all other commercial damages or losses), even if such Contributor has been advised of the possibility of such damages. 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, defend, and hold each Contributor harmless for any liability incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. END OF TERMS AND CONDITIONS APPENDIX: How to apply the Apache License to your work. To apply the Apache License to your work, attach the following boilerplate notice, with the fields enclosed by brackets "{}" replaced with your own identifying information. (Don't include the brackets!) The text should be enclosed in the appropriate comment syntax for the file format. We also recommend that a file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier identification within third-party archives. Copyright 2015-2018 Andrew Svetlov and aio-libs team Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1700321430.0 aiohttp-jinja2-1.6/MANIFEST.in0000644000175100001770000000033400000000000016547 0ustar00runnerdocker00000000000000include CHANGES.rst include LICENSE include README.rst include Makefile include requirements-dev.txt include pytest.ini include .coveragerc graft aiohttp_jinja2 graft docs graft examples graft tests global-exclude *.pyc ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1700321430.0 aiohttp-jinja2-1.6/Makefile0000644000175100001770000000137400000000000016456 0ustar00runnerdocker00000000000000# Some simple testing tasks (sorry, UNIX only). .PHONY: init setup init setup: pip install -r requirements-dev.txt pre-commit install .PHONY: fmt fmt: python -m pre_commit run --all-files --show-diff-on-failure .PHONY: lint lint: fmt mypy .PHONY: test test: pytest -s ./tests/ .PHONY: clean clean: rm -rf `find . -name __pycache__` rm -f `find . -type f -name '*.py[co]' ` rm -f `find . -type f -name '*~' ` rm -f `find . -type f -name '.*~' ` rm -f `find . -type f -name '@*' ` rm -f `find . -type f -name '#*#' ` rm -f `find . -type f -name '*.orig' ` rm -f `find . -type f -name '*.rej' ` rm -f .coverage rm -rf coverage rm -rf build rm -rf cover .PHONY: doc doc: make -C docs html @echo "open file://`pwd`/docs/_build/html/index.html" ././@PaxHeader0000000000000000000000000000003400000000000011452 xustar000000000000000028 mtime=1700321442.6250424 aiohttp-jinja2-1.6/PKG-INFO0000644000175100001770000001776600000000000016127 0ustar00runnerdocker00000000000000Metadata-Version: 2.1 Name: aiohttp-jinja2 Version: 1.6 Summary: jinja2 template renderer for aiohttp.web (http server for asyncio) Home-page: https://github.com/aio-libs/aiohttp_jinja2/ Author: Andrew Svetlov Author-email: andrew.svetlov@gmail.com License: Apache 2 Classifier: License :: OSI Approved :: Apache Software License Classifier: Intended Audience :: Developers Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.8 Classifier: Programming Language :: Python :: 3.9 Classifier: Programming Language :: Python :: 3.10 Classifier: Programming Language :: Python :: 3.11 Classifier: Programming Language :: Python :: 3.12 Classifier: Development Status :: 5 - Production/Stable Classifier: Topic :: Internet :: WWW/HTTP Classifier: Framework :: AsyncIO Classifier: Framework :: aiohttp Requires-Python: >=3.8 License-File: LICENSE Requires-Dist: aiohttp>=3.9.0 Requires-Dist: jinja2>=3.0.0 aiohttp_jinja2 ============== .. image:: https://github.com/aio-libs/aiohttp-jinja2/workflows/CI/badge.svg :target: https://github.com/aio-libs/aiohttp-jinja2/actions?query=workflow%3ACI .. image:: https://codecov.io/gh/aio-libs/aiohttp-jinja2/branch/master/graph/badge.svg :target: https://codecov.io/gh/aio-libs/aiohttp-jinja2 .. image:: https://img.shields.io/pypi/v/aiohttp-jinja2.svg :target: https://pypi.python.org/pypi/aiohttp-jinja2 .. image:: https://readthedocs.org/projects/aiohttp-jinja2/badge/?version=latest :target: http://aiohttp-jinja2.readthedocs.io/en/latest/?badge=latest jinja2_ template renderer for `aiohttp.web`__. .. _jinja2: http://jinja.pocoo.org .. _aiohttp_web: https://aiohttp.readthedocs.io/en/latest/web.html __ aiohttp_web_ Installation ------------ Install from PyPI:: pip install aiohttp-jinja2 Developing ---------- Install requirement and launch tests:: pip install -r requirements-dev.txt pytest tests Usage ----- Before template rendering you have to setup *jinja2 environment* first: .. code-block:: python app = web.Application() aiohttp_jinja2.setup(app, loader=jinja2.FileSystemLoader('/path/to/templates/folder')) Import: .. code-block:: python import aiohttp_jinja2 import jinja2 After that you may to use template engine in your *web-handlers*. The most convenient way is to decorate a *web-handler*. Using the function based web handlers: .. code-block:: python @aiohttp_jinja2.template('tmpl.jinja2') def handler(request): return {'name': 'Andrew', 'surname': 'Svetlov'} Or for `Class Based Views `: .. code-block:: python class Handler(web.View): @aiohttp_jinja2.template('tmpl.jinja2') async def get(self): return {'name': 'Andrew', 'surname': 'Svetlov'} On handler call the ``aiohttp_jinja2.template`` decorator will pass returned dictionary ``{'name': 'Andrew', 'surname': 'Svetlov'}`` into template named ``tmpl.jinja2`` for getting resulting HTML text. If you need more complex processing (set response headers for example) you may call ``render_template`` function. Using a function based web handler: .. code-block:: python async def handler(request): context = {'name': 'Andrew', 'surname': 'Svetlov'} response = aiohttp_jinja2.render_template('tmpl.jinja2', request, context) response.headers['Content-Language'] = 'ru' return response Or, again, a class based view: .. code-block:: python class Handler(web.View): async def get(self): context = {'name': 'Andrew', 'surname': 'Svetlov'} response = aiohttp_jinja2.render_template('tmpl.jinja2', self.request, context) response.headers['Content-Language'] = 'ru' return response License ------- ``aiohttp_jinja2`` is offered under the Apache 2 license. ======= CHANGES ======= .. towncrier release notes start 1.6 (2023-11-18) ================ - Switch to ``aiohttp.web.AppKey``, and deprecate the old 'static_root_url' key. - Drop Python 3.7, add Python 3.12. 1.5.1 (2023-02-01) ================== - Add support for Python 3.11. - Drop support for decorating non-async functions with @template (deprecated since 0.16). 1.5 (2021-08-21) ================ - Drop support for jinaj2 <3. Add support for 3+. - Don't require ``typing_extensions`` on Python 3.8+. 1.4.2 (2020-11-23) ================== - Add CHANGES.rst to MANIFEST.in and sdist #402 1.4.1 (2020-11-22) ================== - Document async rendering functions #396 1.4.0 (2020-11-12) ================== - Fix type annotation for ``context_processors`` argument #354 - Bump the minimal supported ``aiohttp`` version to 3.6.3 to avoid problems with uncompatibility between ``aiohttp`` and ``yarl`` - Add async rendering support #393 1.3.0 (2020-10-30) ================== - Remove Any from template annotations #343 - Fix type annotation for filters in ``aiohttp_jinja2.setup`` #330 - Drop Python 3.5, support Python 3.9 1.2.0 (2019-10-21) ================== - Add type hints #285 1.1.1 (2019-04-25) ================== - Bump minimal supported ``jinja2`` version to 2.10.1 to avoid security vulnerability problem. 1.1.0 (2018-09-05) ================== - Bump minimal supported ``aiohttp`` version to 3.2 - Use ``request.config_dict`` for accessing ``jinja2`` environment. It allows to reuse jinja rendering engine from parent application. 1.0.0 (2018-03-12) ================== - Allow context_processors to compose from parent apps #195 0.17.0 (2018-03-12) =================== - Auto-cast ``int`` values in ``url()`` jinja function to ``str`` #191 0.16.0 (2018-02-12) =================== - Pin to aiohttp 3.0+ - Deprecate non-async handlers support 0.15.0 (2018-01-30) =================== - Upgrade middleware to new style from aiohttp 2.3+ #182 - Autoescape all templates by default #179 0.13.0 (2016-12-14) =================== - Avoid subtle errors by copying context processor data #51 0.12.0 (2016-12-02) =================== - Add autodeploy script #46 0.11.0 (2016-11-24) =================== - Add jinja2 filters support #41 0.10.0 (2016-10-20) =================== - Rename package to aiohttp-jinja2 #31 0.9.0 (2016-09-26) ================== - Fix reason parameter in HTTPInternalServerError when template is not found #33 0.8.0 (2016-07-12) ================== - Add ability to render template without context #28 0.7.0 (2015-12-30) ================== - Add ability to decorate class based views (available in aiohttp 0.20) #18 - Upgrade aiohttp requirement to version 0.20.0+ 0.6.2 (2015-11-22) ================== - Make app_key parameter from render_string coroutine optional 0.6.0 (2015-10-29) ================== - Fix a bug in middleware (missed coroutine decorator) #16 - Drop Python 3.3 support (switched to aiohttp version v0.18.0) - Simplify context processors initialization by adding parameter to `setup()` 0.5.0 (2015-07-09) ================== - Introduce context processors #14 - Bypass StreamResponse #15 0.4.3 (2015-06-01) ================== - Fix distribution building: add manifest file 0.4.2 (2015-05-21) ================== - Make HTTPInternalServerError exceptions more verbose on console output 0.4.1 (2015-04-05) ================== - Documentation update 0.4.0 (2015-04-02) ================== - Add `render_string` method 0.3.1 (2015-04-01) ================== - Don't allow non-mapping context - Fix tiny documentation issues - Change the library logo 0.3.0 (2015-03-15) ================== - Documentation release 0.2.1 (2015-02-15) ================== - Fix `render_template` function 0.2.0 (2015-02-05) ================== - Migrate to aiohttp 0.14 - Add `status` parameter to template decorator - Drop optional `response` parameter 0.1.0 (2015-01-08) ================== - Initial release ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1700321430.0 aiohttp-jinja2-1.6/README.rst0000644000175100001770000000615700000000000016511 0ustar00runnerdocker00000000000000aiohttp_jinja2 ============== .. image:: https://github.com/aio-libs/aiohttp-jinja2/workflows/CI/badge.svg :target: https://github.com/aio-libs/aiohttp-jinja2/actions?query=workflow%3ACI .. image:: https://codecov.io/gh/aio-libs/aiohttp-jinja2/branch/master/graph/badge.svg :target: https://codecov.io/gh/aio-libs/aiohttp-jinja2 .. image:: https://img.shields.io/pypi/v/aiohttp-jinja2.svg :target: https://pypi.python.org/pypi/aiohttp-jinja2 .. image:: https://readthedocs.org/projects/aiohttp-jinja2/badge/?version=latest :target: http://aiohttp-jinja2.readthedocs.io/en/latest/?badge=latest jinja2_ template renderer for `aiohttp.web`__. .. _jinja2: http://jinja.pocoo.org .. _aiohttp_web: https://aiohttp.readthedocs.io/en/latest/web.html __ aiohttp_web_ Installation ------------ Install from PyPI:: pip install aiohttp-jinja2 Developing ---------- Install requirement and launch tests:: pip install -r requirements-dev.txt pytest tests Usage ----- Before template rendering you have to setup *jinja2 environment* first: .. code-block:: python app = web.Application() aiohttp_jinja2.setup(app, loader=jinja2.FileSystemLoader('/path/to/templates/folder')) Import: .. code-block:: python import aiohttp_jinja2 import jinja2 After that you may to use template engine in your *web-handlers*. The most convenient way is to decorate a *web-handler*. Using the function based web handlers: .. code-block:: python @aiohttp_jinja2.template('tmpl.jinja2') def handler(request): return {'name': 'Andrew', 'surname': 'Svetlov'} Or for `Class Based Views `: .. code-block:: python class Handler(web.View): @aiohttp_jinja2.template('tmpl.jinja2') async def get(self): return {'name': 'Andrew', 'surname': 'Svetlov'} On handler call the ``aiohttp_jinja2.template`` decorator will pass returned dictionary ``{'name': 'Andrew', 'surname': 'Svetlov'}`` into template named ``tmpl.jinja2`` for getting resulting HTML text. If you need more complex processing (set response headers for example) you may call ``render_template`` function. Using a function based web handler: .. code-block:: python async def handler(request): context = {'name': 'Andrew', 'surname': 'Svetlov'} response = aiohttp_jinja2.render_template('tmpl.jinja2', request, context) response.headers['Content-Language'] = 'ru' return response Or, again, a class based view: .. code-block:: python class Handler(web.View): async def get(self): context = {'name': 'Andrew', 'surname': 'Svetlov'} response = aiohttp_jinja2.render_template('tmpl.jinja2', self.request, context) response.headers['Content-Language'] = 'ru' return response License ------- ``aiohttp_jinja2`` is offered under the Apache 2 license. ././@PaxHeader0000000000000000000000000000003400000000000011452 xustar000000000000000028 mtime=1700321442.6210425 aiohttp-jinja2-1.6/aiohttp_jinja2/0000755000175100001770000000000000000000000017716 5ustar00runnerdocker00000000000000././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1700321430.0 aiohttp-jinja2-1.6/aiohttp_jinja2/__init__.py0000644000175100001770000001735200000000000022037 0ustar00runnerdocker00000000000000import functools from typing import ( Any, Awaitable, Callable, Dict, Final, Mapping, Optional, Protocol, Sequence, Tuple, TypeVar, Union, overload, ) import jinja2 from aiohttp import web from aiohttp.abc import AbstractView from .helpers import GLOBAL_HELPERS, static_root_key from .typedefs import Filters __version__ = "1.6" __all__ = ( "get_env", "render_string", "render_template", "setup", "static_root_key", "template", ) _TemplateReturnType = Awaitable[Union[web.StreamResponse, Mapping[str, Any]]] _SimpleTemplateHandler = Callable[[web.Request], _TemplateReturnType] _ContextProcessor = Callable[[web.Request], Awaitable[Dict[str, Any]]] APP_CONTEXT_PROCESSORS_KEY: Final = web.AppKey[Sequence[_ContextProcessor]]( "APP_CONTEXT_PROCESSORS_KEY" ) APP_KEY: Final = web.AppKey[jinja2.Environment]("APP_KEY") REQUEST_CONTEXT_KEY: Final = "aiohttp_jinja2_context" _T = TypeVar("_T") _AbstractView = TypeVar("_AbstractView", bound=AbstractView) class _TemplateWrapper(Protocol): @overload def __call__( self, func: _SimpleTemplateHandler ) -> Callable[[web.Request], Awaitable[web.StreamResponse]]: ... @overload def __call__( self, func: Callable[[_AbstractView], _TemplateReturnType] ) -> Callable[[_AbstractView], Awaitable[web.StreamResponse]]: ... @overload def __call__( self, func: Callable[[_T, web.Request], _TemplateReturnType] ) -> Callable[[_T, web.Request], Awaitable[web.StreamResponse]]: ... def setup( app: web.Application, *args: Any, app_key: web.AppKey[jinja2.Environment] = APP_KEY, context_processors: Sequence[_ContextProcessor] = (), filters: Optional[Filters] = None, default_helpers: bool = True, **kwargs: Any, ) -> jinja2.Environment: kwargs.setdefault("autoescape", True) env = jinja2.Environment(*args, **kwargs) if default_helpers: env.globals.update(GLOBAL_HELPERS) if filters is not None: env.filters.update(filters) app[app_key] = env if context_processors: app[APP_CONTEXT_PROCESSORS_KEY] = context_processors app.middlewares.append(context_processors_middleware) env.globals["app"] = app return env def get_env( app: web.Application, *, app_key: web.AppKey[jinja2.Environment] = APP_KEY ) -> jinja2.Environment: try: return app[app_key] except KeyError: raise RuntimeError("aiohttp_jinja2.setup(...) must be called first.") def _render_string( template_name: str, request: web.Request, context: Mapping[str, Any], app_key: web.AppKey[jinja2.Environment], ) -> Tuple[jinja2.Template, Mapping[str, Any]]: env = request.config_dict.get(app_key) if env is None: text = "Template engine is not initialized, call aiohttp_jinja2.setup() first" # in order to see meaningful exception message both: on console # output and rendered page we add same message to *reason* and # *text* arguments. raise web.HTTPInternalServerError(reason=text, text=text) try: template = env.get_template(template_name) except jinja2.TemplateNotFound as e: text = f"Template '{template_name}' not found" raise web.HTTPInternalServerError(reason=text, text=text) from e if not isinstance(context, Mapping): text = f"context should be mapping, not {type(context)}" # type: ignore[unreachable] # same reason as above raise web.HTTPInternalServerError(reason=text, text=text) if request.get(REQUEST_CONTEXT_KEY): context = dict(request[REQUEST_CONTEXT_KEY], **context) return template, context def render_string( template_name: str, request: web.Request, context: Mapping[str, Any], *, app_key: web.AppKey[jinja2.Environment] = APP_KEY, ) -> str: template, context = _render_string(template_name, request, context, app_key) return template.render(context) async def render_string_async( template_name: str, request: web.Request, context: Mapping[str, Any], *, app_key: web.AppKey[jinja2.Environment] = APP_KEY, ) -> str: template, context = _render_string(template_name, request, context, app_key) return await template.render_async(context) def _render_template( context: Optional[Mapping[str, Any]], encoding: str, status: int, ) -> Tuple[web.Response, Mapping[str, Any]]: response = web.Response(status=status) if context is None: context = {} response.content_type = "text/html" response.charset = encoding return response, context def render_template( template_name: str, request: web.Request, context: Optional[Mapping[str, Any]], *, app_key: web.AppKey[jinja2.Environment] = APP_KEY, encoding: str = "utf-8", status: int = 200, ) -> web.Response: response, context = _render_template(context, encoding, status) response.text = render_string(template_name, request, context, app_key=app_key) return response async def render_template_async( template_name: str, request: web.Request, context: Optional[Mapping[str, Any]], *, app_key: web.AppKey[jinja2.Environment] = APP_KEY, encoding: str = "utf-8", status: int = 200, ) -> web.Response: response, context = _render_template(context, encoding, status) response.text = await render_string_async( template_name, request, context, app_key=app_key ) return response def template( template_name: str, *, app_key: web.AppKey[jinja2.Environment] = APP_KEY, encoding: str = "utf-8", status: int = 200, ) -> _TemplateWrapper: @overload def wrapper( func: _SimpleTemplateHandler, ) -> Callable[[web.Request], Awaitable[web.StreamResponse]]: ... @overload def wrapper( func: Callable[[_AbstractView], _TemplateReturnType] ) -> Callable[[_AbstractView], Awaitable[web.StreamResponse]]: ... @overload def wrapper( func: Callable[[_T, web.Request], _TemplateReturnType] ) -> Callable[[_T, web.Request], Awaitable[web.StreamResponse]]: ... def wrapper( func: Callable[..., _TemplateReturnType] ) -> Callable[..., Awaitable[web.StreamResponse]]: # TODO(PY310): ParamSpec @functools.wraps(func) async def wrapped(*args: Any) -> web.StreamResponse: # type: ignore[misc] context = await func(*args) if isinstance(context, web.StreamResponse): return context # Supports class based views see web.View if isinstance(args[0], AbstractView): request = args[0].request else: request = args[-1] env = request.config_dict.get(app_key) if env and env.is_async: response = await render_template_async( template_name, request, context, app_key=app_key, encoding=encoding ) else: response = render_template( template_name, request, context, app_key=app_key, encoding=encoding ) response.set_status(status) return response return wrapped return wrapper @web.middleware async def context_processors_middleware( request: web.Request, handler: Callable[[web.Request], Awaitable[web.StreamResponse]], ) -> web.StreamResponse: if REQUEST_CONTEXT_KEY not in request: request[REQUEST_CONTEXT_KEY] = {} for processor in request.config_dict[APP_CONTEXT_PROCESSORS_KEY]: request[REQUEST_CONTEXT_KEY].update(await processor(request)) return await handler(request) async def request_processor(request: web.Request) -> Dict[str, web.Request]: return {"request": request} ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1700321430.0 aiohttp-jinja2-1.6/aiohttp_jinja2/helpers.py0000644000175100001770000000522300000000000021734 0ustar00runnerdocker00000000000000""" useful context functions, see http://jinja.pocoo.org/docs/dev/api/#jinja2.contextfunction """ import warnings from typing import Dict, Optional, TypedDict, Union import jinja2 from aiohttp import web from yarl import URL class _Context(TypedDict, total=False): app: web.Application static_root_key = web.AppKey("static_root_key", str) @jinja2.pass_context def url_for( context: _Context, __route_name: str, query_: Optional[Dict[str, str]] = None, **parts: Union[str, int] ) -> URL: """Filter for generating urls. Usage: {{ url('the-view-name') }} might become "/path/to/view" or {{ url('item-details', id=123, query_={'active': 'true'}) }} might become "/items/1?active=true". """ app = context["app"] parts_clean: Dict[str, str] = {} for key in parts: val = parts[key] if isinstance(val, str): # if type is inherited from str expilict cast to str makes sense # if type is exactly str the operation is very fast val = str(val) elif type(val) is int: # int inherited classes like bool are forbidden val = str(val) else: raise TypeError( "argument value should be str or int, " "got {} -> [{}] {!r}".format(key, type(val), val) ) parts_clean[key] = val url = app.router[__route_name].url_for(**parts_clean) if query_: url = url.with_query(query_) return url @jinja2.pass_context def static_url(context: _Context, static_file_path: str) -> str: """Filter for generating urls for static files. NOTE: you'll need to set app[aiohttp_jinja2.static_root_key] to be used as the root for the urls returned. Usage: {{ static('styles.css') }} might become "/static/styles.css" or "http://mycdn.example.com/styles.css" """ app = context["app"] try: static_url = app[static_root_key] except KeyError: try: # TODO (aiohttp 3.10+): Remove this fallback static_url = app["static_root_url"] except KeyError: raise RuntimeError( "app does not define a static root url, you need to set the url root " "with app[aiohttp_jinja2.static_root_key] = ''." ) from None else: warnings.warn( "'static_root_url' is deprecated, use aiohttp_jinja2.static_root_key.", category=DeprecationWarning, stacklevel=2, ) return "{}/{}".format(static_url.rstrip("/"), static_file_path.lstrip("/")) GLOBAL_HELPERS = dict( url=url_for, static=static_url, ) ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1700321430.0 aiohttp-jinja2-1.6/aiohttp_jinja2/py.typed0000644000175100001770000000001100000000000021405 0ustar00runnerdocker00000000000000# marker ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1700321430.0 aiohttp-jinja2-1.6/aiohttp_jinja2/typedefs.py0000644000175100001770000000023600000000000022114 0ustar00runnerdocker00000000000000from typing import Callable, Iterable, Mapping, Tuple, Union Filter = Callable[..., str] Filters = Union[Iterable[Tuple[str, Filter]], Mapping[str, Filter]] ././@PaxHeader0000000000000000000000000000003400000000000011452 xustar000000000000000028 mtime=1700321442.6210425 aiohttp-jinja2-1.6/aiohttp_jinja2.egg-info/0000755000175100001770000000000000000000000021410 5ustar00runnerdocker00000000000000././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1700321442.0 aiohttp-jinja2-1.6/aiohttp_jinja2.egg-info/PKG-INFO0000644000175100001770000001776600000000000022526 0ustar00runnerdocker00000000000000Metadata-Version: 2.1 Name: aiohttp-jinja2 Version: 1.6 Summary: jinja2 template renderer for aiohttp.web (http server for asyncio) Home-page: https://github.com/aio-libs/aiohttp_jinja2/ Author: Andrew Svetlov Author-email: andrew.svetlov@gmail.com License: Apache 2 Classifier: License :: OSI Approved :: Apache Software License Classifier: Intended Audience :: Developers Classifier: Programming Language :: Python Classifier: Programming Language :: Python :: 3 Classifier: Programming Language :: Python :: 3.8 Classifier: Programming Language :: Python :: 3.9 Classifier: Programming Language :: Python :: 3.10 Classifier: Programming Language :: Python :: 3.11 Classifier: Programming Language :: Python :: 3.12 Classifier: Development Status :: 5 - Production/Stable Classifier: Topic :: Internet :: WWW/HTTP Classifier: Framework :: AsyncIO Classifier: Framework :: aiohttp Requires-Python: >=3.8 License-File: LICENSE Requires-Dist: aiohttp>=3.9.0 Requires-Dist: jinja2>=3.0.0 aiohttp_jinja2 ============== .. image:: https://github.com/aio-libs/aiohttp-jinja2/workflows/CI/badge.svg :target: https://github.com/aio-libs/aiohttp-jinja2/actions?query=workflow%3ACI .. image:: https://codecov.io/gh/aio-libs/aiohttp-jinja2/branch/master/graph/badge.svg :target: https://codecov.io/gh/aio-libs/aiohttp-jinja2 .. image:: https://img.shields.io/pypi/v/aiohttp-jinja2.svg :target: https://pypi.python.org/pypi/aiohttp-jinja2 .. image:: https://readthedocs.org/projects/aiohttp-jinja2/badge/?version=latest :target: http://aiohttp-jinja2.readthedocs.io/en/latest/?badge=latest jinja2_ template renderer for `aiohttp.web`__. .. _jinja2: http://jinja.pocoo.org .. _aiohttp_web: https://aiohttp.readthedocs.io/en/latest/web.html __ aiohttp_web_ Installation ------------ Install from PyPI:: pip install aiohttp-jinja2 Developing ---------- Install requirement and launch tests:: pip install -r requirements-dev.txt pytest tests Usage ----- Before template rendering you have to setup *jinja2 environment* first: .. code-block:: python app = web.Application() aiohttp_jinja2.setup(app, loader=jinja2.FileSystemLoader('/path/to/templates/folder')) Import: .. code-block:: python import aiohttp_jinja2 import jinja2 After that you may to use template engine in your *web-handlers*. The most convenient way is to decorate a *web-handler*. Using the function based web handlers: .. code-block:: python @aiohttp_jinja2.template('tmpl.jinja2') def handler(request): return {'name': 'Andrew', 'surname': 'Svetlov'} Or for `Class Based Views `: .. code-block:: python class Handler(web.View): @aiohttp_jinja2.template('tmpl.jinja2') async def get(self): return {'name': 'Andrew', 'surname': 'Svetlov'} On handler call the ``aiohttp_jinja2.template`` decorator will pass returned dictionary ``{'name': 'Andrew', 'surname': 'Svetlov'}`` into template named ``tmpl.jinja2`` for getting resulting HTML text. If you need more complex processing (set response headers for example) you may call ``render_template`` function. Using a function based web handler: .. code-block:: python async def handler(request): context = {'name': 'Andrew', 'surname': 'Svetlov'} response = aiohttp_jinja2.render_template('tmpl.jinja2', request, context) response.headers['Content-Language'] = 'ru' return response Or, again, a class based view: .. code-block:: python class Handler(web.View): async def get(self): context = {'name': 'Andrew', 'surname': 'Svetlov'} response = aiohttp_jinja2.render_template('tmpl.jinja2', self.request, context) response.headers['Content-Language'] = 'ru' return response License ------- ``aiohttp_jinja2`` is offered under the Apache 2 license. ======= CHANGES ======= .. towncrier release notes start 1.6 (2023-11-18) ================ - Switch to ``aiohttp.web.AppKey``, and deprecate the old 'static_root_url' key. - Drop Python 3.7, add Python 3.12. 1.5.1 (2023-02-01) ================== - Add support for Python 3.11. - Drop support for decorating non-async functions with @template (deprecated since 0.16). 1.5 (2021-08-21) ================ - Drop support for jinaj2 <3. Add support for 3+. - Don't require ``typing_extensions`` on Python 3.8+. 1.4.2 (2020-11-23) ================== - Add CHANGES.rst to MANIFEST.in and sdist #402 1.4.1 (2020-11-22) ================== - Document async rendering functions #396 1.4.0 (2020-11-12) ================== - Fix type annotation for ``context_processors`` argument #354 - Bump the minimal supported ``aiohttp`` version to 3.6.3 to avoid problems with uncompatibility between ``aiohttp`` and ``yarl`` - Add async rendering support #393 1.3.0 (2020-10-30) ================== - Remove Any from template annotations #343 - Fix type annotation for filters in ``aiohttp_jinja2.setup`` #330 - Drop Python 3.5, support Python 3.9 1.2.0 (2019-10-21) ================== - Add type hints #285 1.1.1 (2019-04-25) ================== - Bump minimal supported ``jinja2`` version to 2.10.1 to avoid security vulnerability problem. 1.1.0 (2018-09-05) ================== - Bump minimal supported ``aiohttp`` version to 3.2 - Use ``request.config_dict`` for accessing ``jinja2`` environment. It allows to reuse jinja rendering engine from parent application. 1.0.0 (2018-03-12) ================== - Allow context_processors to compose from parent apps #195 0.17.0 (2018-03-12) =================== - Auto-cast ``int`` values in ``url()`` jinja function to ``str`` #191 0.16.0 (2018-02-12) =================== - Pin to aiohttp 3.0+ - Deprecate non-async handlers support 0.15.0 (2018-01-30) =================== - Upgrade middleware to new style from aiohttp 2.3+ #182 - Autoescape all templates by default #179 0.13.0 (2016-12-14) =================== - Avoid subtle errors by copying context processor data #51 0.12.0 (2016-12-02) =================== - Add autodeploy script #46 0.11.0 (2016-11-24) =================== - Add jinja2 filters support #41 0.10.0 (2016-10-20) =================== - Rename package to aiohttp-jinja2 #31 0.9.0 (2016-09-26) ================== - Fix reason parameter in HTTPInternalServerError when template is not found #33 0.8.0 (2016-07-12) ================== - Add ability to render template without context #28 0.7.0 (2015-12-30) ================== - Add ability to decorate class based views (available in aiohttp 0.20) #18 - Upgrade aiohttp requirement to version 0.20.0+ 0.6.2 (2015-11-22) ================== - Make app_key parameter from render_string coroutine optional 0.6.0 (2015-10-29) ================== - Fix a bug in middleware (missed coroutine decorator) #16 - Drop Python 3.3 support (switched to aiohttp version v0.18.0) - Simplify context processors initialization by adding parameter to `setup()` 0.5.0 (2015-07-09) ================== - Introduce context processors #14 - Bypass StreamResponse #15 0.4.3 (2015-06-01) ================== - Fix distribution building: add manifest file 0.4.2 (2015-05-21) ================== - Make HTTPInternalServerError exceptions more verbose on console output 0.4.1 (2015-04-05) ================== - Documentation update 0.4.0 (2015-04-02) ================== - Add `render_string` method 0.3.1 (2015-04-01) ================== - Don't allow non-mapping context - Fix tiny documentation issues - Change the library logo 0.3.0 (2015-03-15) ================== - Documentation release 0.2.1 (2015-02-15) ================== - Fix `render_template` function 0.2.0 (2015-02-05) ================== - Migrate to aiohttp 0.14 - Add `status` parameter to template decorator - Drop optional `response` parameter 0.1.0 (2015-01-08) ================== - Initial release ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1700321442.0 aiohttp-jinja2-1.6/aiohttp_jinja2.egg-info/SOURCES.txt0000644000175100001770000000126300000000000023276 0ustar00runnerdocker00000000000000.coveragerc CHANGES.rst LICENSE MANIFEST.in Makefile README.rst pytest.ini requirements-dev.txt setup.cfg setup.py aiohttp_jinja2/__init__.py aiohttp_jinja2/helpers.py aiohttp_jinja2/py.typed aiohttp_jinja2/typedefs.py aiohttp_jinja2.egg-info/PKG-INFO aiohttp_jinja2.egg-info/SOURCES.txt aiohttp_jinja2.egg-info/dependency_links.txt aiohttp_jinja2.egg-info/requires.txt aiohttp_jinja2.egg-info/top_level.txt docs/Makefile docs/aiohttp-icon.ico docs/api.rst docs/conf.py docs/index.rst docs/make.bat docs/_static/aiohttp-icon-128x128.png tests/__init__.py tests/conftest.py tests/test_context_processors.py tests/test_jinja_filters.py tests/test_jinja_globals.py tests/test_simple_renderer.py././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1700321442.0 aiohttp-jinja2-1.6/aiohttp_jinja2.egg-info/dependency_links.txt0000644000175100001770000000000100000000000025456 0ustar00runnerdocker00000000000000 ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1700321442.0 aiohttp-jinja2-1.6/aiohttp_jinja2.egg-info/requires.txt0000644000175100001770000000003500000000000024006 0ustar00runnerdocker00000000000000aiohttp>=3.9.0 jinja2>=3.0.0 ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1700321442.0 aiohttp-jinja2-1.6/aiohttp_jinja2.egg-info/top_level.txt0000644000175100001770000000001700000000000024140 0ustar00runnerdocker00000000000000aiohttp_jinja2 ././@PaxHeader0000000000000000000000000000003400000000000011452 xustar000000000000000028 mtime=1700321442.6210425 aiohttp-jinja2-1.6/docs/0000755000175100001770000000000000000000000015741 5ustar00runnerdocker00000000000000././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1700321430.0 aiohttp-jinja2-1.6/docs/Makefile0000644000175100001770000001521200000000000017402 0ustar00runnerdocker00000000000000# Makefile for Sphinx documentation # # You can set these variables from the command line. SPHINXOPTS = SPHINXBUILD = sphinx-build PAPER = BUILDDIR = _build # User-friendly check for sphinx-build ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1) $(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/) endif # Internal variables. PAPEROPT_a4 = -D latex_paper_size=a4 PAPEROPT_letter = -D latex_paper_size=letter ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . # the i18n builder cannot share the environment and doctrees with the others I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . .PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest gettext help: @echo "Please use \`make ' where is one of" @echo " html to make standalone HTML files" @echo " dirhtml to make HTML files named index.html in directories" @echo " singlehtml to make a single large HTML file" @echo " pickle to make pickle files" @echo " json to make JSON files" @echo " htmlhelp to make HTML files and a HTML help project" @echo " qthelp to make HTML files and a qthelp project" @echo " devhelp to make HTML files and a Devhelp project" @echo " epub to make an epub" @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" @echo " latexpdf to make LaTeX files and run them through pdflatex" @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx" @echo " text to make text files" @echo " man to make manual pages" @echo " texinfo to make Texinfo files" @echo " info to make Texinfo files and run them through makeinfo" @echo " gettext to make PO message catalogs" @echo " changes to make an overview of all changed/added/deprecated items" @echo " xml to make Docutils-native XML files" @echo " pseudoxml to make pseudoxml-XML files for display purposes" @echo " linkcheck to check all external links for integrity" @echo " doctest to run all doctests embedded in the documentation (if enabled)" clean: rm -rf $(BUILDDIR)/* html: $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." dirhtml: $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml @echo @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." singlehtml: $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml @echo @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." pickle: $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle @echo @echo "Build finished; now you can process the pickle files." json: $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json @echo @echo "Build finished; now you can process the JSON files." htmlhelp: $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp @echo @echo "Build finished; now you can run HTML Help Workshop with the" \ ".hhp project file in $(BUILDDIR)/htmlhelp." qthelp: $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp @echo @echo "Build finished; now you can run "qcollectiongenerator" with the" \ ".qhcp project file in $(BUILDDIR)/qthelp, like this:" @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/aiohttp_jinja2.qhcp" @echo "To view the help file:" @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/aiohttp_jinja2.qhc" devhelp: $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp @echo @echo "Build finished." @echo "To view the help file:" @echo "# mkdir -p $$HOME/.local/share/devhelp/aiohttp_jinja2" @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/aiohttp_jinja2" @echo "# devhelp" epub: $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub @echo @echo "Build finished. The epub file is in $(BUILDDIR)/epub." latex: $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex @echo @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." @echo "Run \`make' in that directory to run these through (pdf)latex" \ "(use \`make latexpdf' here to do that automatically)." latexpdf: $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex @echo "Running LaTeX files through pdflatex..." $(MAKE) -C $(BUILDDIR)/latex all-pdf @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." latexpdfja: $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex @echo "Running LaTeX files through platex and dvipdfmx..." $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." text: $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text @echo @echo "Build finished. The text files are in $(BUILDDIR)/text." man: $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man @echo @echo "Build finished. The manual pages are in $(BUILDDIR)/man." texinfo: $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo @echo @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." @echo "Run \`make' in that directory to run these through makeinfo" \ "(use \`make info' here to do that automatically)." info: $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo @echo "Running Texinfo files through makeinfo..." make -C $(BUILDDIR)/texinfo info @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." gettext: $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale @echo @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." changes: $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes @echo @echo "The overview file is in $(BUILDDIR)/changes." linkcheck: $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck @echo @echo "Link check complete; look for any errors in the above output " \ "or in $(BUILDDIR)/linkcheck/output.txt." doctest: $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest @echo "Testing of doctests in the sources finished, look at the " \ "results in $(BUILDDIR)/doctest/output.txt." xml: $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml @echo @echo "Build finished. The XML files are in $(BUILDDIR)/xml." pseudoxml: $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml @echo @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml." ././@PaxHeader0000000000000000000000000000003400000000000011452 xustar000000000000000028 mtime=1700321442.6210425 aiohttp-jinja2-1.6/docs/_static/0000755000175100001770000000000000000000000017367 5ustar00runnerdocker00000000000000././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1700321430.0 aiohttp-jinja2-1.6/docs/_static/aiohttp-icon-128x128.png0000644000175100001770000005131500000000000023433 0ustar00runnerdocker00000000000000‰PNG  IHDR€€L\öœgAMA± üa cHRMz&€„ú€èu0ê`:˜pœºQ<bKGDÿÿÿ ½§“ pHYs  šœtIMEß%}êŒÓQ¼IDATxÚí½é³eÙ•ô[kï3ÜùÍCÎYCªJUR—æju»Û=ÙÆÑ°!6AÁgþ>ñ‰€D`C@Ø€iƒínµm5Ý-©%UI¥š²†ß<ÝéŒ{¯Å‡}ïy÷½ÌTU·¥¶Lp"£êf¾ûî=g­µ×ø[k‘ªâ_’kñVŸ¼m"zêëŸñËþ,“;P9¼½x=É€æbæÅ¿þ,³„~¦N@CëpyïËE*â^¢é"«öêc˜9üw‘%ÿ?.=ÐÝ9ç½÷Þ«j Z¸˜¹¡û§ü̆…ÍæYkÃgþŒpâ_$™¼÷Î9眈EQˆþü®ðEu];çw­µÿb9ñ/€AÞÝëºtã8ÐýOá'š¯Ž¢ÈZÙÿÇЈ|x~"Šã8ŽãOKwu¥øJ}¥¾Vqlˆ-™ˆLÌ6&ƒÌ§äDUUu]«jEAþ”ÄŸÒ—e霳Ö&IÇñ'·/'nzäFûn¼ëÆ»2úX‹cõH  Øgp€LLé §Û¶Å®ÚÁÛ]7Iüãü½º®Ë²ôÞ[kƒ@ü4Øà½?99yðàÁÇ<ÿüó/¿ü²ýS&}E½^ÏÚg}¯úì¬:{TÞ­ïúá#§ìsoüYäϘÀÌ”ôÁ1H¤P®Ör$"¢;—0bRê_7/üùèê—cñ`Û´ó_;¿‚ø;犢˜N§Q6ü¤”Òt:=88xôèу?~<{½^¿ßñź hH_×µµöÙ¤W79*v~X<ø¶ÛÿÕ#k)fµ†GDRS5ûð^ò˜ÞÂ16Vª` ØR=iÔÖÍ/ÈÆk.?®þÙ\d'Ú¿f×?“^ýBºù²í¬\ℵ¶Ûízïó<ŸN§zü…<χÃááááÞÞÞÎÎÎÁÁÁééét:eæ~¿ßjµ˜Ùþô?èú¢(˜¹ÛíFQôÕEyðnöþïÔþˆ§»Õ-C6²÷‰‚BîRz))àc5É9 |©RÅŠ{|ýhëë(NåÞoE§¥`i-»úqõàavÿŸLZÑÖçÛ·1Y‘£tñ–Œ1Ýn·®ë<ÏëºN’$Š¢?–\UU–eÃáðàààñãÇ»»»ÇÇÇãñ8h9"²Ö.//¯­­ý´<ú¢(¼÷­V+MÓ'ßãò³üÑŃoËη£l·gɦ`€àIjFÒU@’\ý‹a”|xFtŸ Ù6m¿NW~Qó#yÿÑ“ûP!bJ[l` ±%Qu~¯¼·3zô‡¼öJzã«ík¯™ÖÒ“J©,Ë<ÏsI’|¢F N]žçûûû{{{»»»ûûû'''Óé´®ëEÑl·Û[[[«««Æ˜Ÿ°‚_UUY–ÖÚN§óäM»Éáä£ß«ÏG‰Œíä‘Ñš 4¿“YÛ¨‰r’?©¸)ê¨m —i5"cã‹|ý×Päþ?Ò³»†¶¡ ›hÚqóJ¤ ãÌ ÔÄ'«ñÖ«ÝÅö6Ÿ¦,˼÷O= MÄ—çùéééÑÑÑþþþ£GŽŽŽÆãñt:½D^"êõzÏ=÷ÜW¿úÕ—^z)Š¢Ÿ$‚Æ/Š¢®ëv»ý¤àûütòÁ?Í?øÇfºÓîô“´Egkq67¥‹$V² Z¸‘ÖÇ)O$ âBQ iéßþW@FîÿC¿¥âA I1ãåe«¡Ù–¦«åè0;ÝóÝ­Ïþåîgþœi/_ú®p¢( GˆTÕ9—eÙh4jýÞÞ^Ð6‹é“Å«Ûí¾øâ‹_øÂ^xá…^¯÷“tCC`•ç9€^¯wɵWÕìtwòÖÿÊ{ßnÉ(&φ™ŒNò,™âäL¥ZÈq’.2‰c´7èÆ¯Rï¦>ü]Ýû–úr1 0ÐÓ¸‹g(p‘mIv"®®<åŽdå¥Îkÿfçö×é"ϼ÷A¢­µÁPïîîîíížœœ„ƒÒÏ¢ÒöööÏÿüÏùË_îv»³ŒÖ??Â1¬ª*Ïó8Ž;Î%{U}0|óï©ËÛ+×Òî2ûã‡zzùŽz@ÄxÂÄ‘ªj©¦‹ö&â\‰üª` *dºú:m~AÞÕGÿV#œ{¦Í§ù\Ëú©ghö#ˆ HA\ÖšKÌ×^|þ_‹Wn-žï¢(‚˜ŸžžVU¢¹OC«õõõ×_ýk_ûÚ`0øÉ¤£ƒÒ/˲(Šv»Ýjµ.z—Åøíÿ+{ãˆóÝv»Gµµ»MK·ùÚ×ôà½èهȎTê ª'`ûÌó…—ž'›Bjïúûÿ÷¿zJ+/ò­_#‚Þû†½«Ppò´CTªÕPçñ´S@äUsòF£U,Ô$«d¿yrô^û•¿Ö}áWòÊŸžžžœœ{||\EUU\rÇãàv»Ý $þ¹N@ЃeY–eÙëõ.E¶õhçì;ÿ­|ðÛë‚'U n%9²iƒ;´ù:u¯Â•zö¡ž¼‡ìPÅ YÜùWãÏþ°­Ká±<øgzr—ûWqðÝW­&RNž¦^<(S(yA^=¥„…)”ÈP¼¥œóP9ä£\2dý—«õ¯OÜÁÁÁÑÑÑh4 é<çÜŸ,R»zõê믿þÅ/~±ßï?!Yö‰n"˜Ü^¯wÑÍ×ìÑwGßý¯¢ñ‡qVj‚œ)™R©†ªˆW)ÝFï­¾D½«¨§þà‡.YK¿ô¦O·öûoêýgLD& 9 ÉOÕ×E\ ¹’›Ù÷²ÖÊ]f×Â…(‰¨r»6ëNiZê0óÇS9ËÁČʡk»ö5NM™¡É'†zËÝn÷ÕW_ý…_ø…›7oÑSTP–eeYFQBµ§fEõƒÜï÷ã[•züî?È~øß·tØj3× \ç €Ø+9€@üDݧïëéûu°tÛ¯~>ºýçžE}Ô¿¦ÝmG:û@CqÅ™^Ð-Nᚸ‘s:U‰Ó:+(«0*hTgõð$Ï2æ2-¥xñ^ÔÉÄå˜þ5ÓYoD6>XÝ?²,{øðáÇ777[­ÖS0Þ{ï½£££~¿íÚµõõõ•••Åïh¨_×õ`0X¤¾ÔÙÙÿc}÷ïv#—bõ° káÜÜ‘p}ÑÖÖäF­—ëÁ|1?óW~\±µŠ•—ðø›D<ãAÔRWÂÍ‚çáΣöT•6×Y­y­…Cîܸƴ䬦¼F娒¢8!' nªª*Yrnx_]iûWgÑbÚ`~?=Tu8îì윞ž&IòXk‹¢øè£Š¢ØØØX^^ÞØØX[[ ½^/89Aó\¢¾/G§ßù¯åþ?ê%ˆYHEgÞ¤…ác§KöPý„LG¹B4é‘I?á1’/êDÓ²ŠŠÉ´¨}å´–²ruå´ò¨<‚ú©œÖ%ŠJkÒI¥¨¼)D¡J¢ª*dœ šE ³ûA ˆ Üt· ®/æV­µÎ¹Pnû”<(ŠâÁƒ}ôÑòò²}ª’ NRç¢(êt:KKK«««ËËËËËËívÛ³¹¹N_PP>?;ùÃÿ‚vþI?%KnѶ¨aŠŒVŽH”êKâª×òLâJµ+óéÄ Ï”LSn g!Éáœ+î~¬'^©öZ9)”N‹ÌeEYÖ¾òuå5ˆíá"ª G¢ª€€ƒkªP áAÅÏâBˆ  ("Cu~X«DK7„sàœðixŒGžçY–©êSÐjµ666VVVvwwƒ‡3™LŽ?~œ¦i’$Ýnw{{ûøø8œ‰8ŽÉåã7þ6ïÿ^7Å$÷ ~}`‚*Ô³äP”…*‚t‰’ªz…—\íÐQZ¹zrðÇ¿çm¿®ëªªBŽ%Ð}VV¬«êÑ÷d:%¯êE½¨œ—ºï¨úE³Ó„qJ³Ü‡(ªJAk)iø±:P¤ó8iö^8_ÔÅ$J{`óÇâA¨€†œëõë×766ì³òò½^oee¥ÝnÇã Ê¡†5½÷qïîîöûý~¿ßétbKõãïFgoµb1$° 4óqD!¢^OÞ[¯6ü£Ÿ³aáOé}íE wäN~­@ñÅJý ŸâJ-…JC¾¼”i°‚Af–÷iÎað# Qªƒ÷¡ªDsˆ³‹à¡ ù˜ K÷lºî&;®êÚÁÕ&ênlò¢Ï^ @§Óét:½^oiiiccãêÕ«ÛÛÛQÙgå(áÉTOp†Ãáp8 2TvLq”PeŒ!Bøþp @áU¡)ì•Õ‹8ªðžÔ"t6ýήI§œöá'á«—lÏ¡»A¾DyqsU‘šâj}Zéˆ@5'@UgoWq$¬Áèì(© Å=´60ݳZ¹Ò»±‰úWš3õÔ²1&MÓv»ÝívûýþÚÚÚêêêÚÚÚÊÊÊÒÒR’$ÏŒ„ÏÎÎîß¿¿»»[Å¥|C8G¢­ñf'*e¥ŽŒ‚íâSÏiGКT‰@Ì ™ØÌ…²ÉŒy2)º×ák?’"Áà&·Wj ÕD'{ìs"ÀçHèl¡¡šª¾"õ€‚¢ÆÉº\Uê‘ ˆ´ 6ÌB ˆ‚ ’…»TEÜEw“=Ô±µä]qVsõ6šcfŒiPƒÁàöíÛ·oßú|yy¹ •.ߥ@ìèèèÍ7ß|ë­·?~\Ex âEÑâ/ûìÄw­–ì‹™ž4¨N?6i5³hlÕyN}"HM¶EÝk(‡šϾŒd@IŸL êÕˆáÉÄD´™é2T5?Dq6Xc5pù\uâ Á>1Ø4?œA¡¢âf¯… U…M©M¦‡(‡0‘*@¤95ÔÛ¶íŸé øëëëwîÜyõÕW···XØ'å=zôÆo¼óÎ;eY6? ¾GÀnœk¤jêÎXÔìršg4‰ Lt‘ÉJZCýŒ%D .ÎäËSԥβ}”C€¾H†±4SpDdÀö<©LŒ¤“";Òâ4„Y0v1ö±ª‡Ì²rª›ó¼é\Ì NUf⣤JP½kZœ!?V¶`NŒ+EµZ»tãNš¦[[[·oß^[[k·ÛÛÛÛëëëO­^°Ì‹yï½÷~øÃîïï æ¢ÛtÉÏU_»Ñ®c©é<ŸLP… -ʸ àÏY¢ й§*œ® YÖÉcª' ëTƒ–&"€-Ø„ø•ˆf¥ÊF¿A‘©‚:›ˆ;˜îÁWQ6suÏ€B¼Bçÿ)GdSE0Á%¨áKò•ú:$‰HÉRw[ëÅ ÎÍ<“, o‰Üx/ZºÑí®Ý¹sçµ×^[[[ …ØOSÅ´—„ ø‹Ô̸”êq“}ò¹a…¯pÁF*©‡rCo‚kîx.ñBÁÿ¶«µŽ¨ƒÉCrùÌy…`Fàý¹ƒ¡*n!_¯ê*ˆÓÑ´×ip“}­Æ„…ƒ¢ŽHÁ‰Ú6Lªd’Yf[)8‚i _Áåê2ˆP{*(N‰#p`Jã8‰gcŒ/üä`ù3/ݺukcc#€Ì†Ãa]ןˆ÷ºÀ€›7ožœœó+"Áõ y¡E®øüL‹adu4û¹µ¥ ‡€Ô+ä‚I˜ýÏ–ˆ¨½I&Öñ}H 7ª4ƒÈØ…èçR¯žØP_Ì€`º—Sw e Õ(0PU@¤ñ’š6ˆuîTÚ‡ "s÷`pŒ¨MdÀ1Æ…šùFuHá~´dó­­­– ( kí‡]`ÀíÛ·[­Öh4 EÝPÚŸL&eYîììŒF£€cðã]Ë`©U‚KG—Œ;©@C¨ã/hfuUˆ@m"Æø‚ïxÁ£Š™A†ž.AD0 _ë¢Q/Gðõ® êhq U˜H£%P´à¡Í bCC𫪠å9ÓÖ¨‹ü` €z`fr5Hù•N4½‘ú!°Öij!Œ}Ò¡&Úíö­[·‚Ú)Ër:žEQtrrò­o}k4ê'{ìs¶V}ÕPŸ.ó@Iƒ@éEÊÒ<¾gên1&Uý%Ÿ;¦ ·®O¡*äk¨×s{ wõïR{Ú›ZOÁQH,Ì.†‰ÈÄd,Èèë¢âU\)¾3¢\¶h-£š¨:(”J@hV #2þæ¶éqñößë®ÿGÁÍ#¢v»`^?ÆØK‘dàUý®­­-//¯®®†²çøè¡–GL^} 6Á–G‘:“r  A¢ÖEº0Qg‹Ø ;E h|tQÕ(fN!=q>Â?90‡ªÀB–ßÌœ¨ò íut¶Pg,.ä`cS°'yšhË€-!QÛb_©B}­Þ) ˜õ¨8#­ Á°Zøˆ}j©#µè§ôüúäúÆ’ÛûN¶óFûÚ—Â$I’çyUU! ñÉ ¸ì©ëzyyÙ3 ^|ñEÙûÎEå÷&~Ry)̹@ž“†: 8g)ÿ AÙLöó#b«Pˆæ},3èUà£>HÛeéi¬:y@s“ Ù™[cR¨ÂMaÛð%Ä“m“ç¿K§Ñœˆ£@¨3ÕȰÁru£vu׉¹s×”ýDz µ#j§u·•'­~¥õøíÿ#Ýx™ãv£TÆãqÇÏ:öÇ”yD2ÐîÚµkvúð:¾äîîüþû'å*爌.h˜…„ Aé9õ;DŒì€Ø€ˆØ@åRÇË\¯)@d t±)l~È|0ÅP7÷k)¸ö U2jÚ")Ô9Ø®‰ÛÄ&øL¤E©y®E€c°ÖGQkyÐ[^iu:±acLDµ­O+Il[qÔ©7Zã÷Û‘¶bj³I'‘U§ÒSŽ¶Ë“·§÷ÿ°÷⯆[ àÆ€’zê!°Ïÿªª––ÎÁb1ªö‡ÿóúÖûúoÜ;ø§¦ 6˜KÔŸ‰ÿyâeÁ‡é¬“‰0Ý£ @Ll¡þ²tž+~&ˆ>!>J4ƒ`•H$œ€¨k#Cff%ýå¤=¨«òôôTÊÒŸža4F]£éDÄû¥áðÅÁÊö«¯¤ËƒØš$IŒšéljEÙHo™]OãûDDÊ(k¨×áÈÂO§¶—Ýý¿Û׿lÒþâ!pÎ=õØgaLŒ1MÂÀôãoÒé{‘hîßÛØ¾Ñ;z0)W2Dö<° D_t6à€µ×È&˜ìÎÕôü7Œ…—‹y{˜%ƒi1Y9G3 áŠj—v¬‘Ñ8iEý•4á4‰’8êmÝYZ»ÅÉñéè;¿ý;£ï[7÷ßæ–@E ºV”Ÿy÷Ý›Iýµ¿l®_#õŠëÕIÛÞ ʼü"Mw!•’!×M…C¡äN“¸SŒ>š>øVÿÎo4‡€™Ÿe ì³€·5;å$ïÿjoê<ü­Í—­÷Áß9˜ˆ÷Jê@f!¹)PwÁ—bn¯SÔÁd*l“ üöQ~Î6‚'’@ïUÁqÏý§Užm"U§à4¢Ï_Oo®'Ýí—ãÁ“7LñÒÍþ/YUοû~7úøžL§ÎZ6†ç|³V@&2DþíwušÅóß2×¶I5\÷ù‘' ’Ö*µ70¾OÊ`†”çÏ RŸw’šÕüÃoto}ãNøAš¦Y–%Iòä!°OêŸÐ»²,Ì}'ï% ˆŽÞX½þ¹kϽ|:ysTÀy°Óȉ@ZD/©ì´¨Ë“=ROÆ^H!¨vbl.µ:¦4È ¶-YƨÐ{Gòàt–ZHyè%—ˆT¡®›&7ד›ÛKɵk°–Û¾ör”¶jW¿õ/XûA’x_ª.¢ÁŒêóiúB«50†ŒÑëÿýÿ¤¿õ7L§Í&Šú׫rbµm¬ÿEm² Y‚ŒgømõJ]©ôóì ß{»sã+;”eYȧý84ÐÚÀ«y*Óew'¡Ò˜í~㳯ýå~õñt2—ÚqÛ©õuV×u@y0Ã,‹K6£;{÷Þ«3ÆÙEŸ’ kýè«ÏVÚ¢å˜Y-W̲'õ‡qª0† ªJ¤3»ôê©,wl«; 8V…ªpkͦK€zçÜ7ùøä•n·RE5ÿYUuÙÚekÛAK0ËÛï¹ï½Éö—dûל°ªH{ש³7 ò9r’ 8bÃ$‘é´ª(/ë¶JƒB\UUA=“MÅ5`†fÀÂÓýѺ±UÜmöàÊæÁÚë¿Vßý»u•pâË¢vÊïÌd Qo£¼ù×ßÿÎ?ÈøäX»`sî᫊Hbu­ÝXo­õ£z u#¢PTb†°Õ—å6ö'2 DAzÉ„4>“.¥Ub…¢V°#^u6ˆBÝÞþàmTªy äBÏ0 Ñ©÷;UÅDKÖvŒ!ÿïëW¿Jí”@ä§þìcWÕîý?yà´vUîª)í˜z)"ËD Ž£äF¦+ÕòZ²v§ÑB¡žx©ãÃ^2¿!´˜zËýQŵ Äó“/ÑÑ&¯ü2ü®æûyèDc¨Z¯3­l’žù¹¿|üÝÊ>8Y¢âD \vÒ•Ž¹²’´bCDQÚ’|¨8ÿêÈêr‡–ÚØ›“1«S-Š?))Ä3s¯Å1e° ”ª0&]}øñøèx§(TÕýª*,¨c"‚1»ÎY¶_×7’äz’ôŒÁƒõÝ÷ùÖMñ~:,&{'U]×µ¯O(?•¢â¬L²Ì‹àæ*ÝÙ õx–³õìå÷~¯a@P>¡ShÑ?…išž›Ô*«vÞlO0ý…tt®£éÆoèÇÿ;È@j”SHB3‡\‰ Ýùwt´ow¾µÝkÝY×ãÒìLe–‚†2¡—òíô¹­vš0-†¨æ! ÃÚNܠ͘9¬ßêŤÊd¬öº-cÜR1ª^“IUTDŽÞÿèîht·,D2€/UHˆØ˜BdÇûçŽëzìýVù<¯þèûõpTæÅdx4=¼_VUU¹jtVgZ{ªj.ÊØyql7W£µØ„&rEb|öðäóÿF0Å¡%4´Ü<“OêŸòôFFS]ƒm“DZî‹?óïRºªÅ \®¨‰Y% ŸE·lKÞùŸM"ê¶ã(ây‹ƒ-wÓKa¨Ë5;RõdcG¶ÌÔNx¹Í‰QQ!8@@Là‹q±!6h[眖ÞkU{ï+f•R”Å»÷¼1™ì9:¿Õß@ ‰È£Ì…sêzìý’µN¤üÁ[õÁAQ”e‘ÕÓOª²Ax"â`´æ9xG>‹¬ÁðÃòèÃÖ•Ï7¦¸,ËÞoDÜ^2Á\œWv`ëÕP—#ê;"ù¡NÒúõÞÿ©¾\“Z¡×hãçäÍÿF]Qyz8¤™ý‘ „Y"]i˜ù»{y›;WÚ+zÀ¡ÿ´Êö%ÓŽi­gº Fe b‚zðºª2Ô°Ž§å}G‚coÄ9)¼‰‡?R2ãñø½ÃÃ#çšìüy.sM6Ì©‹œÖ5˜Ni4TDˆÙˆ„Œ!;«ÒrKŸßà­™QÕågÃâñ÷Å|¡æØKúg±ê«®ªö¾Û¦,PM}I&Q>g|‡oý&Ýû­à–(TRç?ÿåý¿«ùQéùÃ#ys?¾{ì ÏÌLêCD̦öúøÔNÏvÏ>¿<¼Ò‡!H•KmÇ8Y¥gYÀg9"3Cªè…¢šbø‰ŒWuj… Ï=_šÕ.âÔDD0†È™$d–‰É4ÖÉ&³<¶Öó|öbÙGgxˆyop›A%€0Âk yެë÷øèx–°º˜‹nØp¡’KK`©"H5ˆˆ ÙFU¨ˆªˆ†Ûðêæ5ÚÙ}ªE]¾ç£Ü[ÃcÛtd\jùP_¹Ó»-ºPŽ"¨óUDª”ô(]ö& ·î¦»ð (1Gñ¼¿€.ö( T”˜|e€9G`Î*ð„¤q{.ÄñêiÎ YµY[X­ê`Zd["W²‰ˆ™W–ušQ–¡‘ñ…†‹Ë91ô¹× ?ò®WÍ$±Î!õü TH äfÞ"±"Cùéê«!åɧ0 Á]ƒ®Š¡Lv 3à.ÞµmumÀû’ׯ÷®³MÏÍZgSË#TC"Û vèbæ,œxGÄ3T!5toÊ÷¡‚8Kí-âˆ.nX'‡ähVUEÔ…TTgÎÅQk DEn}U—\VaôVƒz XT5àqTµÓÆòÀˆl¹idÔZc©-cEl³Äp±E¿…åÔ©//øf3`¸‘ÉŽ/†¶³¾g¿À€Æ´ÛçAËNI,'[D,ú]Ók혽m_Ú™H£>ù2À#Hf1ÿ …p±B&4ÕÄ9²âü¬4ÆÚœÂs,T,Ó¼`C¢ÄDSLNU< ¢•W2q‡™l§#W¶ëG;TÆZfnMœ[bn3ÇÖòöVòÙ—’¥Ad­±Fó#®zIÅ‘Üi<™ÆÜ‰ E(,U‘¡Øš¥^‹¸|’Pl-ÕÆçg Œ1U0E!øXÿ\趘ˆm{!ÝÚD¨QÔiÅ©rõšðÀe_U/óB SYƒ6÷" ŠN„.šš9±ƒòa‚aþ›á5ŒKò.¶Æ,Ý`›bü€¢”Û†‰HT¹µ¼•t–¬5ÞËGKƒáÃÇ:™Â{š‹¼U½Õé\¿vµýÚç[Ÿû|ÚíXV6Æ÷tìb»ÂÆZ8sth–†˜àÙ1£EŽ;6íhq¹Y•a©†›%k/6'`qÞ,†Ènz`à/Åœ3¹Œ;\± tâ'wš‹–§ZŽ~^”^3aV½j:ÎTáÅ;&E QøˆÀ&Á'òLlÈ2‘a†e2†,Ã0â(6I;2d<³–&îÚ+¯ò|ò#³n`@Ë+¦³dõu¶n·—6«ºö"wÁe6ÕªBY‰«ÅK’Ä×ùϼüµ¯öÖV¬µ0 k]ž>¬òS»Ò N<Ÿ}`hÌ© Ɇ&‰Ái‡Œ•ЧvI_“ˆ›,iìî…p |èó}fGˆ.PØÙ42U+º­¨,ê99îR~@åNÜrLžC-›@NDuZaRÛMÝ‘[iù+«ÆÚ„™ ƒ †}…©¶†™`æÈ01Á²L†a‰ÚK6Ь!Ö6ˆ¢çþ"&i÷pµelUíbc›â¾ªJUW~'1dõÚêêÚý‡]™4U(‰°HwÐ_õ•Õ+[3<“ÔùäØßµ\Ï|Ýì?œf_§ˆŠ;d,²©Úu¾hîÊì|¾~&˜ƒÛÌ€ ÿ{’RœD\ì¢b 6wˆ(‰Íör\ÜZŸ´^0Ã÷´šØí¯ØÃÃxYŒaÃb˜ Ã2¬ Ë܃S¼{°†ªh;ÒÖÝ—nI§f"à ҈ :o¼&ÒX/fÎ9éqÜ ]6”lâú¯Èþrøû°ª¦†‰Oþ¸>ú¾®‰¢®‰lW¾39~\ä9ÔR2eÌrUÎ+\9>¨‡;ÜÛŽÚ-‰˜ò=>}“ቨ/f~°M(j5xŽ;â« è.Ræª.N/E—UP8çIqZM˜®†ˆ¼_0Ólɦª {ŽËJŠZ¦'g#JOÆåäÁ·cäKh©c;1âl7QJêbÖÝEnÈ×SçgQ¨ŒªÒ¢å—Z}1§tMdTÍ¥±b·ADW9|ðÃ?øè‡£*¯´rB‹«H"p¢ªe‰QÅ ÃÇÆ·"íĺ>Õõ“é´öBPGâæóP "*~2­óq®Qfô€k•XU½Wwïÿq·~3ÏÿY&ÈU¼”‘A»uÒ±µ–BˆÎÌZŽ5?™× Ø–jL&]l\¼ ‚|Rލie5M(ýñÄýñÄ #ç߮ǻÌÜŠ¹ß2=Sôh²ÒF?ÅòÁI:.’ªL’”ç#"É—®ž:¿ÌK~Ž’ËT›*ªTÕ.©=‰‚˰iÂÄ>¢7boDEMV³%2Ä\T|TEZUxûÛ$y/áë«Ñ+×âç×à5)ggÑl”2Qnïµ®*ñU™NÊ/®×¯}æÊZßO¨ò¢ça"QúÊ!«P:觸¶‚£),ë°€c …&ÍŠóD³Š4‰ÍÍAý¹u}~Ý®t˜ò¡"§K‹ƒPÂ/ÎTÐ"FuÑ'ý­•~º¹d—RªýäÁtɹ\]ÁÄ*žÀê+Ìg°1éskü•¯<=ÚKN®©.À•J©JNàär‚â,‘¥2<Â0ÇáÆP’DispOaÈÄ ¦ö–új*N="‹Õ.¯÷l¯…´m¤t§~pf†µI†ßê¹—¶hc5^ŠÎzk70ÝQ¯ÍÐéÁö¨'&5² ^4èΦ®vðèTÞ| ’WP1¢ÎÈü|ñŠŠ¨¿¶Öúò•ú¥ “\ÄŸ‹’Pd»—pÙ†,NµíU´tr«WW·Ò[½/<~÷î¾òJ˜M´`c‹^J‰¥ëfkk½[´€!£­‹Gµ‡#ŽÀ& ì ¨6lL”šØ<EɺwwÝÇG’ûXÔ 11‘ª€¯äF»RW·Vôµëüº_ŠsVM£é`ƒÔwŽ*Ž­’!&”•­ôø¹m»ÕW6kñÒm=|Cíº°€•LDÍËÓ bÀk!Q.‘7ÖXJ"lÄJ‘?ÌêÓÒW®ç9ÇKıV£ÜF$+]´"zqµÜZk§½'^¬Øžím£­.¶ÏŸ« P«\èR^"Û‘|¯ËÕKŸùꕸkœ>&©‚ò#ElÌÆ’ùܵd¹kÖº¦ß_ !-†‡B´¡F<2’Ø "%(ˆÙØ´%Cƒ.^NÔØr\å{C-ko•£È()T$ê×ãƒÄV:rg•^\ѕđlÊA«Õëv­ÁfÎ` ±‰bÛN$1$×)YÓºT3¨5xU˜Zƒ#¨<8ª¥¤Â 3»Ü——¯OV:ùÙ°þþC7©†ˆ{(Nøn*_Øæ¬ö«¥^qÚÌg `*ïˆÒ-ÓZ9xæÍbç' Ù·µxLÜåþu7ý I[ƒÛ_kÝûífºhmˆ—ÛæÅ­x­gá(IÅ•‘ÏÔOt ©xy"mÅ&ެMcBAD­˜®,Gw¶|'q÷\)^”¤Q[ÉRqxcÙ__æçÖxÐâùT ç¤Î'.Ëófq¾E€ü3¼Õ±JITõdæ]¼Ùø tš×BÒV,×Vuk99;ÂÇG>ϧެ’‰ÕWDhE¸½NÛËÎohM.'"½òò¶™÷*…°ˆÿ俏Ĺ ŽV_p^µÿ¼­Ž>¨„BÙ SÒ` Ø…Q—«8¸á,èug /ª^´?BhN–‘¦mŽ“@“¥¶ùܵôË·“^(Ú(J–´Æäž_ãW¶Íö€í\²ºztŠwvõÞþ$«ü…é@ª^µ¬Š³i9Îu\éx4̲l’k^é¹47"ª=²RŠZæîЍ±¥v̽~”DLRAjŠÚá» Sb}©a†LIòKíÌN-ßn<ÀfÎèSâ€àÃUUÕÌŽ×?3æ4_~íìýoìNPº 3潯Çyõð$ö¢&ŽíégS.Çär&sžUãÂE^n"@VbÃ#¦-U¥ª–±Ú㨷Ý¥ÆÔJF™À‘N÷#K+ZjSdЊþÝ]úè£R 3kHZ…žÓÃQùÃǤà%‹ìÞçÔ¥#õÏêQòûl*çO¦~èæS)ÂXPœeꨴš ê¢8ƒÂ‰œn©ÒVLPw†8Á/ ‡¨µòÜ¢øðÃÓm@z΀囲úÒq¿õæ>Þ—ã)J'!™ú½Èñ¸øÁ{ï£VO? ½CãF–a˜¬eÍ«Ñá°'ŠY±*d¦D×qîwNŠvjP¸ DX{-ßúõbï]Œ@ƨõžÓ©•§ÓŠz)fH®à4×½1;Ø$&Ã4oøy•£)Ÿf¨]Sô.M§^£¢âÈZ f,4²±µ¯wμ—²ßª%*ç9x”N‡ Të)Òeñ“J>8Ô$ÂõM,©ä$5}*à¼×x/];ϧ—e³ÇïB2.œ€(ŠçÄÙÖ2ßþ‹£·¿ùðpzÿDàHE”Î2•`(ÎñàŒ†ªJdì â ªRKîµ5Ë…„áUðNpï eÎ0D댺WãúŠìÞÝßß úÙ%K>~å£Éb>»¹f–Z S+|¿…kËxt†Qm¢Ø‰ÎÉÄVn«ª@Ám8Q5 ØDÄLÄ ¶ £MH‘ká½a½?’Ù ;šáäBªF”L¾†xؾúýdY—ZHz U­N(m!YA{Ë›MÛ{Á.XàÐ2¿Ø¬z΀Ð6NÏžmký¥žû;·ÖÌÑT3¹ðÔyݧäKU!² ªC=Ç´ ™9²ŸÈB•™DxZi~êgM /ÓÇš]XØí™9ûV¶á²a7Õ~Kˆú©n 0hѨô€¨Bk¢Ùp@U¡(Ñ: ucžÈà‰¸Ddã”™U… êµa:´™ŒïÕå°mTg×Þ[V&!n¡½MKŸ¡åÏ!]÷UVíþ(é®6Iˆ0ôôÒZ— °ÖªjàÒ žØ$öÛ+ñÊ‘;ÎÔͶMˆûhmRÜ›…Kõ„’ê1ͱÇ<ÇŒIhT‡$ta<Ó†mŠ4*²ê[k«h)7½Ú@uð˜É²r“WQ­À ÔA¦#@†ÔÄ„ª…\ÿy‡ ³±êÂ…‚ÁùžÖfx(³ÖSJWB/gñÊúvû…/òæKëä¡ìþ.Ê¢.3—WýWÿíEñoºõž~Â~ËétÚéÌܦ¨»iW^æƒ-Œ> ³Ú›Ô»Ia—TøD“ îaò@ó}  “À¦dZ` ƒlËÑâ|”PÔ4-6ö©óDBØâ£Ô$K` óª-¼—Ú×B¡ê5À››&%õ.ønPG&Y@›^ðJP°’ªœ»³¡6t>Q R‚ â™–]^íÜþ\åþßÇä‘úL¿*aV¿ ®/ÎMÍIO9 r:´p4#Ù‰mrõëåÛ¿§l• Ä¡Pªé*õn7sb̈ˆˆ"êÞRnÜ€ªTZeLdâY<¶ „Lxk¶½¨ 1 iZQ°E2˜ 7Sµ-×n×v Q(²¤>ÀD½ïˆÙ{ѺÖzÖllŒ4Ý"—´ªŠzunÖ롳qÆ‹..8¢¨…¨ Ž´ÊdÇ=xä+o"FÔBÔ&‚wRV¾uýÏ҉ʲlµZÏì^4yžw»Ý™ÚxÕ&ÝåÖÙr‡Ï² "no‡Žã8I’f¾¶ªªt6üñ;¨§¤!¬ 2Û(Lk"¡#©TS¤¾¹×Å̪Z×µ¨F­žÚ$&êm­Ïß@ûG'~T2AT…À^D½Q÷SM"ëí²ª¼–Nyâ Uaã_¬ÌÝ õeN>76bà °!¨Gæ"ÄKµàs-‡ê {q µÀÑ9¬¨«L:W[W¿t>î!ÏCÒ¥qöÒ¸¬°Îw2™4 Hú›w¾n‹ÿ©•ØïÜÓI®jÚˆ:¡ïòÚµk/½ôRÇÍpmッŠêÝå5Nô8£*ÀUÔC ˆ½÷–e½m­Ä‰5 -j?wǤƒ,Ë=z4/%ooow?³ÅŸý[6)ôô‡}¬Rõ[üâ¶h\øQ 7óê¡LºÖ¡W¶p}-Æ ¯wïIYœVÉ›;t0ö*®™{¡GÌ×1Êõ¾^_‘åå¶(”åÎf‘Þøá‡‡‡û»~ú¾@ÔC¼ÒŽéÅ-»Þçh±Þ᪢ªã~±¤³Ë.Í^½<ª ˜$I&“Ilnkí¥¿¨þaVc&¤0 ‡€bmmí³Ÿýl¿ßoæk‡™óUú?|x’ó[;2®Måæ­XâÈÄD†¯¬&_~qÐI­TY~x_×NÚ¯üÆh< óS³†õ Þ½Yü¨÷à;Xÿoþlý’~›ÎÞé&U7¥ÈŠWá¹Fó†ÐŠ°Ù§«±¹¶îGÖøäÀõîŸeÇSõâU{cTD\‘®´é¥ ½º¡šôhð­ÿœ1öôÁ÷î¿ýÁI1öÞ)¾bu¬½¹fm^@šxWµY^¾ýë‹ñWY–aqÏÖAècžL&++36Y»“^ýº{ü[¡h6SŽó¶¿0|Q”Tµ¤öŒØpc±¥TÅûà_tS³µ”¤1ËÙÐ|~ôíéö•_iµZ‹èIñ5O>ê÷>ꦖÜPv¾AßÂÆWyë°þ5<þ§º÷ŽŠƒÎ~4Û†XCÆZ6¤¶c6^\ETê`ÌÏϯ!Ž k'5ýíWèÆŸ…Š|êinPnîIEk£nª†Ïñ(âÊ¢töêÏ'«wšŸL&A½¸šF %I2ƒÁ¬c€Lû…¿T~ûª9ÅËõ†Øâ)Ð.Ÿs¶KÌ¢(4®ýÅyWâ³”1s5B5dcŒäùþËüñ›’mª¯!NµÖzêÇ»¶Þ‰Ì†Ð‘QŸãà[2|ŸV^¡+¿Šñu½û¡™.”»Át“¨Ub'2—šC4øÜ‹uª\%þù_ÃÆŠ<ø]ä;aä‘‚á „‰œL*ïG¼Á/«8çê’úƒÿRþ‘étš¦é“úç)ó‚B£d÷7™Lš}céæçÌæ×ýÃûÈæ{b"ŠûOu$ø£wpö!çÞL©¼ süæƒâPQë¼VUûÁmgæ6ÕÅÎ?ug_q‡wka"­ÙåLr©9 R©Ïõè 9~W²tùUœ}/TÄö$ÈÆ—à2_*=P­gNÔÄ¡¹UÕ•*Q˷תöZöø{rrêÐ^FˆÝ¤P©83 *%LêÝ™b†IW¥7W~!Ýüü¢ø«j³ñÐ8£I’ ‡Ã^¯7ëíç¨õÜ_ð¿ÿŸÊh— ~bìÒÓ±yRœÔïþ÷Ö…lIi^U¢˜%jf­…¡޽ÂOOU2šÏi%PÜê'Ilê‘Wc¢ã9é˜%WhÜWèÞ7帋hÑ2²=•ÙØqMWõ…?g~þ7ÍÒ-sý— bÝÃ㿇ɟÎŽŠ[õ:Ûd[Z—;÷ëDôš%"ªrmEÈf‹æ}äKØøŠËÕµó¥Y^zé¯/zŸãñ8I’<É~jàc­MÓÔ9×x#âVmìE¥úÌ}¨uv ØëÇ‹ïþ'|ü{lÕ™VæMå/ÁÛ©«|v|yìFk‰THýlô«Ô¡?ŸØv¨R‘/HJUÑj¤ãûpSt¯#(Ý›|ã/ðÍßà¥çabp “R²¤­Mê߯àyzó¼µ êh÷ªªÈè¾Ïjçk!™õÄWäJ’‰JqáÄÔWjbà2H-¾Ê+‰nüùtãÕEçÇ{ôϧ[Ù˜â$IÎÎΚ¥{ Ž–ž—£CÑ’˜QžVo–'W‹£»µ_’zêߑǿe÷L¼+´ÈrWU¤™\žOJ%ï|9ô#IÏI+žºÛ€ƒ1ðæ3YPB&‚µì±DT˜”=ˆµ8SW¡µ‰d›Z+Ê饭¦ÁUØz7utŸ|®éT5;@È!*EJŠ%JŒmðv.B" y P» f¥v%¶îl­¾ü¯7vED†Ãaš¦?fxî3¹ ‡ÃÆâ¸cºWýø‘5Sm™Éê7þó"U‚·ZG†8YSTøb"U¡^Ô‡Y¿h’*¢ä ÛCŸ3@½v¶ ÷ÀF• ² ã‰ktĤ°|a~qÚ''d@¹’*Eê*ˆ§öz@e=Ù¬p~^9¢þM-‡(öµš‚Æj;pM‰Æíùו€í‚‡Jµ†Ý'Pƒ#ÖÄÚZÊŠaû¥¿±˜{F"ò,óûLÔh¡8ŽšR¥ªÚö*’e/[¤Ë¶:MuÜ2UËHd S˜9ï€Z!Ëqüü¿ó™ZZCÆO€ë»äó`(!Ç©^PÔ"—êš6"›’I…m‡Ó¢ÖÚ¥òä%,ø­azÖñññb£žínzXKQO'ÂÎ%„? UJ &µFŸ|þÙ{ ø1i‰y¢ĈÚêC¤&ª¢ZÔêf¿lÄq—˜ÁD¶¥óD¥Ëwßì½yÖplU¥d QêUÜ"oDUf}<•RxQ?…@5Tb ô^þËÏÊ>==eæ/þŸÀ€` Úíöd2™L& rÓ2í5o:âJø¼éR›?dÝ,q„aâYH¥6¶øi÷âá†MF’˜ÙÆó&½°VG¥Sçô¶›ÌøÃ‘ÂÎ&÷Eýóò¥ïoŠ_Œòñ@ÃúŒ…i±"aq!¥›5\8Uâ£Þ´¢Ös.Yº±h{³,k·ÛQ=Õùùd„¼|8I’5¹Uµ­Š®8“ù˜Ž'[ìfë)˜Ï5ü\ùÌ†Ý œ'‘Œ|v^%g ©çâ¯óT¼ä•¸s¼@èÃZH& "%’}‹>VÕ ý?qÉç'ì> – ¬/ <mA4¸áL·¦¶’¥PoÂùb‹vLIzô|ÆÆÌÂRåPÔÊD*¥ºQ©9¨o䬱ÞÓÒM _9!_êÏR…¨TÖœ»ú”ÎC€™ƒZXìÒR=ÖÍøE}iÆ,(tœ„8ìD[›Ÿ3­åæmãñ8T´ÂÜôOÜãó +ÍC‘ L} %û€m9ŽÚfýæiu¿mëX´™– B¤bÃó}SúÛE³R&8) ¢#cŠ8³'ÓÂ7þR3ë”ûÇùr7Úê´/Y ejq³Å2Ok¿ +Cåõü ¸¢iaTõª5`E¨]¤žovÌÀ«¯F42­5¯pÎ…ÌqY–ÇÇÇív»ñýñI×'ï”wÎ ‡ÃãããÑhö $ó)^ιq<æWvïÿ~ärB!^œ¨ û#Ϧr2ïLjf?)à§½õ{C(È‹'>ƒ­ë¥»;'®ra Öyºx”ëÝÝbmÐ[ÝŒÍE¢Ïµ„™U¥ÎUbSa>ZkÛívÀ™5®Ç³Z³óéDPTætLPõç!ª§Sͪ™c& u·½éìïï?~üøúõëQZkåóÇ^cõ”nIÕÑhôÖ[o=|øpww·®ëPZ <¨ëzgg'Ë–Üx©Ø{@ðaH˜W8¯ ˆÂyö0^É,–&µLŽqïtVí&`Šî#L*ÌçC  êDO†~”{ç¡ê¼TµœLê“q•Waøü˜ânˆ2²,{üøñÝ»w¡ôïôôt1¬/POufT ªâœÛ?’º:؉VN4«pr*®&ñp 3Øâtçù‡~ ¬øõÞƒ8ŽŸ•xøc3 ØÞ·ÞzëîݻͦÊ0^=TÁ†ÃaØ®äݺŸìX³iºˆ**5±Q2Mgah› +}(¬¥šõõî‚·G â$áØiEdE1.ü½½ìÞ~vo?Ÿä>Œ‹–ìâ¥KªzvvöÆo|üñÇ ˆRE8ÊA?ølŸšç¼y¡öþÁ‰<:%Uï•ü|#{8•µ²é]5­å€ ÙÙÙ!¢«W¯nnnöûýYËÔ§^îl?Ñ7@¢°£2ˆRàAq6;é »ÉŽ!oAϧ©JEPOÄza‡g3mV li* º€4žÁUHÕM-Î&õîß}8É*µÖW²Ô.?¶q/ÌÊó<ÏóKÂØàŽ$?Òü€÷‚…"ÁÌKžežyž¬S6ý¶»ÞHXpÖëºîv»Ÿ^õZ/(Hzó¡ ˆ1`Ùs‹ÊÊ´×LÿºWëgAdãŒ;U?›Q#~¶±¢Ù̬¶Ÿ• BNe4ˆÃPö¥º@·e×qš˜Y¡Æ×êjJ–8j¹Ó´Î/¥€˜W ŸÊä>© ˆ¹{æg~ÔÌ·Ò¦™Ãy8DfpËv7p¾w¶úw0´Z­OéùüñŒpƒelæKm¤Ñù›Óe"ãÆÕÖ„³UT³Íáêi¡{–}‘¹®J®VU™Ïû [¯Y4@« µ’¥v´µœôÛötâ¡¢®D²¤é M“Ë˸»ÍÉø’:V­3ï*LwX*Ìe6…Nä|&]€ÚTáE½iEK·(î-ÆaËz«Õj·Ûê*„Ü­V+Tvš™OÁ»=‹ã9éG&®Gœ›Í#øù8Y@\³ùË2Ú±¤ÆY“FFãþÙqqv4®…¢gfÖõ]êfRqZO£¸ßkG±eêJÄ=$Ë:~_01ù©Œï»ìQl lÈ$Z µ¢<£¨Íé’fÙ"FIçkTÂY˜§¡ÈyÕx-Ý4qg1Æ›¾Úív«Õú4AïŸq_»víôôôáÇ͆óæã–¦i«ÕZTS¤7³Ã»ÙñÇUåDqaæ­ fÓ‹´×¢×ýf_Û1 Sl||uéíåíÉÞ032iÉÌ”ÆteÅ®ö¬µaSPF6åÙæÊZM‹’îÀB'uð™ÖS u®¡8B="bª&+0-¸éù˜óîÌÕZ8]º-ߘªªB>&@•꺎ãxyyyss³Ýnÿ ¨ÿ©¦iØâVUÕb,hÛÛÛ[[[:Îòòr ~°£Ñ—ßÿþ7>zûª<3—æ‹13z‰ÜÙôÏmP+ ‚yS'ë‘H & ZgeÐ6í¤Éo{©'ŠØ²²‰%^¢é¹ç;ýÞÛˆâ”I¤Bì(îa:,œ:ï¨<Ñh€z²°ûlæ8DKm´µ–;×~1]É‹žÝ»w/Àƒý³Öv:7n<÷Üs‹3· ˆ¢hcc£(Š>úèÒ0ë+_ùJ€…-Æ::<<ÌóbÿÌåÞ®‹cËÊ´°ÁD‘1¨û)Z¬™aªì°ÒÛ^IT g¡Ç&d(ç$&ø²mhkcõÀÙ“à²Þ¿q HWZr}#Š©uÄôŸ+?ºw$'S–jHÉ L )¡2ë| »²A«}û¹×¾vëk³³ö3çyþÁìííeYV–eèç +S777¯\¹²8óÿ'Ì€Χ,}ž&JŸn·k­Ç>ÜÞÞnµZªZE–ež’xù—/»ÉK¦€Î£1Åž#3Ç©(¹ºÖT¨6B„‘²D ¯K­m¬ö—^ûú¯æ¿ó¿½±›dTöÚM·×ͯ¾bÚqG“Zzþ¾ÿ~õ½³q©e­ZM-¡Ø‡’Â$€%î´oÿÒí_þ÷6·¯SÊSUUeYñ€œ‘<ÏŸ¤ÌO˜ ­/y¨A/UUr¼Ì<™L>|¸¾¾> ÂN\bLkãÏŽ\qÌêÂC†ØöÅhzÔŠ5=ðT!Ah©š—ð#n+Y~¤ék¨”S1]“Æqk)ÌÀÐù,ï0b{4…Ö¹Kí] è|±¿ú§ežÊ€ è§Ói©k\ °ñððp:>¹½Œlj»[†„–Zeˌʖ«ãˆ­a§ZggÊ1š*d¬†To¾NK×å½ÿR|啽/d+îa'KVi^³Â‘!Z“⨎¸¦–óYíQ‡ãA”.¨ú¼7KW”eùøñcç\¨áh[HÆ4ï½/Š"¤?Ý€…a¯‹I•ªªò<_¬ 5Ç3˜¦`¦‹± lˆÓ•ÛË_üÕn’ÕûoŒ~DÅaQH6×~U)žíL Íç;©Rÿ]û%ùð¿Óꌈ½À{õ¾sèªhòèªRzW\yfäNŠÒɰ|XFšc{ÍÔë&¼Z„³=~ü¸×ëõûý4MC9äIO?¸'EQ4--?­ðÔCúг, Û;ŠÄ<´$„æ´¶\ÊÓªj”t»Wîðµ/øbXž|4ýð&?ü¼(k$$eöÊè"ì£>Ýþ«²ûÛ:½޼HåQ ©x&¯°óFU…xOœ•º?Ô¥Ž±é€z7Í•/¦|£½Õ‰³ªª~’ôÍ.ÓP·éõzÝn78ÖOÍ1„ƒÖÂüÄ9$/ñ œ€²,¨}‘šeY¸­À’°¥)4ê6\,³I—ZÛ_$7×¶Žù½bzªÅ‰ÔSø‚´NØÕj¦«¿Ä‡ê£o"1ÓRòŠœ(£VbÑ&ª2d¢ÒöóåÏ&_øåÁÖ˶· NŠÐ;J ¤†7Š¢ð× ™ƒ×÷$eŠÙ9·˜ùÉ3 ¨ø†ÉÍV(´4-2 ŽãÍÍM" ¦,ƒe fÙÓn··¶¶.q.Žãç_øL¯¿4˜ªW_Áå,Å•k+ñÍÏú“ïêÕßTW¨ººª¦ù$OŽ%-Ù„("Žˆ ™ØØ$Z]‹®ý|ûÆ/Ææ£bÂ/*œº®Ã×5f6Ïó³³³<ÏCxÿduóIéü)Ú"êv»ÛÛÛˆXØzÎé¥cÁÌ[[[I’4nhØ‘tQUUu]½¹²²ž?h0"jµZwîܹuëÖ% eæN§“¦)ßü|“Ð(ËâàÝw£“oÆÓŸ¼gy/—ÜÄE„¶ª nHÜ9ç\@C;}{{{<‡O ,Œ¢huuõ’ðýT°ººú¹Ï}î¹çž _þ¦Ûív:KµïååååååÅÚ¬_¸‚¯jjišöz½v»$Éâ*õ{[¬àºöÕÓB¡Æ›,Ëò’Š$5˜Ö '"$yƒA£'£(º~ýú׿þõ°84cQ¸Ûk×®ýtSD´HÐOù+—^‡ø œ†4Muö×—eypp5¤×CuéÓX¶ð¶Ð¬¹¨aB›÷>É<ϳ,;>>^YY¹sçÎâ±hj–!ÔŠ¢h0loo¯®®†ˆãøÊ•+W®\ çµ™zÞüÏ ?eƒÓŸÂÕˆgcÂUϯð„¡Ú—$I¨ÊB7(•eyïÞ½÷ߟ™ÃñZükíÕ«W_}õÕ†)‹  žBø.3¿Â›ÿHñ/†—ì¦Í¸¹Â1oZ_=àE`aä%0hÚùe.^Môþ'Vßÿ_`À¢‘XdFÃyâz*ê¶a ?ãZ¤øÏݶð¤vºTF×§]OZKWCèEŠÿŒÐýg—OåÇ¥õY÷¼HâŸYŠÿKÆ€¯µžåwýKtý¿‰xŒY2Hø%tEXtdate:create2018-10-06T17:06:46+00:00ÿ4‡Ä%tEXtdate:modify2018-10-06T17:06:46+00:00Ži?xIEND®B`‚././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1700321430.0 aiohttp-jinja2-1.6/docs/aiohttp-icon.ico0000644000175100001770000000627600000000000021046 0ustar00runnerdocker00000000000000 ¨ ( @ÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþúúúõõõòòòòòòõõõúúúþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿëëëÙÙÙáááÿÿÿûûûúúú÷÷÷íííæææéééîîîõôóðî팋‹tttŒ‹‹æææ¤¤¤‘‘‘ŸŸŸÆÆÆõõõÎÎÎØØØþþþÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþ¯¯¯lll   ÿÿÿµµµhhhhhh———ýýý‘˜œ`r|µÎqÀíOtˆPakl…”Òçñ‹‹‹kkklll®®®ÜÜÜlllƒƒƒûûûÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþ´´´lll···úúú¿¿¿kjjlmnp†–[´ñT9]t9“ÓlÁø:s—?]q8ªI³÷Rt‹ZdltuvÀÀ¿ÊÊÊkkkÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿýýý¬¬¬lll¥¥¥ÂÂÂÁÁÁRbl5Xmf4©ñ6¬öH…¬Kj~ˆªÂÜçðbq|NgyOlƒBžâG¥è4]vJ€¢6­ùÜîùðððþþþÿÿÿÿÿÿïïïþþýU“¹]ho«««ÊÊÊa”»?c}IeyV…¨\“¼‹‹‹z}€I£ÜlÂøG‚¨?e~7|±V™ÌEd{PizCf€S‘¿eš¿:^vL{˜H·ûj¾óÿÿþòòòÿÿÿÿÿÿííííõú4hŠA^pqrslqtGbvJdwXkzWkznuz}}}€€€b˜¼9§ì@dzGi€Bd}Ni}Oj~Qj|OhzDcxAavFbtTs†e¾ö=®÷ìõüðððÿÿÿüüüòòòÅÞï5p4Yq3rœW˜Æ/ŒÉ>o‘Jf{Wºi«Ý”–z†; î3™Û®üC¯ûC¯ûO²ý’Ðÿl¾þTµýM³ûa´ïa–[rpªÒc¹÷sÂûC®ûl¾ÿl¾þb¹þG®ôÿÿÿôôôñññÿÿÿQ¯ôS±ûc°ë\žWƒ¤=€«9l•?`z2p™H’ÊD–ÑAšÖKœÜ[©çˆÂïR«ðd¹óœÇ扔›z‚ÁÔÜÇßòƒÇõZµúZ¶ül¾ÿS±ûQ¯ôÿÿÿõõõõõõÿÿþf·óG­úE—Õckqnru=]vA_xBayDc{He|If~HgIg~Ig~Gf}Vl}cq{x|`ayPQyUV„Š—}œ\‡©C‰¾NªïH®ûg¶ôÿÿþ÷÷÷ûûûúùø€Åô-¨ü= ã]˜Ág¡Ê5Á@azGcyIcw7k–>sž@mŽ?d}EgDf}KfyjrxffyNNyMMxLLwMMuquvRer9c€=Ÿà-¨ü€ÅôûúùüüüÿÿÿôôôÇáö4ªüD±ûc¾ü0¢ûo¼ü:‰ÉIbwR€¥M­ýO¯ûJŒÀBd|Ff|Dk‡j³ç¿Õåjl«JJuLLwII{II£–š¡cxˆ‹Â=lŽCc|>b{\sHau<\u>^w@^wA_wB`xB_xA^wVgv^ktgounstjpsbjpNao[r:[r;[q:Yp6Vp6TnAYmU`jlllkkkŽŽŽ¾¾¾ðððÿÿÿììì²²²áááóóóÿÿÿ˜Ìó;ªú=¦ü.¢ü*¢û?¨üªØûÿÿÿüüü–Ê÷c®íH˜Ü<‘Í;†¾2t«/g‘3Zy8Vn3TlO^illljjjllllllwwwÉÉÉÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿõõõÿÿÿºÝõ5›õ9¡üVµüt¾ýƒÅûÿÿÿôùÿŠÇýU®ýO«ûF¬ü9¡ü7žû,¡üK«ýG›ßŽ¥¶ˆˆˆjjjlllllllllûûûÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿøøøûûûøúüŸÌôD¤ø8 ü<¡û6¤û-¡û4¥ûdºüT³ü0 ûH¨ûH©üK§øy¹óòøüüüûøøøííí¸¸¸€€€lllŒŒŒñññÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿüüü÷÷÷ÿÿþïõû•Çô]¬óE¤õ#ú7¦û6¦û,¡ú^®ök³ó ÍôîõûÿÿþøøøüüüÿÿÿÿÿÿÿÿÿûûûÕÕÕ¤¤¤ÆÆÆÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿúúúøøøûûúÿÿÿþþþâïúÓèøÔèøáïúüýþÿÿÿûúúøøøûûûÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿþþþúúúùùùùùùùùùùùùùùùùùùúúúÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿÿðÿâÂÀÀÀÀÀÀ€€€€€€€€€€øüþpÿ€ÿÿàÿ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1700321430.0 aiohttp-jinja2-1.6/docs/api.rst0000644000175100001770000001526400000000000017254 0ustar00runnerdocker00000000000000API === Describes the module API with detailed explanations of functions parameters. .. module:: aiohttp_jinja2 .. highlight:: python APP_KEY ------- .. data:: APP_KEY The key name in :class:`aiohttp.web.Application` dictionary, ``'aiohttp_jinja2_environment'`` for storing :term:`jinja2` environment object (:class:`jinja2.Environment`). Usually you don't need to operate with *application* manually, left it to :mod:`aiohttp_jinja2` functions. setup ----- .. function:: setup(app, *args, app_key=APP_KEY, context_processors=(), \ autoescape=True, \ filters=None, default_helpers=True, **kwargs) Function responsible for initializing templating system on application. It must be called before freezing or running the application in order to use *aiohttp-jinja*. :param app: :class:`aiohttp.web.Application` instance to initialize template system on. :param str app_key: optional key that will be used to access templating environment from application dictionary object. Defaults to `aiohttp_jinja2_environment`. :param context_processors: list of :ref:`aiohttp-web-middlewares`. These are context processors used to rewrite or inject some variables during the processing of a request. :type context_processors: :class:`list` :param autoescape: the argument is passed to :class:`jinja2.Environemnt`, see `Autoescaping` for more details. :param filters: extra jinja filters (`link to docs `). :type filters: :class:`list` :param bool default_helpers: whether to use default global helper in templates provided by package :mod:`aiohttp_jinja2.helpers` or not. :param ``*args``: positional arguments passed into environment constructor. :param ``**kwargs``: any arbitrary keyword arguments you want to pass to :class:`jinja2.Environment` environment. Simple initialization:: import jinja2 import aiohttp_jinja2 from aiohttp import web app = web.Application() aiohttp_jinja2.setup( app, loader=jinja2.FileSystemLoader('/path/to/templates/folder'), ) @template -------- .. decorator:: template(template_name, *, app_key=APP_KEY, \ encoding='utf-8', status=200) Behaves as a decorator around view functions accepting template name that should be used to render the response. Supports both synchronous and asynchronous functions. :param str template_name: name of the template file that will be looked up by the loader. Raises a 500 error in case template was not found. :param str app_key: optional key that will be used to access templating environment from application dictionary object. Defaults to `aiohttp_jinja2_environment`. :param str encoding: encoding that will be set as a charset property on the response for rendered template, default to utf-8. :params int status: http status code that will be set on resulting response. Simple usage example:: @jinja2.template('tmpl.jinja2') async def handler(request): context = {'foo': 'bar'} return context app.router.add_get('/tmpl', handler) render_string ------------- .. function:: render_string(template_name, request, context, *, \ app_key=APP_KEY) Renders template specified and returns resulting string. :param str template_name: Name of the template you want to render. Usually it's a filename without extension on your filesystem. :param request: aiohttp request associated with an application where aiohttp-jinja rendering is configured. :type request: :class:`aiohttp.web.Request` :param dict context: dictionary used as context when rendering the template. :param str app_key: optional key that will be used to access templating environment from application dictionary object. Defaults to `aiohttp_jinja2_environment`. render_string_async ------------------- .. function:: render_string_async(template_name, request, context, *, \ app_key=APP_KEY) :async: Async version of ``render_string()``. Replaces ``render_string()`` when ``enable_async=True`` is passed to the ``setup()`` call. See ``render_string()`` for parameter usage. render_template --------------- .. function:: render_template(template_name, request, context, *, \ app_key=APP_KEY, encoding='utf-8', status=200) :param str template_name: Name of the template you want to render. :param request: aiohttp request associated with an application where aiohttp-jinja rendering is configured. :type request: :class:`aiohttp.web.Request` :param dict context: dictionary used as context when rendering the template. :param str app_key: optional key that will be used to access templating environment from application dictionary object. Defaults to `aiohttp_jinja2_environment`. :param int status: http status code that will be set on resulting response. Assuming the initialization from the example above has been done:: async def handler(request): context = {'foo': 'bar'} response = aiohttp_jinja2.render_template('tmpl.jinja2', request, context) return response app.router.add_get('/tmpl', handler) render_template_async --------------------- .. function:: render_template_async( \ template_name, request, context, *, \ app_key=APP_KEY, encoding='utf-8', status=200) :async: Async version of ``render_template()``. Replaces ``render_template()`` when ``enable_async=True`` is passed to the ``setup()`` call. See ``render_template()`` for parameter usage. .. function:: get_env(app, *, app_key=APP_KEY) Get aiohttp-jinja2 environment from an application instance by key. :param app: :class:`aiohttp.web.Application` instance to get variables from. :param str app_key: optional key that will be used to access templating environment from application dictionary object. Defaults to `aiohttp_jinja2_environment`. ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1700321430.0 aiohttp-jinja2-1.6/docs/conf.py0000644000175100001770000002345200000000000017246 0ustar00runnerdocker00000000000000# # aiohttp_jinja2 documentation build configuration file, created by # sphinx-quickstart on Sun Mar 22 12:04:15 2015. # # This file is execfile()d with the current directory set to its # containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configuration values have a default; values that are commented out # serve to show the default. import os import re import sys def _get_version_info(): PATH_TO_INIT_PY = os.path.join( os.path.dirname(__file__), "..", "aiohttp_jinja2", "__init__.py" ) with open(PATH_TO_INIT_PY, encoding="latin1") as fp: try: version = re.search( r'^__version__ = "' r"(?P\d+)" r"\.(?P\d+)" r"(\.(?P\d+)" r'(?P.*)?)?"$', fp.read(), re.M, ) return version.groupdict() except IndexError: raise RuntimeError("Unable to determine version.") _version_info = _get_version_info() # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. sys.path.insert(0, os.path.abspath("..")) import alabaster # -- General configuration ------------------------------------------------ # If your documentation needs a minimal Sphinx version, state it here. # needs_sphinx = '1.3' # Add any Sphinx extension module names here, as strings. They can be # extensions coming with Sphinx (named 'sphinx.ext.*') or your custom # ones. extensions = [ "sphinx.ext.intersphinx", "sphinx.ext.viewcode", "alabaster", ] # Add any paths that contain templates here, relative to this directory. templates_path = ["_templates"] # The suffix of source filenames. source_suffix = ".rst" # The encoding of source files. # source_encoding = 'utf-8-sig' # The master toctree document. master_doc = "index" # General information about the project. project = "aiohttp_jinja2" copyright = "2015-2021 Andrew Svetlov and aio-libs team" # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The short X.Y version. version = "{major}.{minor}".format(**_version_info) # The full version, including alpha/beta/rc tags. release = "{major}.{minor}.{patch}-{tag}".format(**_version_info) # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. # language = None # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: # today = '' # Else, today_fmt is used as the format for a strftime call. # today_fmt = '%B %d, %Y' # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. exclude_patterns = ["_build"] # The reST default role (used for this markup: `text`) to use for all # documents. # default_role = None # If true, '()' will be appended to :func: etc. cross-reference text. # add_function_parentheses = True # If true, the current module name will be prepended to all description # unit titles (such as .. function::). # add_module_names = True # If true, sectionauthor and moduleauthor directives will be shown in the # output. They are ignored by default. # show_authors = False # The name of the Pygments (syntax highlighting) style to use. pygments_style = "sphinx" # A list of ignored prefixes for module index sorting. # modindex_common_prefix = [] # If true, keep warnings as "system message" paragraphs in the built documents. # keep_warnings = False # -- Options for HTML output ---------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. html_theme = "alabaster" # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. html_theme_options = { "logo": "aiohttp-icon-128x128.png", "description": "jinja2 template renderer for aiohttp.web", "github_user": "aio-libs", "github_repo": "aiohttp_jinja2", "github_button": True, "github_banner": True, "travis_button": "aio-libs/aiohttp-jinja2", "pre_bg": "#FFF6E5", "note_bg": "#E5ECD1", "note_border": "#BFCF8C", "body_text": "#482C0A", "sidebar_text": "#49443E", "sidebar_header": "#4B4032", } # Add any paths that contain custom themes here, relative to this directory. html_theme_path = [alabaster.get_path()] # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". # html_title = None # A shorter title for the navigation bar. Default is the same as html_title. # html_short_title = None # The name of an image file (relative to this directory) to place at the top # of the sidebar. # html_logo = None # The name of an image file (within the static path) to use as favicon of the # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 # pixels large. html_favicon = "aiohttp-icon.ico" # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ["_static"] # Add any extra paths that contain custom files (such as robots.txt or # .htaccess) here, relative to this directory. These files are copied # directly to the root of the documentation. # html_extra_path = [] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. # html_last_updated_fmt = '%b %d, %Y' # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. # html_use_smartypants = True # Custom sidebar templates, maps document names to template names. html_sidebars = { "**": [ "about.html", "navigation.html", "searchbox.html", ] } # Additional templates that should be rendered to pages, maps page names to # template names. # html_additional_pages = {} # If false, no module index is generated. # html_domain_indices = True # If false, no index is generated. # html_use_index = True # If true, the index is split into individual pages for each letter. # html_split_index = False # If true, links to the reST sources are added to the pages. # html_show_sourcelink = True # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. # html_show_sphinx = True # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. # html_show_copyright = True # If true, an OpenSearch description file will be output, and all pages will # contain a tag referring to it. The value of this option must be the # base URL from which the finished HTML is served. # html_use_opensearch = '' # This is the file name suffix for HTML files (e.g. ".xhtml"). # html_file_suffix = None # Output file base name for HTML help builder. htmlhelp_basename = "aiohttp_jinja2doc" # -- Options for LaTeX output --------------------------------------------- # The paper size ('letterpaper' or 'a4paper'). # 'papersize': 'letterpaper', # The font size ('10pt', '11pt' or '12pt'). # 'pointsize': '10pt', # Additional stuff for the LaTeX preamble. # 'preamble': '', latex_elements = {} # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, # author, documentclass [howto, manual, or own class]). latex_documents = [ ( "index", "aiohttp_jinja2.tex", "aiohttp\\_jinja2 Documentation", "Andrew Svetlov", "manual", ), ] # The name of an image file (relative to this directory) to place at the top of # the title page. # latex_logo = None # For "manual" documents, if this is true, then toplevel headings are parts, # not chapters. # latex_use_parts = False # If true, show page references after internal links. # latex_show_pagerefs = False # If true, show URL addresses after external links. # latex_show_urls = False # Documents to append as an appendix to all manuals. # latex_appendices = [] # If false, no module index is generated. # latex_domain_indices = True # -- Options for manual page output --------------------------------------- # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ ("index", "aiohttp_jinja2", "aiohttp_jinja2 Documentation", ["Andrew Svetlov"], 1) ] # If true, show URL addresses after external links. # man_show_urls = False # -- Options for Texinfo output ------------------------------------------- # Grouping the document tree into Texinfo files. List of tuples # (source start file, target name, title, author, # dir menu entry, description, category) texinfo_documents = [ ( "index", "aiohttp_jinja2", "aiohttp_jinja2 Documentation", "Andrew Svetlov", "aiohttp_jinja2", "One line description of project.", "Miscellaneous", ), ] # Documents to append as an appendix to all manuals. # texinfo_appendices = [] # If false, no module index is generated. # texinfo_domain_indices = True # How to display URL addresses: 'footnote', 'no', or 'inline'. # texinfo_show_urls = 'footnote' # If true, do not generate a @detailmenu in the "Top" node's menu. # texinfo_no_detailmenu = False # Example configuration for intersphinx: refer to the Python standard library. intersphinx_mapping = { "http://docs.python.org/3": None, "https://aiohttp.readthedocs.io/en/stable": None, "https://jinja.palletsprojects.com/en/latest": None, } ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1700321430.0 aiohttp-jinja2-1.6/docs/index.rst0000644000175100001770000001720700000000000017611 0ustar00runnerdocker00000000000000.. aiohttp_jinja2 documentation master file, created by sphinx-quickstart on Sun Mar 22 12:04:15 2015. You can adapt this file completely to your liking, but it should at least contain the root `toctree` directive. aiohttp_jinja2 ============== .. currentmodule:: aiohttp_jinja2 .. highlight:: python :term:`jinja2` template renderer for :ref:`aiohttp.web`. Usage ----- Before template rendering you have to setup *jinja2 environment* (:class:`jinja2.Environment`) first:: app = web.Application() aiohttp_jinja2.setup(app, loader=jinja2.FileSystemLoader('/path/to/templates/folder')) After that you may use template engine in your :term:`web-handlers`. The most convenient way is to decorate a :term:`web-handler`. Using the function based web handlers:: @aiohttp_jinja2.template('tmpl.jinja2') def handler(request): return {'name': 'Andrew', 'surname': 'Svetlov'} Or the class-based views (:class:`aiohttp.web.View`):: class Handler(web.View): @aiohttp_jinja2.template('tmpl.jinja2') async def get(self): return {'name': 'Andrew', 'surname': 'Svetlov'} On handler call the :func:`template` decorator will pass returned dictionary ``{'name': 'Andrew', 'surname': 'Svetlov'}`` into template named ``"tmpl.jinja2"`` for getting resulting HTML text. More complex template processing can be achieved by modifying the existing `list of global functions `_. Modification of Jinja2's environment can be done via :func:`get_env`. For example, adding the ``zip`` function:: env = aiohttp_jinja2.get_env(app) env.globals.update(zip=zip) Which can now to be used in any template:: {% for value, square in zip(values, squares) %}

The square of {{ value }} is {{ square }}.

{% endfor %} In some cases, finer control over the dataflow may also be required. This can be worked out by explicitly asking for template to be rendered using :func:`render_template`. Explicit rendering will allow to possibly pass some context to the renderer and also to modify its response on the fly. This can for example be used to set response headers:: async def handler(request): context = {'name': 'Andrew', 'surname': 'Svetlov'} response = aiohttp_jinja2.render_template('tmpl.jinja2', request, context) response.headers['Content-Language'] = 'ru' return response This, again, can also be done with a class-based view (:class:`aiohttp.web.View`):: class Handler(web.View): async def get(self): context = {'name': 'Andrew', 'surname': 'Svetlov'} response = aiohttp_jinja2.render_template('tmpl.jinja2', self.request, context) response.headers['Content-Language'] = 'ru' return response Context processors is a way to add some variables to each template context. It works like :attr:`jinja2.Environment().globals`, but calculate variables each request. So if you need to add global constants it will be better to use :attr:`jinja2.Environment().globals` directly. But if you variables depends of request (e.g. current user) you have to use context processors. Context processors is following last-win strategy. Therefore a context processor could rewrite variables delivered with previous one. In order to use context processors create required processors:: async def foo_processor(request): return {'foo': 'bar'} And pass them into :func:`setup`:: aiohttp_jinja2.setup( app, context_processors=[foo_processor, aiohttp_jinja2.request_processor], loader=loader) As you can see, there is a built-in :func:`request_processor`, which adds current :class:`aiohttp.web.Request` into context of templates under ``'request'`` name. Here is an example of how to add current user dependant logic to template (requires ``aiohttp_security`` library):: from aiohttp_security import authorized_userid async def current_user_ctx_processor(request): userid = await authorized_userid(request) is_anonymous = not bool(userid) return {'current_user': {'is_anonymous': is_anonymous}} Template::
{% if current_user.is_anonymous %} Login {% else %} Logout {% endif %}
Async functions ............... If you pass the ``enable_async`` parameter to the setup function, then you will need to use the async functions for rendering:: aiohttp_jinja2.setup( app, enable_async=True, loader=jinja2.FileSystemLoader('/path/to/templates/folder')) ... async def handler(request): return await aiohttp_jinja2.render_template_async( 'tmpl.jinja2', request) The ``@aiohttp_jinja2.template`` decorator will work for both cases. Default Globals ............... .. highlight:: html+jinja ``app`` is always made in templates via :attr:`jinja2.Environment().globals`::

Welcome to {{ app['name'] }}

Two more helpers are also enabled by default: ``url`` and ``static``. ``url`` can be used with just a view name:: Index Page Or with arguments:: User Page A query can be added to the url with the special ``query_`` keyword argument:: User Page For a view defined by ``app.router.add_get('/user-profile/{id}/', user, name='user')``, the above would give:: User Page This is useful as it would allow your static path to switch in deployment or testing with just one line. The ``static`` function has similar usage, except it requires you to set ``app[aiohttp_jinja2.static_root_key]``. .. code-block:: python app = web.Application() aiohttp_jinja2.setup(app, loader=jinja2.FileSystemLoader("/path/to/templates/folder")) app[aiohttp_jinja2.static_root_key] = "/static" Then in the template:: Would result in:: Both ``url`` and ``static`` can be disabled by passing ``default_helpers=False`` to ``aiohttp_jinja2.setup``. Library Installation -------------------- The :mod:`aiohttp_jinja2` can be installed by pip:: $ pip3 install aiohttp_jinja2 Source code ----------- The project is hosted on `GitHub `_. Please feel free to file an issue on `bug tracker `_ if you have found a bug or have some suggestion for library improvement. The library uses `Travis `_ for Continuous Integration. License ------- :mod:`aiohttp_jinja2` is offered under the Apache 2 license. Contents -------- .. toctree:: :maxdepth: 2 api Indices and tables ------------------ * :ref:`genindex` * :ref:`search` Glossary -------- .. if you add new entries, keep the alphabetical sorting! .. glossary:: jinja2 A modern and designer-friendly templating language for Python. See http://jinja.pocoo.org/ web-handler An endpoint that returns http response. ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1700321430.0 aiohttp-jinja2-1.6/docs/make.bat0000644000175100001770000001507500000000000017356 0ustar00runnerdocker00000000000000@ECHO OFF REM Command file for Sphinx documentation if "%SPHINXBUILD%" == "" ( set SPHINXBUILD=sphinx-build ) set BUILDDIR=_build set ALLSPHINXOPTS=-d %BUILDDIR%/doctrees %SPHINXOPTS% . set I18NSPHINXOPTS=%SPHINXOPTS% . if NOT "%PAPER%" == "" ( set ALLSPHINXOPTS=-D latex_paper_size=%PAPER% %ALLSPHINXOPTS% set I18NSPHINXOPTS=-D latex_paper_size=%PAPER% %I18NSPHINXOPTS% ) if "%1" == "" goto help if "%1" == "help" ( :help echo.Please use `make ^` where ^ is one of echo. html to make standalone HTML files echo. dirhtml to make HTML files named index.html in directories echo. singlehtml to make a single large HTML file echo. pickle to make pickle files echo. json to make JSON files echo. htmlhelp to make HTML files and a HTML help project echo. qthelp to make HTML files and a qthelp project echo. devhelp to make HTML files and a Devhelp project echo. epub to make an epub echo. latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter echo. text to make text files echo. man to make manual pages echo. texinfo to make Texinfo files echo. gettext to make PO message catalogs echo. changes to make an overview over all changed/added/deprecated items echo. xml to make Docutils-native XML files echo. pseudoxml to make pseudoxml-XML files for display purposes echo. linkcheck to check all external links for integrity echo. doctest to run all doctests embedded in the documentation if enabled goto end ) if "%1" == "clean" ( for /d %%i in (%BUILDDIR%\*) do rmdir /q /s %%i del /q /s %BUILDDIR%\* goto end ) %SPHINXBUILD% 2> nul if errorlevel 9009 ( echo. echo.The 'sphinx-build' command was not found. Make sure you have Sphinx echo.installed, then set the SPHINXBUILD environment variable to point echo.to the full path of the 'sphinx-build' executable. Alternatively you echo.may add the Sphinx directory to PATH. echo. echo.If you don't have Sphinx installed, grab it from echo.http://sphinx-doc.org/ exit /b 1 ) if "%1" == "html" ( %SPHINXBUILD% -b html %ALLSPHINXOPTS% %BUILDDIR%/html if errorlevel 1 exit /b 1 echo. echo.Build finished. The HTML pages are in %BUILDDIR%/html. goto end ) if "%1" == "dirhtml" ( %SPHINXBUILD% -b dirhtml %ALLSPHINXOPTS% %BUILDDIR%/dirhtml if errorlevel 1 exit /b 1 echo. echo.Build finished. The HTML pages are in %BUILDDIR%/dirhtml. goto end ) if "%1" == "singlehtml" ( %SPHINXBUILD% -b singlehtml %ALLSPHINXOPTS% %BUILDDIR%/singlehtml if errorlevel 1 exit /b 1 echo. echo.Build finished. The HTML pages are in %BUILDDIR%/singlehtml. goto end ) if "%1" == "pickle" ( %SPHINXBUILD% -b pickle %ALLSPHINXOPTS% %BUILDDIR%/pickle if errorlevel 1 exit /b 1 echo. echo.Build finished; now you can process the pickle files. goto end ) if "%1" == "json" ( %SPHINXBUILD% -b json %ALLSPHINXOPTS% %BUILDDIR%/json if errorlevel 1 exit /b 1 echo. echo.Build finished; now you can process the JSON files. goto end ) if "%1" == "htmlhelp" ( %SPHINXBUILD% -b htmlhelp %ALLSPHINXOPTS% %BUILDDIR%/htmlhelp if errorlevel 1 exit /b 1 echo. echo.Build finished; now you can run HTML Help Workshop with the ^ .hhp project file in %BUILDDIR%/htmlhelp. goto end ) if "%1" == "qthelp" ( %SPHINXBUILD% -b qthelp %ALLSPHINXOPTS% %BUILDDIR%/qthelp if errorlevel 1 exit /b 1 echo. echo.Build finished; now you can run "qcollectiongenerator" with the ^ .qhcp project file in %BUILDDIR%/qthelp, like this: echo.^> qcollectiongenerator %BUILDDIR%\qthelp\aiohttp_jinja2.qhcp echo.To view the help file: echo.^> assistant -collectionFile %BUILDDIR%\qthelp\aiohttp_jinja2.ghc goto end ) if "%1" == "devhelp" ( %SPHINXBUILD% -b devhelp %ALLSPHINXOPTS% %BUILDDIR%/devhelp if errorlevel 1 exit /b 1 echo. echo.Build finished. goto end ) if "%1" == "epub" ( %SPHINXBUILD% -b epub %ALLSPHINXOPTS% %BUILDDIR%/epub if errorlevel 1 exit /b 1 echo. echo.Build finished. The epub file is in %BUILDDIR%/epub. goto end ) if "%1" == "latex" ( %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex if errorlevel 1 exit /b 1 echo. echo.Build finished; the LaTeX files are in %BUILDDIR%/latex. goto end ) if "%1" == "latexpdf" ( %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex cd %BUILDDIR%/latex make all-pdf cd %BUILDDIR%/.. echo. echo.Build finished; the PDF files are in %BUILDDIR%/latex. goto end ) if "%1" == "latexpdfja" ( %SPHINXBUILD% -b latex %ALLSPHINXOPTS% %BUILDDIR%/latex cd %BUILDDIR%/latex make all-pdf-ja cd %BUILDDIR%/.. echo. echo.Build finished; the PDF files are in %BUILDDIR%/latex. goto end ) if "%1" == "text" ( %SPHINXBUILD% -b text %ALLSPHINXOPTS% %BUILDDIR%/text if errorlevel 1 exit /b 1 echo. echo.Build finished. The text files are in %BUILDDIR%/text. goto end ) if "%1" == "man" ( %SPHINXBUILD% -b man %ALLSPHINXOPTS% %BUILDDIR%/man if errorlevel 1 exit /b 1 echo. echo.Build finished. The manual pages are in %BUILDDIR%/man. goto end ) if "%1" == "texinfo" ( %SPHINXBUILD% -b texinfo %ALLSPHINXOPTS% %BUILDDIR%/texinfo if errorlevel 1 exit /b 1 echo. echo.Build finished. The Texinfo files are in %BUILDDIR%/texinfo. goto end ) if "%1" == "gettext" ( %SPHINXBUILD% -b gettext %I18NSPHINXOPTS% %BUILDDIR%/locale if errorlevel 1 exit /b 1 echo. echo.Build finished. The message catalogs are in %BUILDDIR%/locale. goto end ) if "%1" == "changes" ( %SPHINXBUILD% -b changes %ALLSPHINXOPTS% %BUILDDIR%/changes if errorlevel 1 exit /b 1 echo. echo.The overview file is in %BUILDDIR%/changes. goto end ) if "%1" == "linkcheck" ( %SPHINXBUILD% -b linkcheck %ALLSPHINXOPTS% %BUILDDIR%/linkcheck if errorlevel 1 exit /b 1 echo. echo.Link check complete; look for any errors in the above output ^ or in %BUILDDIR%/linkcheck/output.txt. goto end ) if "%1" == "doctest" ( %SPHINXBUILD% -b doctest %ALLSPHINXOPTS% %BUILDDIR%/doctest if errorlevel 1 exit /b 1 echo. echo.Testing of doctests in the sources finished, look at the ^ results in %BUILDDIR%/doctest/output.txt. goto end ) if "%1" == "xml" ( %SPHINXBUILD% -b xml %ALLSPHINXOPTS% %BUILDDIR%/xml if errorlevel 1 exit /b 1 echo. echo.Build finished. The XML files are in %BUILDDIR%/xml. goto end ) if "%1" == "pseudoxml" ( %SPHINXBUILD% -b pseudoxml %ALLSPHINXOPTS% %BUILDDIR%/pseudoxml if errorlevel 1 exit /b 1 echo. echo.Build finished. The pseudo-XML files are in %BUILDDIR%/pseudoxml. goto end ) :end ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1700321430.0 aiohttp-jinja2-1.6/pytest.ini0000644000175100001770000000061300000000000017042 0ustar00runnerdocker00000000000000[pytest] addopts = # show 10 slowest invocations: --durations=10 # a bit of verbosity doesn't hurt: -v # report all the things == -rxXs: -ra # show values of the local vars in errors: --showlocals # coverage reports --cov=aiohttp_jinja2/ --cov=tests/ --cov-report term asyncio_mode = auto filterwarnings = error testpaths = tests/ xfail_strict = true ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1700321430.0 aiohttp-jinja2-1.6/requirements-dev.txt0000644000175100001770000000032300000000000021047 0ustar00runnerdocker00000000000000-r requirements.txt flake8==6.1.0 flake8-bandit==4.1.1 flake8-bugbear==23.9.16 flake8-import-order==0.18.2 flake8-requirements==2.0.1 mypy==1.7.0; implementation_name=="cpython" pre-commit==3.5.0 sphinx==7.2.6 ././@PaxHeader0000000000000000000000000000003400000000000011452 xustar000000000000000028 mtime=1700321442.6250424 aiohttp-jinja2-1.6/setup.cfg0000644000175100001770000000024200000000000016630 0ustar00runnerdocker00000000000000[isort] line_length = 88 include_trailing_comma = True multi_line_output = 3 force_grid_wrap = 0 combine_as_imports = True [egg_info] tag_build = tag_date = 0 ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1700321430.0 aiohttp-jinja2-1.6/setup.py0000644000175100001770000000355500000000000016533 0ustar00runnerdocker00000000000000import codecs import re from pathlib import Path from setuptools import setup def _get_version(): PATH_TO_INIT_PY = Path(__file__).parent / "aiohttp_jinja2" / "__init__.py" with codecs.open(PATH_TO_INIT_PY, "r", "latin1") as fp: try: for line in fp.readlines(): if line: line = line.strip() version = re.findall(r'^__version__ = "([^"]+)"$', line, re.M) if version: return version[0] except IndexError: raise RuntimeError("Unable to determine version.") raise RuntimeError("Unable to find version.") version = _get_version() def read(f): return Path(__file__).with_name(f).read_text() setup( name="aiohttp-jinja2", version=version, description="jinja2 template renderer for aiohttp.web (http server for asyncio)", long_description="\n\n".join((read("README.rst"), read("CHANGES.rst"))), classifiers=[ "License :: OSI Approved :: Apache Software License", "Intended Audience :: Developers", "Programming Language :: Python", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.8", "Programming Language :: Python :: 3.9", "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", "Development Status :: 5 - Production/Stable", "Topic :: Internet :: WWW/HTTP", "Framework :: AsyncIO", "Framework :: aiohttp", ], author="Andrew Svetlov", author_email="andrew.svetlov@gmail.com", url="https://github.com/aio-libs/aiohttp_jinja2/", license="Apache 2", packages=["aiohttp_jinja2"], python_requires=">=3.8", install_requires=("aiohttp>=3.9.0", "jinja2>=3.0.0"), include_package_data=True, ) ././@PaxHeader0000000000000000000000000000003400000000000011452 xustar000000000000000028 mtime=1700321442.6250424 aiohttp-jinja2-1.6/tests/0000755000175100001770000000000000000000000016153 5ustar00runnerdocker00000000000000././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1700321430.0 aiohttp-jinja2-1.6/tests/__init__.py0000644000175100001770000000000000000000000020252 0ustar00runnerdocker00000000000000././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1700321430.0 aiohttp-jinja2-1.6/tests/conftest.py0000644000175100001770000000000000000000000020340 0ustar00runnerdocker00000000000000././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1700321430.0 aiohttp-jinja2-1.6/tests/test_context_processors.py0000644000175100001770000001024500000000000023534 0ustar00runnerdocker00000000000000from typing import Dict, Tuple, Union import jinja2 from aiohttp import web import aiohttp_jinja2 async def test_context_processors(aiohttp_client): @aiohttp_jinja2.template("tmpl.jinja2") async def func(request): return {"bar": 2} app = web.Application(middlewares=[aiohttp_jinja2.context_processors_middleware]) aiohttp_jinja2.setup( app, loader=jinja2.DictLoader( {"tmpl.jinja2": "foo: {{ foo }}, bar: {{ bar }}, path: {{ request.path }}"} ), ) async def processor(request: web.Request) -> Dict[str, Union[str, int]]: return {"foo": 1, "bar": "should be overwriten"} f: Tuple[aiohttp_jinja2._ContextProcessor, ...] = ( aiohttp_jinja2.request_processor, processor, ) app[aiohttp_jinja2.APP_CONTEXT_PROCESSORS_KEY] = f app.router.add_get("/", func) client = await aiohttp_client(app) resp = await client.get("/") assert 200 == resp.status txt = await resp.text() assert "foo: 1, bar: 2, path: /" == txt async def test_nested_context_processors(aiohttp_client): @aiohttp_jinja2.template("tmpl.jinja2") async def func(request): return {"bar": 2} subapp = web.Application(middlewares=[aiohttp_jinja2.context_processors_middleware]) aiohttp_jinja2.setup( subapp, loader=jinja2.DictLoader( { "tmpl.jinja2": "foo: {{ foo }}, bar: {{ bar }}, " "baz: {{ baz }}, path: {{ request.path }}" } ), ) async def subprocessor(request): return {"foo": 1, "bar": "should be overwriten"} subapp[aiohttp_jinja2.APP_CONTEXT_PROCESSORS_KEY] = ( aiohttp_jinja2.request_processor, subprocessor, ) subapp.router.add_get("/", func) app = web.Application(middlewares=[aiohttp_jinja2.context_processors_middleware]) aiohttp_jinja2.setup(app, loader=jinja2.DictLoader({})) async def processor(request): return {"baz": 5} app[aiohttp_jinja2.APP_CONTEXT_PROCESSORS_KEY] = ( aiohttp_jinja2.request_processor, processor, ) app.add_subapp("/sub/", subapp) client = await aiohttp_client(app) resp = await client.get("/sub/") assert 200 == resp.status txt = await resp.text() assert "foo: 1, bar: 2, baz: 5, path: /sub/" == txt async def test_context_is_response(aiohttp_client): @aiohttp_jinja2.template("tmpl.jinja2") async def func(request): raise web.HTTPForbidden() app = web.Application() aiohttp_jinja2.setup(app, loader=jinja2.DictLoader({"tmpl.jinja2": "template"})) app.router.add_route("GET", "/", func) client = await aiohttp_client(app) resp = await client.get("/") assert 403 == resp.status async def test_context_processors_new_setup_style(aiohttp_client): @aiohttp_jinja2.template("tmpl.jinja2") async def func(request): return {"bar": 2} async def processor(request): return {"foo": 1, "bar": "should be overwriten"} app = web.Application() aiohttp_jinja2.setup( app, loader=jinja2.DictLoader( { "tmpl.jinja2": "foo: {{ foo }}, bar: {{ bar }}, " "path: {{ request.path }}" } ), context_processors=(aiohttp_jinja2.request_processor, processor), ) app.router.add_route("GET", "/", func) client = await aiohttp_client(app) resp = await client.get("/") assert 200 == resp.status txt = await resp.text() assert "foo: 1, bar: 2, path: /" == txt async def test_context_not_tainted(aiohttp_client): global_context = {"version": 1} @aiohttp_jinja2.template("tmpl.jinja2") async def func(request): return global_context async def processor(request): return {"foo": 1} app = web.Application() aiohttp_jinja2.setup( app, loader=jinja2.DictLoader({"tmpl.jinja2": "foo: {{ foo }}"}), context_processors=[processor], ) app.router.add_get("/", func) client = await aiohttp_client(app) resp = await client.get("/") assert 200 == resp.status txt = await resp.text() assert "foo: 1" == txt assert "foo" not in global_context ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1700321430.0 aiohttp-jinja2-1.6/tests/test_jinja_filters.py0000644000175100001770000000115700000000000022413 0ustar00runnerdocker00000000000000import jinja2 from aiohttp import web import aiohttp_jinja2 async def test_jinja_filters(aiohttp_client): @aiohttp_jinja2.template("tmpl.jinja2") async def index(request): return {} def add_2(value): return value + 2 app = web.Application() aiohttp_jinja2.setup( app, loader=jinja2.DictLoader({"tmpl.jinja2": "{{ 5|add_2 }}"}), filters={"add_2": add_2}, ) app.router.add_route("GET", "/", index) client = await aiohttp_client(app) resp = await client.get("/") assert 200 == resp.status txt = await resp.text() assert "7" == txt ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1700321430.0 aiohttp-jinja2-1.6/tests/test_jinja_globals.py0000644000175100001770000001107200000000000022363 0ustar00runnerdocker00000000000000import jinja2 import pytest from aiohttp import web import aiohttp_jinja2 def test_get_env(): app = web.Application() aiohttp_jinja2.setup(app, loader=jinja2.DictLoader({"tmpl.jinja2": "tmpl"})) env = aiohttp_jinja2.get_env(app) assert isinstance(env, jinja2.Environment) assert env is aiohttp_jinja2.get_env(app) async def test_url(aiohttp_client): @aiohttp_jinja2.template("tmpl.jinja2") async def index(request): return {} async def other(request): """Dummy handler.""" app = web.Application() aiohttp_jinja2.setup( app, loader=jinja2.DictLoader({"tmpl.jinja2": "{{ url('other', name='John_Doe')}}"}), ) app.router.add_route("GET", "/", index) app.router.add_route("GET", "/user/{name}", other, name="other") client = await aiohttp_client(app) resp = await client.get("/") assert 200 == resp.status txt = await resp.text() assert "/user/John_Doe" == txt async def test_url_with_query(aiohttp_client): @aiohttp_jinja2.template("tmpl.jinja2") async def index(request): return {} app = web.Application() aiohttp_jinja2.setup( app, loader=jinja2.DictLoader( {"tmpl.jinja2": "{{ url('index', query_={'foo': 'bar'})}}"} ), ) app.router.add_get("/", index, name="index") client = await aiohttp_client(app) resp = await client.get("/") assert 200 == resp.status txt = await resp.text() assert "/?foo=bar" == txt async def test_url_int_param(aiohttp_client): @aiohttp_jinja2.template("tmpl.jinja2") async def index(request): return {} async def other(request): """Dummy handler.""" app = web.Application() aiohttp_jinja2.setup( app, loader=jinja2.DictLoader({"tmpl.jinja2": "{{ url('other', arg=1)}}"}) ) app.router.add_route("GET", "/", index) app.router.add_route("GET", "/uid/{arg}", other, name="other") client = await aiohttp_client(app) resp = await client.get("/") assert 200 == resp.status txt = await resp.text() assert "/uid/1" == txt async def test_url_param_forbidden_type(aiohttp_client): async def index(request): with pytest.raises( TypeError, match=( r"argument value should be str or int, " r"got arg -> \[\] True" ), ): aiohttp_jinja2.render_template("tmpl.jinja2", request, {}) return web.Response() async def other(request): """Dummy handler.""" app = web.Application() aiohttp_jinja2.setup( app, loader=jinja2.DictLoader({"tmpl.jinja2": "{{ url('other', arg=True)}}"}) ) app.router.add_route("GET", "/", index) app.router.add_route("GET", "/uid/{arg}", other, name="other") client = await aiohttp_client(app) resp = await client.get("/") assert 200 == resp.status async def test_helpers_disabled(aiohttp_client): async def index(request): with pytest.raises(jinja2.UndefinedError, match="'url' is undefined"): aiohttp_jinja2.render_template("tmpl.jinja2", request, {}) return web.Response() app = web.Application() aiohttp_jinja2.setup( app, default_helpers=False, loader=jinja2.DictLoader({"tmpl.jinja2": "{{ url('index')}}"}), ) app.router.add_route("GET", "/", index) client = await aiohttp_client(app) resp = await client.get("/") assert 200 == resp.status async def test_static(aiohttp_client): @aiohttp_jinja2.template("tmpl.jinja2") async def index(request): return {} app = web.Application() aiohttp_jinja2.setup( app, loader=jinja2.DictLoader({"tmpl.jinja2": "{{ static('whatever.js') }}"}) ) app[aiohttp_jinja2.static_root_key] = "/static" app.router.add_route("GET", "/", index) client = await aiohttp_client(app) resp = await client.get("/") assert 200 == resp.status txt = await resp.text() assert "/static/whatever.js" == txt async def test_static_var_missing(aiohttp_client, caplog): async def index(request): with pytest.raises(RuntimeError, match="static_root_key"): aiohttp_jinja2.render_template("tmpl.jinja2", request, {}) return web.Response() app = web.Application() aiohttp_jinja2.setup( app, loader=jinja2.DictLoader({"tmpl.jinja2": "{{ static('whatever.js') }}"}) ) app.router.add_route("GET", "/", index) client = await aiohttp_client(app) resp = await client.get("/") assert 200 == resp.status # static_root_key is not set ././@PaxHeader0000000000000000000000000000002600000000000011453 xustar000000000000000022 mtime=1700321430.0 aiohttp-jinja2-1.6/tests/test_simple_renderer.py0000644000175100001770000002140500000000000022745 0ustar00runnerdocker00000000000000from typing import Dict import jinja2 import pytest from aiohttp import web from aiohttp.test_utils import make_mocked_request import aiohttp_jinja2 @pytest.mark.parametrize("enable_async", (False, True)) async def test_func(aiohttp_client, enable_async): @aiohttp_jinja2.template("tmpl.jinja2") async def func(request: web.Request) -> Dict[str, str]: return {"head": "HEAD", "text": "text"} template = "

{{head}}

{{text}}" app = web.Application() aiohttp_jinja2.setup( app, enable_async=enable_async, loader=jinja2.DictLoader({"tmpl.jinja2": template}), ) app.router.add_route("*", "/", func) client = await aiohttp_client(app) resp = await client.get("/") assert 200 == resp.status txt = await resp.text() assert "

HEAD

text" == txt async def test_render_class_based_view(aiohttp_client): class MyView(web.View): @aiohttp_jinja2.template("tmpl.jinja2") async def get(self) -> Dict[str, str]: return {"head": "HEAD", "text": "text"} template = "

{{head}}

{{text}}" app = web.Application() aiohttp_jinja2.setup(app, loader=jinja2.DictLoader({"tmpl.jinja2": template})) app.router.add_route("*", "/", MyView) client = await aiohttp_client(app) resp = await client.get("/") assert 200 == resp.status txt = await resp.text() assert "

HEAD

text" == txt async def test_meth(aiohttp_client): class Handler: @aiohttp_jinja2.template("tmpl.jinja2") async def meth(self, request): return {"head": "HEAD", "text": "text"} template = "

{{head}}

{{text}}" handler = Handler() app = web.Application() aiohttp_jinja2.setup(app, loader=jinja2.DictLoader({"tmpl.jinja2": template})) app.router.add_route("*", "/", handler.meth) client = await aiohttp_client(app) resp = await client.get("/") assert 200 == resp.status txt = await resp.text() assert "

HEAD

text" == txt async def test_convert_func_to_coroutine(aiohttp_client): @aiohttp_jinja2.template("tmpl.jinja2") async def func(request): return {"head": "HEAD", "text": "text"} template = "

{{head}}

{{text}}" app = web.Application() aiohttp_jinja2.setup(app, loader=jinja2.DictLoader({"tmpl.jinja2": template})) app.router.add_route("*", "/", func) client = await aiohttp_client(app) resp = await client.get("/") txt = await resp.text() assert "

HEAD

text" == txt async def test_render_not_initialized(): async def func(request: web.Request) -> web.Response: return aiohttp_jinja2.render_template("template", request, {}) app = web.Application() app.router.add_route("GET", "/", func) req = make_mocked_request("GET", "/", app=app) msg = "Template engine is not initialized, call aiohttp_jinja2.setup() first" with pytest.raises(web.HTTPInternalServerError) as ctx: await func(req) assert msg == ctx.value.text async def test_set_status(aiohttp_client): @aiohttp_jinja2.template("tmpl.jinja2", status=201) async def func(request): return {"head": "HEAD", "text": "text"} template = "

{{head}}

{{text}}" app = web.Application() aiohttp_jinja2.setup(app, loader=jinja2.DictLoader({"tmpl.jinja2": template})) app.router.add_route("*", "/", func) client = await aiohttp_client(app) resp = await client.get("/") assert 201 == resp.status txt = await resp.text() assert "

HEAD

text" == txt async def _test_render_template(func, aiohttp_client, enable_async): template = "

{{head}}

{{text}}" app = web.Application() aiohttp_jinja2.setup( app, enable_async=enable_async, loader=jinja2.DictLoader({"tmpl.jinja2": template}), ) app.router.add_route("*", "/", func) client = await aiohttp_client(app) resp = await client.get("/") assert 200 == resp.status txt = await resp.text() assert "

HEAD

text" == txt async def test_render_template(aiohttp_client): async def func(request): return aiohttp_jinja2.render_template( "tmpl.jinja2", request, {"head": "HEAD", "text": "text"} ) await _test_render_template(func, aiohttp_client, enable_async=False) async def test_render_template_async(aiohttp_client): async def func(request): return await aiohttp_jinja2.render_template_async( "tmpl.jinja2", request, {"head": "HEAD", "text": "text"} ) await _test_render_template(func, aiohttp_client, enable_async=True) async def test_render_template_custom_status(aiohttp_client): async def func(request): return aiohttp_jinja2.render_template( "tmpl.jinja2", request, {"head": "HEAD", "text": "text"}, status=404 ) template = "

{{head}}

{{text}}" app = web.Application() aiohttp_jinja2.setup(app, loader=jinja2.DictLoader({"tmpl.jinja2": template})) app.router.add_route("*", "/", func) client = await aiohttp_client(app) resp = await client.get("/") assert 404 == resp.status txt = await resp.text() assert "

HEAD

text" == txt async def test_template_not_found(): async def func(request: web.Request) -> web.Response: return aiohttp_jinja2.render_template("template", request, {}) app = web.Application() aiohttp_jinja2.setup(app, loader=jinja2.DictLoader({})) app.router.add_route("GET", "/", func) req = make_mocked_request("GET", "/", app=app) with pytest.raises(web.HTTPInternalServerError) as ctx: await func(req) t = "Template 'template' not found" assert t == ctx.value.text assert t == ctx.value.reason async def test_render_not_mapping(): @aiohttp_jinja2.template("tmpl.jinja2") # type: ignore[arg-type] async def func(request: web.Request) -> int: return 123 app = web.Application() aiohttp_jinja2.setup(app, loader=jinja2.DictLoader({"tmpl.jinja2": "tmpl"})) app.router.add_route("GET", "/", func) req = make_mocked_request("GET", "/", app=app) msg = "context should be mapping, not " with pytest.raises(web.HTTPInternalServerError) as ctx: await func(req) assert msg == ctx.value.text async def test_render_without_context(aiohttp_client): @aiohttp_jinja2.template("tmpl.jinja2") async def func(request): pass template = "

{{text}}

" app = web.Application() aiohttp_jinja2.setup(app, loader=jinja2.DictLoader({"tmpl.jinja2": template})) app.router.add_route("GET", "/", func) client = await aiohttp_client(app) resp = await client.get("/") assert 200 == resp.status txt = await resp.text() assert "

" == txt async def test_render_default_is_autoescaped(aiohttp_client): @aiohttp_jinja2.template("tmpl.jinja2") async def func(request): return {"text": ""} app = web.Application() aiohttp_jinja2.setup( app, loader=jinja2.DictLoader({"tmpl.jinja2": "{{text}}"}) ) app.router.add_route("GET", "/", func) client = await aiohttp_client(app) resp = await client.get("/") assert 200 == resp.status txt = await resp.text() assert "<script>alert(1)</script>" == txt async def test_render_can_disable_autoescape(aiohttp_client): @aiohttp_jinja2.template("tmpl.jinja2") async def func(request): return {"text": ""} app = web.Application() aiohttp_jinja2.setup( app, loader=jinja2.DictLoader({"tmpl.jinja2": "{{text}}"}), autoescape=False, ) app.router.add_route("GET", "/", func) client = await aiohttp_client(app) resp = await client.get("/") assert 200 == resp.status txt = await resp.text() assert "" == txt async def test_skip_render_for_response_from_handler(aiohttp_client): @aiohttp_jinja2.template("tmpl.jinja2") async def func(request): return web.Response(text="OK") app = web.Application() aiohttp_jinja2.setup(app, loader=jinja2.DictLoader({"tmpl.jinja2": "{{text}}"})) app.router.add_route("GET", "/", func) client = await aiohttp_client(app) resp = await client.get("/") assert 200 == resp.status txt = await resp.text() assert "OK" == txt