🎨 fix pre-commit.ci

This commit is contained in:
HibiKier 2025-02-03 19:16:05 +08:00
parent 07ea6b060e
commit 0c155bc2b8

View File

@ -42,7 +42,7 @@ class AsyncHttpx:
verify: bool = True, verify: bool = True,
use_proxy: bool = True, use_proxy: bool = True,
proxy: dict[str, str] | None = None, proxy: dict[str, str] | None = None,
timeout: int = 30, timeout: int = 30, # noqa: ASYNC109
**kwargs, **kwargs,
) -> Response: ) -> Response:
"""Get """Get
@ -97,7 +97,7 @@ class AsyncHttpx:
verify: bool = True, verify: bool = True,
use_proxy: bool = True, use_proxy: bool = True,
proxy: dict[str, str] | None = None, proxy: dict[str, str] | None = None,
timeout: int = 30, timeout: int = 30, # noqa: ASYNC109
**kwargs, **kwargs,
) -> Response: ) -> Response:
if not headers: if not headers:
@ -124,7 +124,7 @@ class AsyncHttpx:
verify: bool = True, verify: bool = True,
use_proxy: bool = True, use_proxy: bool = True,
proxy: dict[str, str] | None = None, proxy: dict[str, str] | None = None,
timeout: int = 30, timeout: int = 30, # noqa: ASYNC109
**kwargs, **kwargs,
) -> Response: ) -> Response:
"""Get """Get
@ -167,7 +167,7 @@ class AsyncHttpx:
params: dict[str, str] | None = None, params: dict[str, str] | None = None,
headers: dict[str, str] | None = None, headers: dict[str, str] | None = None,
cookies: dict[str, str] | None = None, cookies: dict[str, str] | None = None,
timeout: int = 30, timeout: int = 30, # noqa: ASYNC109
**kwargs, **kwargs,
) -> Response: ) -> Response:
""" """
@ -220,7 +220,7 @@ class AsyncHttpx:
proxy: dict[str, str] | None = None, proxy: dict[str, str] | None = None,
headers: dict[str, str] | None = None, headers: dict[str, str] | None = None,
cookies: dict[str, str] | None = None, cookies: dict[str, str] | None = None,
timeout: int = 30, timeout: int = 30, # noqa: ASYNC109
stream: bool = False, stream: bool = False,
follow_redirects: bool = True, follow_redirects: bool = True,
**kwargs, **kwargs,
@ -340,7 +340,7 @@ class AsyncHttpx:
proxy: dict[str, str] | None = None, proxy: dict[str, str] | None = None,
headers: dict[str, str] | None = None, headers: dict[str, str] | None = None,
cookies: dict[str, str] | None = None, cookies: dict[str, str] | None = None,
timeout: int = 30, timeout: int = 30, # noqa: ASYNC109
**kwargs, **kwargs,
) -> list[bool]: ) -> list[bool]:
"""分组同时下载文件 """分组同时下载文件
@ -380,8 +380,7 @@ class AsyncHttpx:
tasks = [] tasks = []
result_ = [] result_ = []
for x, y in zip(_split_url_list, _split_path_list): for x, y in zip(_split_url_list, _split_path_list):
for url, path in zip(x, y): tasks.extend(
tasks.append(
asyncio.create_task( asyncio.create_task(
cls.download_file( cls.download_file(
url, url,
@ -395,6 +394,7 @@ class AsyncHttpx:
**kwargs, **kwargs,
) )
) )
for url, path in zip(x, y)
) )
_x = await asyncio.gather(*tasks) _x = await asyncio.gather(*tasks)
result_ = result_ + list(_x) result_ = result_ + list(_x)