增加环绕侦察场景适配
This commit is contained in:
@@ -1 +1 @@
|
||||
__version__ = "0.49.3"
|
||||
__version__ = "0.50.0"
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -2,9 +2,9 @@ from __future__ import annotations
|
||||
|
||||
import functools
|
||||
import sys
|
||||
from collections.abc import Awaitable, Generator
|
||||
from collections.abc import Awaitable, Callable, Generator
|
||||
from contextlib import AbstractAsyncContextManager, contextmanager
|
||||
from typing import Any, Callable, Generic, Protocol, TypeVar, overload
|
||||
from typing import Any, Generic, Protocol, TypeVar, overload
|
||||
|
||||
from starlette.types import Scope
|
||||
|
||||
|
||||
@@ -1,14 +1,8 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import sys
|
||||
import warnings
|
||||
from collections.abc import Awaitable, Mapping, Sequence
|
||||
from typing import Any, Callable, TypeVar
|
||||
|
||||
if sys.version_info >= (3, 10): # pragma: no cover
|
||||
from typing import ParamSpec
|
||||
else: # pragma: no cover
|
||||
from typing_extensions import ParamSpec
|
||||
from collections.abc import Awaitable, Callable, Mapping, Sequence
|
||||
from typing import Any, ParamSpec, TypeVar
|
||||
|
||||
from starlette.datastructures import State, URLPath
|
||||
from starlette.middleware import Middleware, _MiddlewareFactory
|
||||
|
||||
@@ -2,16 +2,10 @@ from __future__ import annotations
|
||||
|
||||
import functools
|
||||
import inspect
|
||||
import sys
|
||||
from collections.abc import Sequence
|
||||
from typing import Any, Callable
|
||||
from collections.abc import Callable, Sequence
|
||||
from typing import Any, ParamSpec
|
||||
from urllib.parse import urlencode
|
||||
|
||||
if sys.version_info >= (3, 10): # pragma: no cover
|
||||
from typing import ParamSpec
|
||||
else: # pragma: no cover
|
||||
from typing_extensions import ParamSpec
|
||||
|
||||
from starlette._utils import is_async_callable
|
||||
from starlette.exceptions import HTTPException
|
||||
from starlette.requests import HTTPConnection, Request
|
||||
|
||||
@@ -1,13 +1,7 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import sys
|
||||
from collections.abc import Sequence
|
||||
from typing import Any, Callable
|
||||
|
||||
if sys.version_info >= (3, 10): # pragma: no cover
|
||||
from typing import ParamSpec
|
||||
else: # pragma: no cover
|
||||
from typing_extensions import ParamSpec
|
||||
from collections.abc import Callable, Sequence
|
||||
from typing import Any, ParamSpec
|
||||
|
||||
from starlette._utils import is_async_callable
|
||||
from starlette.concurrency import run_in_threadpool
|
||||
|
||||
@@ -1,18 +1,12 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import functools
|
||||
import sys
|
||||
import warnings
|
||||
from collections.abc import AsyncIterator, Coroutine, Iterable, Iterator
|
||||
from typing import Callable, TypeVar
|
||||
from collections.abc import AsyncIterator, Callable, Coroutine, Iterable, Iterator
|
||||
from typing import ParamSpec, TypeVar
|
||||
|
||||
import anyio.to_thread
|
||||
|
||||
if sys.version_info >= (3, 10): # pragma: no cover
|
||||
from typing import ParamSpec
|
||||
else: # pragma: no cover
|
||||
from typing_extensions import ParamSpec
|
||||
|
||||
P = ParamSpec("P")
|
||||
T = TypeVar("T")
|
||||
|
||||
|
||||
@@ -2,9 +2,9 @@ from __future__ import annotations
|
||||
|
||||
import os
|
||||
import warnings
|
||||
from collections.abc import Iterator, Mapping, MutableMapping
|
||||
from collections.abc import Callable, Iterator, Mapping, MutableMapping
|
||||
from pathlib import Path
|
||||
from typing import Any, Callable, TypeVar, overload
|
||||
from typing import Any, TypeVar, overload
|
||||
|
||||
|
||||
class undefined:
|
||||
|
||||
@@ -7,7 +7,6 @@ from typing import (
|
||||
BinaryIO,
|
||||
NamedTuple,
|
||||
TypeVar,
|
||||
Union,
|
||||
cast,
|
||||
)
|
||||
from urllib.parse import SplitResult, parse_qsl, urlencode, urlsplit
|
||||
@@ -482,7 +481,7 @@ class UploadFile:
|
||||
return f"{self.__class__.__name__}(filename={self.filename!r}, size={self.size!r}, headers={self.headers!r})"
|
||||
|
||||
|
||||
class FormData(ImmutableMultiDict[str, Union[UploadFile, str]]):
|
||||
class FormData(ImmutableMultiDict[str, UploadFile | str]):
|
||||
"""
|
||||
An immutable multidict, containing both file uploads and text input.
|
||||
"""
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import json
|
||||
from collections.abc import Generator
|
||||
from typing import Any, Callable, Literal
|
||||
from collections.abc import Callable, Generator
|
||||
from typing import Any, Literal
|
||||
|
||||
from starlette import status
|
||||
from starlette._utils import is_async_callable
|
||||
|
||||
@@ -1,14 +1,7 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import sys
|
||||
from collections.abc import Awaitable, Iterator
|
||||
from typing import Any, Callable, Protocol
|
||||
|
||||
if sys.version_info >= (3, 10): # pragma: no cover
|
||||
from typing import ParamSpec
|
||||
else: # pragma: no cover
|
||||
from typing_extensions import ParamSpec
|
||||
|
||||
from collections.abc import Awaitable, Callable, Iterator
|
||||
from typing import Any, ParamSpec, Protocol
|
||||
|
||||
P = ParamSpec("P")
|
||||
|
||||
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,6 +1,6 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import Callable
|
||||
from collections.abc import Callable
|
||||
|
||||
from starlette.authentication import (
|
||||
AuthCredentials,
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
from __future__ import annotations
|
||||
|
||||
from collections.abc import AsyncGenerator, AsyncIterable, Awaitable, Mapping, MutableMapping
|
||||
from typing import Any, Callable, TypeVar, Union
|
||||
from collections.abc import AsyncGenerator, AsyncIterable, Awaitable, Callable, Mapping, MutableMapping
|
||||
from typing import Any, TypeVar
|
||||
|
||||
import anyio
|
||||
|
||||
@@ -12,8 +12,8 @@ from starlette.types import ASGIApp, Message, Receive, Scope, Send
|
||||
|
||||
RequestResponseEndpoint = Callable[[Request], Awaitable[Response]]
|
||||
DispatchFunction = Callable[[Request, RequestResponseEndpoint], Awaitable[Response]]
|
||||
BodyStreamGenerator = AsyncGenerator[Union[bytes, MutableMapping[str, Any]], None]
|
||||
AsyncContentStream = AsyncIterable[Union[str, bytes, memoryview, MutableMapping[str, Any]]]
|
||||
BodyStreamGenerator = AsyncGenerator[bytes | MutableMapping[str, Any], None]
|
||||
AsyncContentStream = AsyncIterable[str | bytes | memoryview | MutableMapping[str, Any]]
|
||||
T = TypeVar("T")
|
||||
|
||||
|
||||
|
||||
@@ -4,8 +4,8 @@ import io
|
||||
import math
|
||||
import sys
|
||||
import warnings
|
||||
from collections.abc import MutableMapping
|
||||
from typing import Any, Callable
|
||||
from collections.abc import Callable, MutableMapping
|
||||
from typing import Any
|
||||
|
||||
import anyio
|
||||
from anyio.abc import ObjectReceiveStream, ObjectSendStream
|
||||
|
||||
@@ -7,13 +7,13 @@ import os
|
||||
import stat
|
||||
import sys
|
||||
import warnings
|
||||
from collections.abc import AsyncIterable, Awaitable, Iterable, Mapping, Sequence
|
||||
from collections.abc import AsyncIterable, Awaitable, Callable, Iterable, Mapping, Sequence
|
||||
from datetime import datetime
|
||||
from email.utils import format_datetime, formatdate
|
||||
from functools import partial
|
||||
from mimetypes import guess_type
|
||||
from secrets import token_hex
|
||||
from typing import Any, Callable, Literal, Union
|
||||
from typing import Any, Literal
|
||||
from urllib.parse import quote
|
||||
|
||||
import anyio
|
||||
@@ -49,7 +49,7 @@ class Response:
|
||||
def render(self, content: Any) -> bytes | memoryview:
|
||||
if content is None:
|
||||
return b""
|
||||
if isinstance(content, (bytes, memoryview)):
|
||||
if isinstance(content, bytes | memoryview):
|
||||
return content
|
||||
return content.encode(self.charset) # type: ignore
|
||||
|
||||
@@ -210,10 +210,10 @@ class RedirectResponse(Response):
|
||||
self.headers["location"] = quote(str(url), safe=":/%#?=@[]!$&'()*+,;")
|
||||
|
||||
|
||||
Content = Union[str, bytes, memoryview]
|
||||
Content = str | bytes | memoryview
|
||||
SyncContentStream = Iterable[Content]
|
||||
AsyncContentStream = AsyncIterable[Content]
|
||||
ContentStream = Union[AsyncContentStream, SyncContentStream]
|
||||
ContentStream = AsyncContentStream | SyncContentStream
|
||||
|
||||
|
||||
class StreamingResponse(Response):
|
||||
@@ -251,7 +251,7 @@ class StreamingResponse(Response):
|
||||
}
|
||||
)
|
||||
async for chunk in self.body_iterator:
|
||||
if not isinstance(chunk, (bytes, memoryview)):
|
||||
if not isinstance(chunk, bytes | memoryview):
|
||||
chunk = chunk.encode(self.charset)
|
||||
await send({"type": "http.response.body", "body": chunk, "more_body": True})
|
||||
|
||||
|
||||
@@ -7,11 +7,11 @@ import re
|
||||
import traceback
|
||||
import types
|
||||
import warnings
|
||||
from collections.abc import Awaitable, Collection, Generator, Sequence
|
||||
from collections.abc import Awaitable, Callable, Collection, Generator, Sequence
|
||||
from contextlib import AbstractAsyncContextManager, AbstractContextManager, asynccontextmanager
|
||||
from enum import Enum
|
||||
from re import Pattern
|
||||
from typing import Any, Callable, TypeVar
|
||||
from typing import Any, TypeVar
|
||||
|
||||
from starlette._exception_handler import wrap_app_handling_exceptions
|
||||
from starlette._utils import get_route_path, is_async_callable
|
||||
|
||||
@@ -2,7 +2,8 @@ from __future__ import annotations
|
||||
|
||||
import inspect
|
||||
import re
|
||||
from typing import Any, Callable, NamedTuple
|
||||
from collections.abc import Callable
|
||||
from typing import Any, NamedTuple
|
||||
|
||||
from starlette.requests import Request
|
||||
from starlette.responses import Response
|
||||
@@ -50,7 +51,7 @@ class BaseSchemaGenerator:
|
||||
endpoints_info: list[EndpointInfo] = []
|
||||
|
||||
for route in routes:
|
||||
if isinstance(route, (Mount, Host)):
|
||||
if isinstance(route, Mount | Host):
|
||||
routes = route.routes or []
|
||||
if isinstance(route, Mount):
|
||||
path = self._remove_converter(route.path)
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import warnings
|
||||
from collections.abc import Mapping, Sequence
|
||||
from collections.abc import Callable, Mapping, Sequence
|
||||
from os import PathLike
|
||||
from typing import Any, Callable, cast, overload
|
||||
from typing import Any, cast, overload
|
||||
|
||||
from starlette.background import BackgroundTask
|
||||
from starlette.datastructures import URL
|
||||
|
||||
@@ -7,16 +7,15 @@ import json
|
||||
import math
|
||||
import sys
|
||||
import warnings
|
||||
from collections.abc import Awaitable, Generator, Iterable, Mapping, MutableMapping, Sequence
|
||||
from collections.abc import Awaitable, Callable, Generator, Iterable, Mapping, MutableMapping, Sequence
|
||||
from concurrent.futures import Future
|
||||
from contextlib import AbstractContextManager
|
||||
from types import GeneratorType
|
||||
from typing import (
|
||||
Any,
|
||||
Callable,
|
||||
Literal,
|
||||
TypedDict,
|
||||
Union,
|
||||
TypeGuard,
|
||||
cast,
|
||||
)
|
||||
from urllib.parse import unquote, urljoin
|
||||
@@ -30,11 +29,6 @@ from starlette._utils import is_async_callable
|
||||
from starlette.types import ASGIApp, Message, Receive, Scope, Send
|
||||
from starlette.websockets import WebSocketDisconnect
|
||||
|
||||
if sys.version_info >= (3, 10): # pragma: no cover
|
||||
from typing import TypeGuard
|
||||
else: # pragma: no cover
|
||||
from typing_extensions import TypeGuard
|
||||
|
||||
if sys.version_info >= (3, 11): # pragma: no cover
|
||||
from typing import Self
|
||||
else: # pragma: no cover
|
||||
@@ -55,7 +49,7 @@ ASGI2App = Callable[[Scope], ASGIInstance]
|
||||
ASGI3App = Callable[[Scope, Receive, Send], Awaitable[None]]
|
||||
|
||||
|
||||
_RequestData = Mapping[str, Union[str, Iterable[str], bytes]]
|
||||
_RequestData = Mapping[str, str | Iterable[str] | bytes]
|
||||
|
||||
|
||||
def _is_asgi3(app: ASGI2App | ASGI3App) -> TypeGuard[ASGI3App]:
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
from collections.abc import Awaitable, Mapping, MutableMapping
|
||||
from collections.abc import Awaitable, Callable, Mapping, MutableMapping
|
||||
from contextlib import AbstractAsyncContextManager
|
||||
from typing import TYPE_CHECKING, Any, Callable, TypeVar, Union
|
||||
from typing import TYPE_CHECKING, Any, TypeVar
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from starlette.requests import Request
|
||||
@@ -19,8 +19,8 @@ ASGIApp = Callable[[Scope, Receive, Send], Awaitable[None]]
|
||||
|
||||
StatelessLifespan = Callable[[AppType], AbstractAsyncContextManager[None]]
|
||||
StatefulLifespan = Callable[[AppType], AbstractAsyncContextManager[Mapping[str, Any]]]
|
||||
Lifespan = Union[StatelessLifespan[AppType], StatefulLifespan[AppType]]
|
||||
Lifespan = StatelessLifespan[AppType] | StatefulLifespan[AppType]
|
||||
|
||||
HTTPExceptionHandler = Callable[["Request", Exception], "Response | Awaitable[Response]"]
|
||||
WebSocketExceptionHandler = Callable[["WebSocket", Exception], Awaitable[None]]
|
||||
ExceptionHandler = Union[HTTPExceptionHandler, WebSocketExceptionHandler]
|
||||
ExceptionHandler = HTTPExceptionHandler | WebSocketExceptionHandler
|
||||
|
||||
Reference in New Issue
Block a user