diff options
author | robot-contrib <robot-contrib@yandex-team.com> | 2024-05-20 09:01:58 +0300 |
---|---|---|
committer | robot-contrib <robot-contrib@yandex-team.com> | 2024-05-20 09:13:14 +0300 |
commit | 113478c6a7e201ab2d7ad78d9edbc28800283a75 (patch) | |
tree | 98b88d8dc4bfe5c664f813ead96eefb0f456e2a9 /contrib/python/Jinja2/py3/jinja2/ext.py | |
parent | 685fde8e2a4228200a88a5987a061329f7c59323 (diff) | |
download | ydb-113478c6a7e201ab2d7ad78d9edbc28800283a75.tar.gz |
Update contrib/python/Jinja2/py3 to 3.1.4
264ae85f13f4a11226be8b846079da1aece08b50
Diffstat (limited to 'contrib/python/Jinja2/py3/jinja2/ext.py')
-rw-r--r-- | contrib/python/Jinja2/py3/jinja2/ext.py | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/contrib/python/Jinja2/py3/jinja2/ext.py b/contrib/python/Jinja2/py3/jinja2/ext.py index fade1fa3bc8..8d0810cd480 100644 --- a/contrib/python/Jinja2/py3/jinja2/ext.py +++ b/contrib/python/Jinja2/py3/jinja2/ext.py @@ -1,4 +1,5 @@ """Extension API for adding custom tags and behavior.""" + import pprint import re import typing as t @@ -18,23 +19,23 @@ from .utils import pass_context if t.TYPE_CHECKING: import typing_extensions as te + from .lexer import Token from .lexer import TokenStream from .parser import Parser class _TranslationsBasic(te.Protocol): - def gettext(self, message: str) -> str: - ... + def gettext(self, message: str) -> str: ... def ngettext(self, singular: str, plural: str, n: int) -> str: pass class _TranslationsContext(_TranslationsBasic): - def pgettext(self, context: str, message: str) -> str: - ... + def pgettext(self, context: str, message: str) -> str: ... - def npgettext(self, context: str, singular: str, plural: str, n: int) -> str: - ... + def npgettext( + self, context: str, singular: str, plural: str, n: int + ) -> str: ... _SupportedTranslations = t.Union[_TranslationsBasic, _TranslationsContext] @@ -218,7 +219,7 @@ def _make_new_pgettext(func: t.Callable[[str, str], str]) -> t.Callable[..., str def _make_new_npgettext( - func: t.Callable[[str, str, str, int], str] + func: t.Callable[[str, str, str, int], str], ) -> t.Callable[..., str]: @pass_context def npgettext( @@ -294,14 +295,14 @@ class InternationalizationExtension(Extension): pgettext = translations.pgettext else: - def pgettext(c: str, s: str) -> str: + def pgettext(c: str, s: str) -> str: # type: ignore[misc] return s if hasattr(translations, "npgettext"): npgettext = translations.npgettext else: - def npgettext(c: str, s: str, p: str, n: int) -> str: + def npgettext(c: str, s: str, p: str, n: int) -> str: # type: ignore[misc] return s if n == 1 else p self._install_callables( |