diff options
author | Martin Fischer <martin@push-f.com> | 2022-01-17 09:04:51 +0100 |
---|---|---|
committer | Martin Fischer <martin@push-f.com> | 2022-01-17 11:42:48 +0100 |
commit | def62c3a47384b6672cb584cd586ea104b86754f (patch) | |
tree | 3c250dbc0f50ddcd82ba336afd638c362bc9df21 /searx/network | |
parent | 6d43cf7952cb22dbf8c7d1851eeee1931f8604c3 (diff) | |
download | searxng-def62c3a47384b6672cb584cd586ea104b86754f.tar.gz searxng-def62c3a47384b6672cb584cd586ea104b86754f.zip |
[typing] add type hints for dictionaries
Diffstat (limited to 'searx/network')
-rw-r--r-- | searx/network/client.py | 4 | ||||
-rw-r--r-- | searx/network/network.py | 3 |
2 files changed, 5 insertions, 2 deletions
diff --git a/searx/network/client.py b/searx/network/client.py index 6858ac05b..11086dd33 100644 --- a/searx/network/client.py +++ b/searx/network/client.py @@ -4,7 +4,9 @@ import asyncio import logging +from ssl import SSLContext import threading +from typing import Any, Dict import httpx from httpx_socks import AsyncProxyTransport @@ -23,7 +25,7 @@ else: logger = logger.getChild('searx.network.client') LOOP = None -SSLCONTEXTS = {} +SSLCONTEXTS: Dict[Any, SSLContext] = {} TRANSPORT_KWARGS = { 'trust_env': False, } diff --git a/searx/network/network.py b/searx/network/network.py index 43140b44d..c9af97649 100644 --- a/searx/network/network.py +++ b/searx/network/network.py @@ -7,6 +7,7 @@ import atexit import asyncio import ipaddress from itertools import cycle +from typing import Dict import httpx @@ -16,7 +17,7 @@ from .client import new_client, get_loop, AsyncHTTPTransportNoHttp logger = logger.getChild('network') DEFAULT_NAME = '__DEFAULT__' -NETWORKS = {} +NETWORKS: Dict[str, 'Network'] = {} # requests compatibility when reading proxy settings from settings.yml PROXY_PATTERN_MAPPING = { 'http': 'http://', |