Small fix in translated pages

This commit is contained in:
Alex Root Junior 2022-10-18 02:12:24 +03:00
parent 6e31f93951
commit 01028f10eb
No known key found for this signature in database
GPG key ID: 074C1D455EBEA4AC
7 changed files with 51 additions and 31 deletions

View file

@ -70,7 +70,7 @@ def ip_filter_middleware(
async def _ip_filter_middleware(request: web.Request, handler: Handler) -> Any: async def _ip_filter_middleware(request: web.Request, handler: Handler) -> Any:
ip_address, accept = check_ip(ip_filter=ip_filter, request=request) ip_address, accept = check_ip(ip_filter=ip_filter, request=request)
if not accept: if not accept:
loggers.webhook.warning(f"Blocking request from an unauthorized IP: {ip_address}") loggers.webhook.warning("Blocking request from an unauthorized IP: %s", ip_address)
raise web.HTTPUnauthorized() raise web.HTTPUnauthorized()
return await handler(request) return await handler(request)

View file

@ -59,6 +59,8 @@ For example if you need to make simple text filter:
Combining Filters Combining Filters
================= =================
.. versionadded:: 3.0b6
In general, all filters can be combined in two ways In general, all filters can be combined in two ways
@ -72,7 +74,7 @@ If you specify multiple filters in a row, it will be checked with an "and" condi
@<router>.message(Text(startswith="show"), Text(endswith="example")) @<router>.message(Text(startswith="show"), Text(endswith="example"))
Also, if you want to use two alternative ways to run the sage handler ("or" condition) Also, if you want to use two alternative ways to run the same handler ("or" condition)
you can register the handler twice or more times as you like you can register the handler twice or more times as you like
.. code-block:: python .. code-block:: python

View file

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: aiogram \n" "Project-Id-Version: aiogram \n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-10-03 01:03+0300\n" "POT-Creation-Date: 2022-10-18 01:50+0300\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -127,44 +127,52 @@ msgstr ""
msgid "For example if you need to make simple text filter:" msgid "For example if you need to make simple text filter:"
msgstr "" msgstr ""
#: ../../dispatcher/filters/index.rst:58 #: ../../dispatcher/filters/index.rst:60
msgid "Combining Filters" msgid "Combining Filters"
msgstr "" msgstr ""
#: ../../dispatcher/filters/index.rst:60 #: ../../dispatcher/filters/index.rst:62
msgid "In general, all filters can be combined in two ways" msgid "In general, all filters can be combined in two ways"
msgstr "" msgstr ""
#: ../../dispatcher/filters/index.rst:64 #: ../../dispatcher/filters/index.rst:66
msgid "Recommended way" msgid "Recommended way"
msgstr "" msgstr ""
#: ../../dispatcher/filters/index.rst:66 #: ../../dispatcher/filters/index.rst:68
msgid "" msgid ""
"If you specify multiple filters in a row, it will be checked with an " "If you specify multiple filters in a row, it will be checked with an "
"\"and\" condition:" "\"and\" condition:"
msgstr "" msgstr ""
#: ../../dispatcher/filters/index.rst:73 #: ../../dispatcher/filters/index.rst:75
msgid "" msgid ""
"Also, if you want to use two alternative ways to run the sage handler " "Also, if you want to use two alternative ways to run the same handler "
"(\"or\" condition) you can register the handler twice or more times as " "(\"or\" condition) you can register the handler twice or more times as "
"you like" "you like"
msgstr "" msgstr ""
#: ../../dispatcher/filters/index.rst:82 #: ../../dispatcher/filters/index.rst:84
msgid "" msgid ""
"Also sometimes you will need to invert the filter result, for example you" "Also sometimes you will need to invert the filter result, for example you"
" have an *IsAdmin* filter and you want to check if the user is not an " " have an *IsAdmin* filter and you want to check if the user is not an "
"admin" "admin"
msgstr "" msgstr ""
#: ../../dispatcher/filters/index.rst:91 #: ../../dispatcher/filters/index.rst:93
msgid "Another possible way" msgid "Another possible way"
msgstr "" msgstr ""
#: ../../dispatcher/filters/index.rst:93 #: ../../dispatcher/filters/index.rst:95
msgid "" msgid ""
"An alternative way is to combine using special functions (:func:`and_f`, " "An alternative way is to combine using special functions (:func:`and_f`, "
":func:`or_f`, :func:`invert_f` from :code:`aiogram.filters` module):" ":func:`or_f`, :func:`invert_f` from :code:`aiogram.filters` module):"
msgstr "" msgstr ""
#~ msgid ""
#~ "Also, if you want to use two "
#~ "alternative ways to run the sage "
#~ "handler (\"or\" condition) you can "
#~ "register the handler twice or more "
#~ "times as you like"
#~ msgstr ""

View file

@ -8,7 +8,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: aiogram \n" "Project-Id-Version: aiogram \n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2022-10-03 01:03+0300\n" "POT-Creation-Date: 2022-10-18 01:50+0300\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
@ -127,44 +127,52 @@ msgstr ""
msgid "For example if you need to make simple text filter:" msgid "For example if you need to make simple text filter:"
msgstr "" msgstr ""
#: ../../dispatcher/filters/index.rst:58 #: ../../dispatcher/filters/index.rst:60
msgid "Combining Filters" msgid "Combining Filters"
msgstr "" msgstr ""
#: ../../dispatcher/filters/index.rst:60 #: ../../dispatcher/filters/index.rst:62
msgid "In general, all filters can be combined in two ways" msgid "In general, all filters can be combined in two ways"
msgstr "" msgstr ""
#: ../../dispatcher/filters/index.rst:64 #: ../../dispatcher/filters/index.rst:66
msgid "Recommended way" msgid "Recommended way"
msgstr "" msgstr ""
#: ../../dispatcher/filters/index.rst:66 #: ../../dispatcher/filters/index.rst:68
msgid "" msgid ""
"If you specify multiple filters in a row, it will be checked with an " "If you specify multiple filters in a row, it will be checked with an "
"\"and\" condition:" "\"and\" condition:"
msgstr "" msgstr ""
#: ../../dispatcher/filters/index.rst:73 #: ../../dispatcher/filters/index.rst:75
msgid "" msgid ""
"Also, if you want to use two alternative ways to run the sage handler " "Also, if you want to use two alternative ways to run the same handler "
"(\"or\" condition) you can register the handler twice or more times as " "(\"or\" condition) you can register the handler twice or more times as "
"you like" "you like"
msgstr "" msgstr ""
#: ../../dispatcher/filters/index.rst:82 #: ../../dispatcher/filters/index.rst:84
msgid "" msgid ""
"Also sometimes you will need to invert the filter result, for example you" "Also sometimes you will need to invert the filter result, for example you"
" have an *IsAdmin* filter and you want to check if the user is not an " " have an *IsAdmin* filter and you want to check if the user is not an "
"admin" "admin"
msgstr "" msgstr ""
#: ../../dispatcher/filters/index.rst:91 #: ../../dispatcher/filters/index.rst:93
msgid "Another possible way" msgid "Another possible way"
msgstr "" msgstr ""
#: ../../dispatcher/filters/index.rst:93 #: ../../dispatcher/filters/index.rst:95
msgid "" msgid ""
"An alternative way is to combine using special functions (:func:`and_f`, " "An alternative way is to combine using special functions (:func:`and_f`, "
":func:`or_f`, :func:`invert_f` from :code:`aiogram.filters` module):" ":func:`or_f`, :func:`invert_f` from :code:`aiogram.filters` module):"
msgstr "" msgstr ""
#~ msgid ""
#~ "Also, if you want to use two "
#~ "alternative ways to run the sage "
#~ "handler (\"or\" condition) you can "
#~ "register the handler twice or more "
#~ "times as you like"
#~ msgstr ""

15
poetry.lock generated
View file

@ -341,13 +341,14 @@ testing = ["flake8 (<5)", "flufl.flake8", "importlib-resources (>=1.3)", "packag
[[package]] [[package]]
name = "incremental" name = "incremental"
version = "21.3.0" version = "22.10.0"
description = "A small library that versions your Python projects." description = "\"A small library that versions your Python projects.\""
category = "dev" category = "dev"
optional = false optional = false
python-versions = "*" python-versions = "*"
[package.extras] [package.extras]
mypy = ["click (>=6.0)", "mypy (==0.812)", "twisted (>=16.4.0)"]
scripts = ["click (>=6.0)", "twisted (>=16.4.0)"] scripts = ["click (>=6.0)", "twisted (>=16.4.0)"]
[[package]] [[package]]
@ -863,7 +864,7 @@ python-versions = ">=3.6"
[[package]] [[package]]
name = "Sphinx" name = "Sphinx"
version = "5.2.3" version = "5.3.0"
description = "Python documentation generator" description = "Python documentation generator"
category = "dev" category = "dev"
optional = false optional = false
@ -1522,8 +1523,8 @@ importlib-metadata = [
{file = "importlib_metadata-5.0.0.tar.gz", hash = "sha256:da31db32b304314d044d3c12c79bd59e307889b287ad12ff387b3500835fc2ab"}, {file = "importlib_metadata-5.0.0.tar.gz", hash = "sha256:da31db32b304314d044d3c12c79bd59e307889b287ad12ff387b3500835fc2ab"},
] ]
incremental = [ incremental = [
{file = "incremental-21.3.0-py2.py3-none-any.whl", hash = "sha256:92014aebc6a20b78a8084cdd5645eeaa7f74b8933f70fa3ada2cfbd1e3b54321"}, {file = "incremental-22.10.0-py2.py3-none-any.whl", hash = "sha256:b864a1f30885ee72c5ac2835a761b8fe8aa9c28b9395cacf27286602688d3e51"},
{file = "incremental-21.3.0.tar.gz", hash = "sha256:02f5de5aff48f6b9f665d99d48bfc7ec03b6e3943210de7cfc88856d755d6f57"}, {file = "incremental-22.10.0.tar.gz", hash = "sha256:912feeb5e0f7e0188e6f42241d2f450002e11bbc0937c65865045854c24c0bd0"},
] ]
iniconfig = [ iniconfig = [
{file = "iniconfig-1.1.1-py2.py3-none-any.whl", hash = "sha256:011e24c64b7f47f6ebd835bb12a743f2fbe9a26d4cecaa7f53bc4f35ee9da8b3"}, {file = "iniconfig-1.1.1-py2.py3-none-any.whl", hash = "sha256:011e24c64b7f47f6ebd835bb12a743f2fbe9a26d4cecaa7f53bc4f35ee9da8b3"},
@ -1885,8 +1886,8 @@ soupsieve = [
{file = "soupsieve-2.3.2.post1.tar.gz", hash = "sha256:fc53893b3da2c33de295667a0e19f078c14bf86544af307354de5fcf12a3f30d"}, {file = "soupsieve-2.3.2.post1.tar.gz", hash = "sha256:fc53893b3da2c33de295667a0e19f078c14bf86544af307354de5fcf12a3f30d"},
] ]
Sphinx = [ Sphinx = [
{file = "Sphinx-5.2.3.tar.gz", hash = "sha256:5b10cb1022dac8c035f75767799c39217a05fc0fe2d6fe5597560d38e44f0363"}, {file = "Sphinx-5.3.0.tar.gz", hash = "sha256:51026de0a9ff9fc13c05d74913ad66047e104f56a129ff73e174eb5c3ee794b5"},
{file = "sphinx-5.2.3-py3-none-any.whl", hash = "sha256:7abf6fabd7b58d0727b7317d5e2650ef68765bbe0ccb63c8795fa8683477eaa2"}, {file = "sphinx-5.3.0-py3-none-any.whl", hash = "sha256:060ca5c9f7ba57a08a1219e547b269fadf125ae25b06b9fa7f66768efb652d6d"},
] ]
sphinx-autobuild = [ sphinx-autobuild = [
{file = "sphinx-autobuild-2021.3.14.tar.gz", hash = "sha256:de1ca3b66e271d2b5b5140c35034c89e47f263f2cd5db302c9217065f7443f05"}, {file = "sphinx-autobuild-2021.3.14.tar.gz", hash = "sha256:de1ca3b66e271d2b5b5140c35034c89e47f263f2cd5db302c9217065f7443f05"},

View file

@ -19,7 +19,7 @@ furo==2022.9.29 ; python_version >= "3.8" and python_version < "4.0"
idna==3.4 ; python_version >= "3.8" and python_version < "4.0" idna==3.4 ; python_version >= "3.8" and python_version < "4.0"
imagesize==1.4.1 ; python_version >= "3.8" and python_version < "4.0" imagesize==1.4.1 ; python_version >= "3.8" and python_version < "4.0"
importlib-metadata==5.0.0 ; python_version >= "3.8" and python_version < "3.10" importlib-metadata==5.0.0 ; python_version >= "3.8" and python_version < "3.10"
incremental==21.3.0 ; python_version >= "3.8" and python_version < "4.0" incremental==22.10.0 ; python_version >= "3.8" and python_version < "4.0"
jinja2==3.1.2 ; python_version >= "3.8" and python_version < "4.0" jinja2==3.1.2 ; python_version >= "3.8" and python_version < "4.0"
livereload==2.6.3 ; python_version >= "3.8" and python_version < "4.0" livereload==2.6.3 ; python_version >= "3.8" and python_version < "4.0"
magic-filter==1.0.9 ; python_version >= "3.8" and python_version < "4.0" magic-filter==1.0.9 ; python_version >= "3.8" and python_version < "4.0"
@ -46,7 +46,7 @@ sphinx-copybutton==0.5.0 ; python_version >= "3.8" and python_version < "4.0"
sphinx-intl==2.0.1 ; python_version >= "3.8" and python_version < "4.0" sphinx-intl==2.0.1 ; python_version >= "3.8" and python_version < "4.0"
sphinx-prompt==1.5.0 ; python_version >= "3.8" and python_version < "4.0" sphinx-prompt==1.5.0 ; python_version >= "3.8" and python_version < "4.0"
sphinx-substitution-extensions==2022.2.16 ; python_version >= "3.8" and python_version < "4.0" sphinx-substitution-extensions==2022.2.16 ; python_version >= "3.8" and python_version < "4.0"
sphinx==5.2.3 ; python_version >= "3.8" and python_version < "4.0" sphinx==5.3.0 ; python_version >= "3.8" and python_version < "4.0"
sphinxcontrib-applehelp==1.0.2 ; python_version >= "3.8" and python_version < "4.0" sphinxcontrib-applehelp==1.0.2 ; python_version >= "3.8" and python_version < "4.0"
sphinxcontrib-devhelp==1.0.2 ; python_version >= "3.8" and python_version < "4.0" sphinxcontrib-devhelp==1.0.2 ; python_version >= "3.8" and python_version < "4.0"
sphinxcontrib-htmlhelp==2.0.0 ; python_version >= "3.8" and python_version < "4.0" sphinxcontrib-htmlhelp==2.0.0 ; python_version >= "3.8" and python_version < "4.0"

View file

@ -36,6 +36,7 @@ class TestSecurity:
assert len(ip_filter._allowed_ips) == 5116 assert len(ip_filter._allowed_ips) == 5116
assert "91.108.4.50" in ip_filter assert "91.108.4.50" in ip_filter
assert "149.154.160.20" in ip_filter assert "149.154.160.20" in ip_filter
assert "91.108.6.79" in ip_filter
@pytest.mark.parametrize( @pytest.mark.parametrize(
"ip,ip_range", "ip,ip_range",