mirror of
https://github.com/microsoft/pyright.git
synced 2024-09-11 07:55:56 +03:00
Updated typeshed stubs to the latest version.
This commit is contained in:
parent
400bb92da0
commit
7c8e8ba8e0
@ -267,18 +267,16 @@ export const deprecatedAliases = new Map<string, DeprecatedForm>([
|
||||
'ContextManager',
|
||||
{
|
||||
version: pythonVersion3_9,
|
||||
fullName: 'contextlib.AbstractContextManager',
|
||||
fullName: 'typing.ContextManager',
|
||||
replacementText: 'contextlib.AbstractContextManager',
|
||||
typingImportOnly: true,
|
||||
},
|
||||
],
|
||||
[
|
||||
'AsyncContextManager',
|
||||
{
|
||||
version: pythonVersion3_9,
|
||||
fullName: 'contextlib.AbstractAsyncContextManager',
|
||||
fullName: 'typing.AsyncContextManager',
|
||||
replacementText: 'contextlib.AbstractAsyncContextManager',
|
||||
typingImportOnly: true,
|
||||
},
|
||||
],
|
||||
[
|
||||
|
@ -6,6 +6,7 @@ from typing import Any, Coroutine
|
||||
|
||||
|
||||
async def inspector(coro: Coroutine[Any, Any, Any]):
|
||||
assert coro.cr_frame is not None
|
||||
print(coro.cr_frame.f_locals)
|
||||
return await coro
|
||||
|
||||
|
@ -1 +1 @@
|
||||
8d1dcdbd29e72508cb9e1c4f26d916c23ab2f478
|
||||
7ed91bc2e77ec18d28307dc6086a778ecc9c7bb3
|
||||
|
@ -47,10 +47,15 @@ AnyStr_co = TypeVar("AnyStr_co", str, bytes, covariant=True) # noqa: Y001
|
||||
# isn't possible or a type is already partially known. In cases like these,
|
||||
# use Incomplete instead of Any as a marker. For example, use
|
||||
# "Incomplete | None" instead of "Any | None".
|
||||
Incomplete: TypeAlias = Any
|
||||
Incomplete: TypeAlias = Any # stable
|
||||
|
||||
# To describe a function parameter that is unused and will work with anything.
|
||||
Unused: TypeAlias = object
|
||||
Unused: TypeAlias = object # stable
|
||||
|
||||
# Marker for return types that include None, but where forcing the user to
|
||||
# check for None can be detrimental. Sometimes called "the Any trick". See
|
||||
# CONTRIBUTING.md for more information.
|
||||
MaybeNone: TypeAlias = Any # stable
|
||||
|
||||
# Used to mark arguments that default to a sentinel value. This prevents
|
||||
# stubtest from complaining about the default value not matching.
|
||||
|
@ -15,6 +15,6 @@ if sys.version_info >= (3, 12):
|
||||
THREAD_JOIN_TIMEOUT: Literal[300]
|
||||
|
||||
class _SendfileMode(enum.Enum):
|
||||
UNSUPPORTED: int
|
||||
TRY_NATIVE: int
|
||||
FALLBACK: int
|
||||
UNSUPPORTED = 1
|
||||
TRY_NATIVE = 2
|
||||
FALLBACK = 3
|
||||
|
@ -101,10 +101,10 @@ class BoundedSemaphore(Semaphore): ...
|
||||
|
||||
if sys.version_info >= (3, 11):
|
||||
class _BarrierState(enum.Enum): # undocumented
|
||||
FILLING: str
|
||||
DRAINING: str
|
||||
RESETTING: str
|
||||
BROKEN: str
|
||||
FILLING = "filling"
|
||||
DRAINING = "draining"
|
||||
RESETTING = "resetting"
|
||||
BROKEN = "broken"
|
||||
|
||||
class Barrier(_LoopBoundMixin):
|
||||
def __init__(self, parties: int) -> None: ...
|
||||
|
@ -14,17 +14,17 @@ if sys.version_info >= (3, 11):
|
||||
SSLAgainErrors: tuple[type[ssl.SSLWantReadError], type[ssl.SSLSyscallError]]
|
||||
|
||||
class SSLProtocolState(Enum):
|
||||
UNWRAPPED: str
|
||||
DO_HANDSHAKE: str
|
||||
WRAPPED: str
|
||||
FLUSHING: str
|
||||
SHUTDOWN: str
|
||||
UNWRAPPED = "UNWRAPPED"
|
||||
DO_HANDSHAKE = "DO_HANDSHAKE"
|
||||
WRAPPED = "WRAPPED"
|
||||
FLUSHING = "FLUSHING"
|
||||
SHUTDOWN = "SHUTDOWN"
|
||||
|
||||
class AppProtocolState(Enum):
|
||||
STATE_INIT: str
|
||||
STATE_CON_MADE: str
|
||||
STATE_EOF: str
|
||||
STATE_CON_LOST: str
|
||||
STATE_INIT = "STATE_INIT"
|
||||
STATE_CON_MADE = "STATE_CON_MADE"
|
||||
STATE_EOF = "STATE_EOF"
|
||||
STATE_CON_LOST = "STATE_CON_LOST"
|
||||
|
||||
def add_flowcontrol_defaults(high: int | None, low: int | None, kb: int) -> tuple[int, int]: ...
|
||||
|
||||
|
@ -1,8 +1,8 @@
|
||||
import ssl
|
||||
import sys
|
||||
from _typeshed import StrPath
|
||||
from collections.abc import AsyncIterator, Awaitable, Callable, Iterable, Sequence
|
||||
from typing import Any, SupportsIndex
|
||||
from _typeshed import ReadableBuffer, StrPath
|
||||
from collections.abc import AsyncIterator, Awaitable, Callable, Iterable, Sequence, Sized
|
||||
from typing import Any, Protocol, SupportsIndex
|
||||
from typing_extensions import Self, TypeAlias
|
||||
|
||||
from . import events, protocols, transports
|
||||
@ -23,6 +23,8 @@ else:
|
||||
|
||||
_ClientConnectedCallback: TypeAlias = Callable[[StreamReader, StreamWriter], Awaitable[None] | None]
|
||||
|
||||
class _ReaduntilBuffer(ReadableBuffer, Sized, Protocol): ...
|
||||
|
||||
if sys.version_info >= (3, 10):
|
||||
async def open_connection(
|
||||
host: str | None = None,
|
||||
@ -140,8 +142,11 @@ class StreamReader(AsyncIterator[bytes]):
|
||||
def at_eof(self) -> bool: ...
|
||||
def feed_data(self, data: Iterable[SupportsIndex]) -> None: ...
|
||||
async def readline(self) -> bytes: ...
|
||||
# Can be any buffer that supports len(); consider changing to a Protocol if PEP 688 is accepted
|
||||
async def readuntil(self, separator: bytes | bytearray | memoryview = b"\n") -> bytes: ...
|
||||
if sys.version_info >= (3, 13):
|
||||
async def readuntil(self, separator: _ReaduntilBuffer | tuple[_ReaduntilBuffer, ...] = b"\n") -> bytes: ...
|
||||
else:
|
||||
async def readuntil(self, separator: _ReaduntilBuffer = b"\n") -> bytes: ...
|
||||
|
||||
async def read(self, n: int = -1) -> bytes: ...
|
||||
async def readexactly(self, n: int) -> bytes: ...
|
||||
def __aiter__(self) -> Self: ...
|
||||
|
@ -31,32 +31,33 @@ if sys.version_info >= (3, 11):
|
||||
_T = TypeVar("_T")
|
||||
_T_co = TypeVar("_T_co", covariant=True)
|
||||
_T_io = TypeVar("_T_io", bound=IO[str] | None)
|
||||
_ExitT_co = TypeVar("_ExitT_co", covariant=True, bound=bool | None, default=bool | None)
|
||||
_F = TypeVar("_F", bound=Callable[..., Any])
|
||||
_P = ParamSpec("_P")
|
||||
|
||||
_ExitFunc: TypeAlias = Callable[[type[BaseException] | None, BaseException | None, TracebackType | None], bool | None]
|
||||
_CM_EF = TypeVar("_CM_EF", bound=AbstractContextManager[Any] | _ExitFunc)
|
||||
_CM_EF = TypeVar("_CM_EF", bound=AbstractContextManager[Any, Any] | _ExitFunc)
|
||||
|
||||
@runtime_checkable
|
||||
class AbstractContextManager(Protocol[_T_co]):
|
||||
class AbstractContextManager(Protocol[_T_co, _ExitT_co]):
|
||||
def __enter__(self) -> _T_co: ...
|
||||
@abstractmethod
|
||||
def __exit__(
|
||||
self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None, /
|
||||
) -> bool | None: ...
|
||||
) -> _ExitT_co: ...
|
||||
|
||||
@runtime_checkable
|
||||
class AbstractAsyncContextManager(Protocol[_T_co]):
|
||||
class AbstractAsyncContextManager(Protocol[_T_co, _ExitT_co]):
|
||||
async def __aenter__(self) -> _T_co: ...
|
||||
@abstractmethod
|
||||
async def __aexit__(
|
||||
self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None, /
|
||||
) -> bool | None: ...
|
||||
) -> _ExitT_co: ...
|
||||
|
||||
class ContextDecorator:
|
||||
def __call__(self, func: _F) -> _F: ...
|
||||
|
||||
class _GeneratorContextManager(AbstractContextManager[_T_co], ContextDecorator):
|
||||
class _GeneratorContextManager(AbstractContextManager[_T_co, bool | None], ContextDecorator):
|
||||
# __init__ and all instance attributes are actually inherited from _GeneratorContextManagerBase
|
||||
# _GeneratorContextManagerBase is more trouble than it's worth to include in the stub; see #6676
|
||||
def __init__(self, func: Callable[..., Iterator[_T_co]], args: tuple[Any, ...], kwds: dict[str, Any]) -> None: ...
|
||||
@ -81,7 +82,7 @@ if sys.version_info >= (3, 10):
|
||||
class AsyncContextDecorator:
|
||||
def __call__(self, func: _AF) -> _AF: ...
|
||||
|
||||
class _AsyncGeneratorContextManager(AbstractAsyncContextManager[_T_co], AsyncContextDecorator):
|
||||
class _AsyncGeneratorContextManager(AbstractAsyncContextManager[_T_co, bool | None], AsyncContextDecorator):
|
||||
# __init__ and these attributes are actually defined in the base class _GeneratorContextManagerBase,
|
||||
# which is more trouble than it's worth to include in the stub (see #6676)
|
||||
def __init__(self, func: Callable[..., AsyncIterator[_T_co]], args: tuple[Any, ...], kwds: dict[str, Any]) -> None: ...
|
||||
@ -94,7 +95,7 @@ if sys.version_info >= (3, 10):
|
||||
) -> bool | None: ...
|
||||
|
||||
else:
|
||||
class _AsyncGeneratorContextManager(AbstractAsyncContextManager[_T_co]):
|
||||
class _AsyncGeneratorContextManager(AbstractAsyncContextManager[_T_co, bool | None]):
|
||||
def __init__(self, func: Callable[..., AsyncIterator[_T_co]], args: tuple[Any, ...], kwds: dict[str, Any]) -> None: ...
|
||||
gen: AsyncGenerator[_T_co, Any]
|
||||
func: Callable[..., AsyncGenerator[_T_co, Any]]
|
||||
@ -111,7 +112,7 @@ class _SupportsClose(Protocol):
|
||||
|
||||
_SupportsCloseT = TypeVar("_SupportsCloseT", bound=_SupportsClose)
|
||||
|
||||
class closing(AbstractContextManager[_SupportsCloseT]):
|
||||
class closing(AbstractContextManager[_SupportsCloseT, None]):
|
||||
def __init__(self, thing: _SupportsCloseT) -> None: ...
|
||||
def __exit__(self, *exc_info: Unused) -> None: ...
|
||||
|
||||
@ -121,17 +122,17 @@ if sys.version_info >= (3, 10):
|
||||
|
||||
_SupportsAcloseT = TypeVar("_SupportsAcloseT", bound=_SupportsAclose)
|
||||
|
||||
class aclosing(AbstractAsyncContextManager[_SupportsAcloseT]):
|
||||
class aclosing(AbstractAsyncContextManager[_SupportsAcloseT, None]):
|
||||
def __init__(self, thing: _SupportsAcloseT) -> None: ...
|
||||
async def __aexit__(self, *exc_info: Unused) -> None: ...
|
||||
|
||||
class suppress(AbstractContextManager[None]):
|
||||
class suppress(AbstractContextManager[None, bool]):
|
||||
def __init__(self, *exceptions: type[BaseException]) -> None: ...
|
||||
def __exit__(
|
||||
self, exctype: type[BaseException] | None, excinst: BaseException | None, exctb: TracebackType | None
|
||||
) -> bool: ...
|
||||
|
||||
class _RedirectStream(AbstractContextManager[_T_io]):
|
||||
class _RedirectStream(AbstractContextManager[_T_io, None]):
|
||||
def __init__(self, new_target: _T_io) -> None: ...
|
||||
def __exit__(
|
||||
self, exctype: type[BaseException] | None, excinst: BaseException | None, exctb: TracebackType | None
|
||||
@ -142,8 +143,8 @@ class redirect_stderr(_RedirectStream[_T_io]): ...
|
||||
|
||||
# In reality this is a subclass of `AbstractContextManager`;
|
||||
# see #7961 for why we don't do that in the stub
|
||||
class ExitStack(metaclass=abc.ABCMeta):
|
||||
def enter_context(self, cm: AbstractContextManager[_T]) -> _T: ...
|
||||
class ExitStack(Generic[_ExitT_co], metaclass=abc.ABCMeta):
|
||||
def enter_context(self, cm: AbstractContextManager[_T, _ExitT_co]) -> _T: ...
|
||||
def push(self, exit: _CM_EF) -> _CM_EF: ...
|
||||
def callback(self, callback: Callable[_P, _T], /, *args: _P.args, **kwds: _P.kwargs) -> Callable[_P, _T]: ...
|
||||
def pop_all(self) -> Self: ...
|
||||
@ -151,18 +152,18 @@ class ExitStack(metaclass=abc.ABCMeta):
|
||||
def __enter__(self) -> Self: ...
|
||||
def __exit__(
|
||||
self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None, /
|
||||
) -> bool: ...
|
||||
) -> _ExitT_co: ...
|
||||
|
||||
_ExitCoroFunc: TypeAlias = Callable[
|
||||
[type[BaseException] | None, BaseException | None, TracebackType | None], Awaitable[bool | None]
|
||||
]
|
||||
_ACM_EF = TypeVar("_ACM_EF", bound=AbstractAsyncContextManager[Any] | _ExitCoroFunc)
|
||||
_ACM_EF = TypeVar("_ACM_EF", bound=AbstractAsyncContextManager[Any, Any] | _ExitCoroFunc)
|
||||
|
||||
# In reality this is a subclass of `AbstractAsyncContextManager`;
|
||||
# see #7961 for why we don't do that in the stub
|
||||
class AsyncExitStack(metaclass=abc.ABCMeta):
|
||||
def enter_context(self, cm: AbstractContextManager[_T]) -> _T: ...
|
||||
async def enter_async_context(self, cm: AbstractAsyncContextManager[_T]) -> _T: ...
|
||||
class AsyncExitStack(Generic[_ExitT_co], metaclass=abc.ABCMeta):
|
||||
def enter_context(self, cm: AbstractContextManager[_T, _ExitT_co]) -> _T: ...
|
||||
async def enter_async_context(self, cm: AbstractAsyncContextManager[_T, _ExitT_co]) -> _T: ...
|
||||
def push(self, exit: _CM_EF) -> _CM_EF: ...
|
||||
def push_async_exit(self, exit: _ACM_EF) -> _ACM_EF: ...
|
||||
def callback(self, callback: Callable[_P, _T], /, *args: _P.args, **kwds: _P.kwargs) -> Callable[_P, _T]: ...
|
||||
@ -177,7 +178,7 @@ class AsyncExitStack(metaclass=abc.ABCMeta):
|
||||
) -> bool: ...
|
||||
|
||||
if sys.version_info >= (3, 10):
|
||||
class nullcontext(AbstractContextManager[_T], AbstractAsyncContextManager[_T]):
|
||||
class nullcontext(AbstractContextManager[_T, None], AbstractAsyncContextManager[_T, None]):
|
||||
enter_result: _T
|
||||
@overload
|
||||
def __init__(self: nullcontext[None], enter_result: None = None) -> None: ...
|
||||
@ -189,7 +190,7 @@ if sys.version_info >= (3, 10):
|
||||
async def __aexit__(self, *exctype: Unused) -> None: ...
|
||||
|
||||
else:
|
||||
class nullcontext(AbstractContextManager[_T]):
|
||||
class nullcontext(AbstractContextManager[_T, None]):
|
||||
enter_result: _T
|
||||
@overload
|
||||
def __init__(self: nullcontext[None], enter_result: None = None) -> None: ...
|
||||
@ -201,7 +202,7 @@ else:
|
||||
if sys.version_info >= (3, 11):
|
||||
_T_fd_or_any_path = TypeVar("_T_fd_or_any_path", bound=FileDescriptorOrPath)
|
||||
|
||||
class chdir(AbstractContextManager[None], Generic[_T_fd_or_any_path]):
|
||||
class chdir(AbstractContextManager[None, None], Generic[_T_fd_or_any_path]):
|
||||
path: _T_fd_or_any_path
|
||||
def __init__(self, path: _T_fd_or_any_path) -> None: ...
|
||||
def __enter__(self) -> None: ...
|
||||
|
@ -3,22 +3,25 @@ from email import _ParamsType, _ParamType
|
||||
from email.charset import Charset
|
||||
from email.contentmanager import ContentManager
|
||||
from email.errors import MessageDefect
|
||||
from email.header import Header
|
||||
from email.policy import Policy
|
||||
from typing import Any, Literal, Protocol, TypeVar, overload
|
||||
from typing import Any, Generic, Literal, Protocol, TypeVar, overload
|
||||
from typing_extensions import Self, TypeAlias
|
||||
|
||||
__all__ = ["Message", "EmailMessage"]
|
||||
|
||||
_T = TypeVar("_T")
|
||||
# Type returned by Policy.header_fetch_parse, often str or Header.
|
||||
_HeaderT = TypeVar("_HeaderT", default=str)
|
||||
_HeaderParamT = TypeVar("_HeaderParamT", default=str)
|
||||
# Represents headers constructed by HeaderRegistry. Those are sub-classes
|
||||
# of BaseHeader and another header type.
|
||||
_HeaderRegistryT = TypeVar("_HeaderRegistryT", default=Any)
|
||||
_HeaderRegistryParamT = TypeVar("_HeaderRegistryParamT", default=Any)
|
||||
|
||||
_PayloadType: TypeAlias = Message | str
|
||||
_EncodedPayloadType: TypeAlias = Message | bytes
|
||||
_MultipartPayloadType: TypeAlias = list[_PayloadType]
|
||||
_CharsetType: TypeAlias = Charset | str | None
|
||||
# Type returned by Policy.header_fetch_parse, often str or Header.
|
||||
_HeaderType: TypeAlias = Any
|
||||
# Type accepted by Policy.header_store_parse.
|
||||
_HeaderTypeParam: TypeAlias = str | Header | Any
|
||||
|
||||
class _SupportsEncodeToPayload(Protocol):
|
||||
def encode(self, encoding: str, /) -> _PayloadType | _MultipartPayloadType | _SupportsDecodeToPayload: ...
|
||||
@ -26,10 +29,7 @@ class _SupportsEncodeToPayload(Protocol):
|
||||
class _SupportsDecodeToPayload(Protocol):
|
||||
def decode(self, encoding: str, errors: str, /) -> _PayloadType | _MultipartPayloadType: ...
|
||||
|
||||
# TODO: This class should be generic over the header policy and/or the header
|
||||
# value types allowed by the policy. This depends on PEP 696 support
|
||||
# (https://github.com/python/typeshed/issues/11422).
|
||||
class Message:
|
||||
class Message(Generic[_HeaderT, _HeaderParamT]):
|
||||
policy: Policy # undocumented
|
||||
preamble: str | None
|
||||
epilogue: str | None
|
||||
@ -70,24 +70,23 @@ class Message:
|
||||
# Same as `get` with `failobj=None`, but with the expectation that it won't return None in most scenarios
|
||||
# This is important for protocols using __getitem__, like SupportsKeysAndGetItem
|
||||
# Morally, the return type should be `AnyOf[_HeaderType, None]`,
|
||||
# which we could spell as `_HeaderType | Any`,
|
||||
# *but* `_HeaderType` itself is currently an alias to `Any`...
|
||||
def __getitem__(self, name: str) -> _HeaderType: ...
|
||||
def __setitem__(self, name: str, val: _HeaderTypeParam) -> None: ...
|
||||
# so using "the Any trick" instead.
|
||||
def __getitem__(self, name: str) -> _HeaderT | Any: ...
|
||||
def __setitem__(self, name: str, val: _HeaderParamT) -> None: ...
|
||||
def __delitem__(self, name: str) -> None: ...
|
||||
def keys(self) -> list[str]: ...
|
||||
def values(self) -> list[_HeaderType]: ...
|
||||
def items(self) -> list[tuple[str, _HeaderType]]: ...
|
||||
def values(self) -> list[_HeaderT]: ...
|
||||
def items(self) -> list[tuple[str, _HeaderT]]: ...
|
||||
@overload
|
||||
def get(self, name: str, failobj: None = None) -> _HeaderType | None: ...
|
||||
def get(self, name: str, failobj: None = None) -> _HeaderT | None: ...
|
||||
@overload
|
||||
def get(self, name: str, failobj: _T) -> _HeaderType | _T: ...
|
||||
def get(self, name: str, failobj: _T) -> _HeaderT | _T: ...
|
||||
@overload
|
||||
def get_all(self, name: str, failobj: None = None) -> list[_HeaderType] | None: ...
|
||||
def get_all(self, name: str, failobj: None = None) -> list[_HeaderT] | None: ...
|
||||
@overload
|
||||
def get_all(self, name: str, failobj: _T) -> list[_HeaderType] | _T: ...
|
||||
def get_all(self, name: str, failobj: _T) -> list[_HeaderT] | _T: ...
|
||||
def add_header(self, _name: str, _value: str, **_params: _ParamsType) -> None: ...
|
||||
def replace_header(self, _name: str, _value: _HeaderTypeParam) -> None: ...
|
||||
def replace_header(self, _name: str, _value: _HeaderParamT) -> None: ...
|
||||
def get_content_type(self) -> str: ...
|
||||
def get_content_maintype(self) -> str: ...
|
||||
def get_content_subtype(self) -> str: ...
|
||||
@ -141,14 +140,14 @@ class Message:
|
||||
) -> None: ...
|
||||
def __init__(self, policy: Policy = ...) -> None: ...
|
||||
# The following two methods are undocumented, but a source code comment states that they are public API
|
||||
def set_raw(self, name: str, value: _HeaderTypeParam) -> None: ...
|
||||
def raw_items(self) -> Iterator[tuple[str, _HeaderType]]: ...
|
||||
def set_raw(self, name: str, value: _HeaderParamT) -> None: ...
|
||||
def raw_items(self) -> Iterator[tuple[str, _HeaderT]]: ...
|
||||
|
||||
class MIMEPart(Message):
|
||||
class MIMEPart(Message[_HeaderRegistryT, _HeaderRegistryParamT]):
|
||||
def __init__(self, policy: Policy | None = None) -> None: ...
|
||||
def get_body(self, preferencelist: Sequence[str] = ("related", "html", "plain")) -> Message | None: ...
|
||||
def iter_attachments(self) -> Iterator[Message]: ...
|
||||
def iter_parts(self) -> Iterator[Message]: ...
|
||||
def get_body(self, preferencelist: Sequence[str] = ("related", "html", "plain")) -> MIMEPart[_HeaderRegistryT] | None: ...
|
||||
def iter_attachments(self) -> Iterator[MIMEPart[_HeaderRegistryT]]: ...
|
||||
def iter_parts(self) -> Iterator[MIMEPart[_HeaderRegistryT]]: ...
|
||||
def get_content(self, *args: Any, content_manager: ContentManager | None = None, **kw: Any) -> Any: ...
|
||||
def set_content(self, *args: Any, content_manager: ContentManager | None = None, **kw: Any) -> None: ...
|
||||
def make_related(self, boundary: str | None = None) -> None: ...
|
||||
|
@ -3,24 +3,34 @@ from collections.abc import Callable
|
||||
from email.feedparser import BytesFeedParser as BytesFeedParser, FeedParser as FeedParser
|
||||
from email.message import Message
|
||||
from email.policy import Policy
|
||||
from typing import IO
|
||||
from io import _WrappedBuffer
|
||||
from typing import Generic, TypeVar, overload
|
||||
|
||||
__all__ = ["Parser", "HeaderParser", "BytesParser", "BytesHeaderParser", "FeedParser", "BytesFeedParser"]
|
||||
|
||||
class Parser:
|
||||
def __init__(self, _class: Callable[[], Message] | None = None, *, policy: Policy = ...) -> None: ...
|
||||
def parse(self, fp: SupportsRead[str], headersonly: bool = False) -> Message: ...
|
||||
def parsestr(self, text: str, headersonly: bool = False) -> Message: ...
|
||||
_MessageT = TypeVar("_MessageT", bound=Message, default=Message)
|
||||
|
||||
class HeaderParser(Parser):
|
||||
def parse(self, fp: SupportsRead[str], headersonly: bool = True) -> Message: ...
|
||||
def parsestr(self, text: str, headersonly: bool = True) -> Message: ...
|
||||
class Parser(Generic[_MessageT]):
|
||||
@overload
|
||||
def __init__(self: Parser[Message[str, str]], _class: None = None, *, policy: Policy = ...) -> None: ...
|
||||
@overload
|
||||
def __init__(self, _class: Callable[[], _MessageT], *, policy: Policy = ...) -> None: ...
|
||||
def parse(self, fp: SupportsRead[str], headersonly: bool = False) -> _MessageT: ...
|
||||
def parsestr(self, text: str, headersonly: bool = False) -> _MessageT: ...
|
||||
|
||||
class BytesParser:
|
||||
def __init__(self, _class: Callable[[], Message] = ..., *, policy: Policy = ...) -> None: ...
|
||||
def parse(self, fp: IO[bytes], headersonly: bool = False) -> Message: ...
|
||||
def parsebytes(self, text: bytes | bytearray, headersonly: bool = False) -> Message: ...
|
||||
class HeaderParser(Parser[_MessageT]):
|
||||
def parse(self, fp: SupportsRead[str], headersonly: bool = True) -> _MessageT: ...
|
||||
def parsestr(self, text: str, headersonly: bool = True) -> _MessageT: ...
|
||||
|
||||
class BytesHeaderParser(BytesParser):
|
||||
def parse(self, fp: IO[bytes], headersonly: bool = True) -> Message: ...
|
||||
def parsebytes(self, text: bytes | bytearray, headersonly: bool = True) -> Message: ...
|
||||
class BytesParser(Generic[_MessageT]):
|
||||
parser: Parser[_MessageT]
|
||||
@overload
|
||||
def __init__(self: BytesParser[Message[str, str]], _class: None = None, *, policy: Policy = ...) -> None: ...
|
||||
@overload
|
||||
def __init__(self, _class: Callable[[], _MessageT], *, policy: Policy = ...) -> None: ...
|
||||
def parse(self, fp: _WrappedBuffer, headersonly: bool = False) -> _MessageT: ...
|
||||
def parsebytes(self, text: bytes | bytearray, headersonly: bool = False) -> _MessageT: ...
|
||||
|
||||
class BytesHeaderParser(BytesParser[_MessageT]):
|
||||
def parse(self, fp: _WrappedBuffer, headersonly: bool = True) -> _MessageT: ...
|
||||
def parsebytes(self, text: bytes | bytearray, headersonly: bool = True) -> _MessageT: ...
|
||||
|
@ -15,65 +15,65 @@ class HTTPStatus(IntEnum):
|
||||
def phrase(self) -> str: ...
|
||||
@property
|
||||
def description(self) -> str: ...
|
||||
CONTINUE: int
|
||||
SWITCHING_PROTOCOLS: int
|
||||
PROCESSING: int
|
||||
OK: int
|
||||
CREATED: int
|
||||
ACCEPTED: int
|
||||
NON_AUTHORITATIVE_INFORMATION: int
|
||||
NO_CONTENT: int
|
||||
RESET_CONTENT: int
|
||||
PARTIAL_CONTENT: int
|
||||
MULTI_STATUS: int
|
||||
ALREADY_REPORTED: int
|
||||
IM_USED: int
|
||||
MULTIPLE_CHOICES: int
|
||||
MOVED_PERMANENTLY: int
|
||||
FOUND: int
|
||||
SEE_OTHER: int
|
||||
NOT_MODIFIED: int
|
||||
USE_PROXY: int
|
||||
TEMPORARY_REDIRECT: int
|
||||
PERMANENT_REDIRECT: int
|
||||
BAD_REQUEST: int
|
||||
UNAUTHORIZED: int
|
||||
PAYMENT_REQUIRED: int
|
||||
FORBIDDEN: int
|
||||
NOT_FOUND: int
|
||||
METHOD_NOT_ALLOWED: int
|
||||
NOT_ACCEPTABLE: int
|
||||
PROXY_AUTHENTICATION_REQUIRED: int
|
||||
REQUEST_TIMEOUT: int
|
||||
CONFLICT: int
|
||||
GONE: int
|
||||
LENGTH_REQUIRED: int
|
||||
PRECONDITION_FAILED: int
|
||||
REQUEST_ENTITY_TOO_LARGE: int
|
||||
REQUEST_URI_TOO_LONG: int
|
||||
UNSUPPORTED_MEDIA_TYPE: int
|
||||
REQUESTED_RANGE_NOT_SATISFIABLE: int
|
||||
EXPECTATION_FAILED: int
|
||||
UNPROCESSABLE_ENTITY: int
|
||||
LOCKED: int
|
||||
FAILED_DEPENDENCY: int
|
||||
UPGRADE_REQUIRED: int
|
||||
PRECONDITION_REQUIRED: int
|
||||
TOO_MANY_REQUESTS: int
|
||||
REQUEST_HEADER_FIELDS_TOO_LARGE: int
|
||||
INTERNAL_SERVER_ERROR: int
|
||||
NOT_IMPLEMENTED: int
|
||||
BAD_GATEWAY: int
|
||||
SERVICE_UNAVAILABLE: int
|
||||
GATEWAY_TIMEOUT: int
|
||||
HTTP_VERSION_NOT_SUPPORTED: int
|
||||
VARIANT_ALSO_NEGOTIATES: int
|
||||
INSUFFICIENT_STORAGE: int
|
||||
LOOP_DETECTED: int
|
||||
NOT_EXTENDED: int
|
||||
NETWORK_AUTHENTICATION_REQUIRED: int
|
||||
MISDIRECTED_REQUEST: int
|
||||
UNAVAILABLE_FOR_LEGAL_REASONS: int
|
||||
CONTINUE = 100
|
||||
SWITCHING_PROTOCOLS = 101
|
||||
PROCESSING = 102
|
||||
OK = 200
|
||||
CREATED = 201
|
||||
ACCEPTED = 202
|
||||
NON_AUTHORITATIVE_INFORMATION = 203
|
||||
NO_CONTENT = 204
|
||||
RESET_CONTENT = 205
|
||||
PARTIAL_CONTENT = 206
|
||||
MULTI_STATUS = 207
|
||||
ALREADY_REPORTED = 208
|
||||
IM_USED = 226
|
||||
MULTIPLE_CHOICES = 300
|
||||
MOVED_PERMANENTLY = 301
|
||||
FOUND = 302
|
||||
SEE_OTHER = 303
|
||||
NOT_MODIFIED = 304
|
||||
USE_PROXY = 305
|
||||
TEMPORARY_REDIRECT = 307
|
||||
PERMANENT_REDIRECT = 308
|
||||
BAD_REQUEST = 400
|
||||
UNAUTHORIZED = 401
|
||||
PAYMENT_REQUIRED = 402
|
||||
FORBIDDEN = 403
|
||||
NOT_FOUND = 404
|
||||
METHOD_NOT_ALLOWED = 405
|
||||
NOT_ACCEPTABLE = 406
|
||||
PROXY_AUTHENTICATION_REQUIRED = 407
|
||||
REQUEST_TIMEOUT = 408
|
||||
CONFLICT = 409
|
||||
GONE = 410
|
||||
LENGTH_REQUIRED = 411
|
||||
PRECONDITION_FAILED = 412
|
||||
REQUEST_ENTITY_TOO_LARGE = 413
|
||||
REQUEST_URI_TOO_LONG = 414
|
||||
UNSUPPORTED_MEDIA_TYPE = 415
|
||||
REQUESTED_RANGE_NOT_SATISFIABLE = 416
|
||||
EXPECTATION_FAILED = 417
|
||||
UNPROCESSABLE_ENTITY = 422
|
||||
LOCKED = 423
|
||||
FAILED_DEPENDENCY = 424
|
||||
UPGRADE_REQUIRED = 426
|
||||
PRECONDITION_REQUIRED = 428
|
||||
TOO_MANY_REQUESTS = 429
|
||||
REQUEST_HEADER_FIELDS_TOO_LARGE = 431
|
||||
INTERNAL_SERVER_ERROR = 500
|
||||
NOT_IMPLEMENTED = 501
|
||||
BAD_GATEWAY = 502
|
||||
SERVICE_UNAVAILABLE = 503
|
||||
GATEWAY_TIMEOUT = 504
|
||||
HTTP_VERSION_NOT_SUPPORTED = 505
|
||||
VARIANT_ALSO_NEGOTIATES = 506
|
||||
INSUFFICIENT_STORAGE = 507
|
||||
LOOP_DETECTED = 508
|
||||
NOT_EXTENDED = 510
|
||||
NETWORK_AUTHENTICATION_REQUIRED = 511
|
||||
MISDIRECTED_REQUEST = 421
|
||||
UNAVAILABLE_FOR_LEGAL_REASONS = 451
|
||||
if sys.version_info >= (3, 9):
|
||||
EARLY_HINTS: Literal[103]
|
||||
IM_A_TEAPOT: Literal[418]
|
||||
@ -94,12 +94,12 @@ if sys.version_info >= (3, 11):
|
||||
class HTTPMethod(StrEnum):
|
||||
@property
|
||||
def description(self) -> str: ...
|
||||
CONNECT: str
|
||||
DELETE: str
|
||||
GET: str
|
||||
HEAD: str
|
||||
OPTIONS: str
|
||||
PATCH: str
|
||||
POST: str
|
||||
PUT: str
|
||||
TRACE: str
|
||||
CONNECT = "CONNECT"
|
||||
DELETE = "DELETE"
|
||||
GET = "GET"
|
||||
HEAD = "HEAD"
|
||||
OPTIONS = "OPTIONS"
|
||||
PATCH = "PATCH"
|
||||
POST = "POST"
|
||||
PUT = "PUT"
|
||||
TRACE = "TRACE"
|
||||
|
@ -3,7 +3,7 @@ import io
|
||||
import ssl
|
||||
import sys
|
||||
import types
|
||||
from _typeshed import ReadableBuffer, SupportsRead, WriteableBuffer
|
||||
from _typeshed import ReadableBuffer, SupportsRead, SupportsReadline, WriteableBuffer
|
||||
from collections.abc import Callable, Iterable, Iterator, Mapping
|
||||
from socket import socket
|
||||
from typing import Any, BinaryIO, TypeVar, overload
|
||||
@ -33,6 +33,7 @@ __all__ = [
|
||||
|
||||
_DataType: TypeAlias = SupportsRead[bytes] | Iterable[ReadableBuffer] | ReadableBuffer
|
||||
_T = TypeVar("_T")
|
||||
_MessageT = TypeVar("_MessageT", bound=email.message.Message)
|
||||
|
||||
HTTP_PORT: int
|
||||
HTTPS_PORT: int
|
||||
@ -97,28 +98,13 @@ NETWORK_AUTHENTICATION_REQUIRED: int
|
||||
|
||||
responses: dict[int, str]
|
||||
|
||||
class HTTPMessage(email.message.Message):
|
||||
class HTTPMessage(email.message.Message[str, str]):
|
||||
def getallmatchingheaders(self, name: str) -> list[str]: ... # undocumented
|
||||
# override below all of Message's methods that use `_HeaderType` / `_HeaderTypeParam` with `str`
|
||||
# `HTTPMessage` breaks the Liskov substitution principle by only intending for `str` headers
|
||||
# This is easier than making `Message` generic
|
||||
def __getitem__(self, name: str) -> str | None: ...
|
||||
def __setitem__(self, name: str, val: str) -> None: ... # type: ignore[override]
|
||||
def values(self) -> list[str]: ...
|
||||
def items(self) -> list[tuple[str, str]]: ...
|
||||
@overload
|
||||
def get(self, name: str, failobj: None = None) -> str | None: ...
|
||||
@overload
|
||||
def get(self, name: str, failobj: _T) -> str | _T: ...
|
||||
@overload
|
||||
def get_all(self, name: str, failobj: None = None) -> list[str] | None: ...
|
||||
@overload
|
||||
def get_all(self, name: str, failobj: _T) -> list[str] | _T: ...
|
||||
def replace_header(self, _name: str, _value: str) -> None: ... # type: ignore[override]
|
||||
def set_raw(self, name: str, value: str) -> None: ... # type: ignore[override]
|
||||
def raw_items(self) -> Iterator[tuple[str, str]]: ...
|
||||
|
||||
def parse_headers(fp: io.BufferedIOBase, _class: Callable[[], email.message.Message] = ...) -> HTTPMessage: ...
|
||||
@overload
|
||||
def parse_headers(fp: SupportsReadline[bytes], _class: Callable[[], _MessageT]) -> _MessageT: ...
|
||||
@overload
|
||||
def parse_headers(fp: SupportsReadline[bytes]) -> HTTPMessage: ...
|
||||
|
||||
class HTTPResponse(io.BufferedIOBase, BinaryIO): # type: ignore[misc] # incompatible method definitions in the base classes
|
||||
msg: HTTPMessage
|
||||
|
@ -347,11 +347,11 @@ if sys.version_info >= (3, 10):
|
||||
|
||||
# The name is the same as the enum's name in CPython
|
||||
class _ParameterKind(enum.IntEnum):
|
||||
POSITIONAL_ONLY: int
|
||||
POSITIONAL_OR_KEYWORD: int
|
||||
VAR_POSITIONAL: int
|
||||
KEYWORD_ONLY: int
|
||||
VAR_KEYWORD: int
|
||||
POSITIONAL_ONLY = 0
|
||||
POSITIONAL_OR_KEYWORD = 1
|
||||
VAR_POSITIONAL = 2
|
||||
KEYWORD_ONLY = 3
|
||||
VAR_KEYWORD = 4
|
||||
|
||||
@property
|
||||
def description(self) -> str: ...
|
||||
@ -611,22 +611,22 @@ if sys.version_info >= (3, 9):
|
||||
|
||||
if sys.version_info >= (3, 12):
|
||||
class BufferFlags(enum.IntFlag):
|
||||
SIMPLE: int
|
||||
WRITABLE: int
|
||||
FORMAT: int
|
||||
ND: int
|
||||
STRIDES: int
|
||||
C_CONTIGUOUS: int
|
||||
F_CONTIGUOUS: int
|
||||
ANY_CONTIGUOUS: int
|
||||
INDIRECT: int
|
||||
CONTIG: int
|
||||
CONTIG_RO: int
|
||||
STRIDED: int
|
||||
STRIDED_RO: int
|
||||
RECORDS: int
|
||||
RECORDS_RO: int
|
||||
FULL: int
|
||||
FULL_RO: int
|
||||
READ: int
|
||||
WRITE: int
|
||||
SIMPLE = 0
|
||||
WRITABLE = 1
|
||||
FORMAT = 4
|
||||
ND = 8
|
||||
STRIDES = 24
|
||||
C_CONTIGUOUS = 56
|
||||
F_CONTIGUOUS = 88
|
||||
ANY_CONTIGUOUS = 152
|
||||
INDIRECT = 280
|
||||
CONTIG = 9
|
||||
CONTIG_RO = 8
|
||||
STRIDED = 25
|
||||
STRIDED_RO = 24
|
||||
RECORDS = 29
|
||||
RECORDS_RO = 28
|
||||
FULL = 285
|
||||
FULL_RO = 284
|
||||
READ = 256
|
||||
WRITE = 512
|
||||
|
@ -14,7 +14,7 @@ class Barrier(threading.Barrier):
|
||||
self, parties: int, action: Callable[[], object] | None = None, timeout: float | None = None, *ctx: BaseContext
|
||||
) -> None: ...
|
||||
|
||||
class Condition(AbstractContextManager[bool]):
|
||||
class Condition(AbstractContextManager[bool, None]):
|
||||
def __init__(self, lock: _LockLike | None = None, *, ctx: BaseContext) -> None: ...
|
||||
def notify(self, n: int = 1) -> None: ...
|
||||
def notify_all(self) -> None: ...
|
||||
@ -34,7 +34,7 @@ class Event:
|
||||
def wait(self, timeout: float | None = None) -> bool: ...
|
||||
|
||||
# Not part of public API
|
||||
class SemLock(AbstractContextManager[bool]):
|
||||
class SemLock(AbstractContextManager[bool, None]):
|
||||
def acquire(self, block: bool = ..., timeout: float | None = ...) -> bool: ...
|
||||
def release(self) -> None: ...
|
||||
def __exit__(
|
||||
|
@ -747,7 +747,7 @@ if sys.platform != "win32":
|
||||
|
||||
def getcwd() -> str: ...
|
||||
def getcwdb() -> bytes: ...
|
||||
def chmod(path: FileDescriptorOrPath, mode: int, *, dir_fd: int | None = None, follow_symlinks: bool = True) -> None: ...
|
||||
def chmod(path: FileDescriptorOrPath, mode: int, *, dir_fd: int | None = None, follow_symlinks: bool = ...) -> None: ...
|
||||
|
||||
if sys.platform != "win32" and sys.platform != "linux":
|
||||
def chflags(path: StrOrBytesPath, flags: int, follow_symlinks: bool = True) -> None: ... # some flavors of Unix
|
||||
@ -794,7 +794,7 @@ def replace(
|
||||
) -> None: ...
|
||||
def rmdir(path: StrOrBytesPath, *, dir_fd: int | None = None) -> None: ...
|
||||
|
||||
class _ScandirIterator(Iterator[DirEntry[AnyStr]], AbstractContextManager[_ScandirIterator[AnyStr]]):
|
||||
class _ScandirIterator(Iterator[DirEntry[AnyStr]], AbstractContextManager[_ScandirIterator[AnyStr], None]):
|
||||
def __next__(self) -> DirEntry[AnyStr]: ...
|
||||
def __exit__(self, *args: Unused) -> None: ...
|
||||
def close(self) -> None: ...
|
||||
|
@ -11,8 +11,8 @@ if sys.version_info < (3, 9):
|
||||
__all__ += ["readPlist", "writePlist", "readPlistFromBytes", "writePlistToBytes", "Data"]
|
||||
|
||||
class PlistFormat(Enum):
|
||||
FMT_XML: int
|
||||
FMT_BINARY: int
|
||||
FMT_XML = 1
|
||||
FMT_BINARY = 2
|
||||
|
||||
FMT_XML = PlistFormat.FMT_XML
|
||||
FMT_BINARY = PlistFormat.FMT_BINARY
|
||||
|
@ -14,15 +14,15 @@ else:
|
||||
_Selector: TypeAlias = str | float | int
|
||||
|
||||
class SortKey(StrEnum):
|
||||
CALLS: str
|
||||
CUMULATIVE: str
|
||||
FILENAME: str
|
||||
LINE: str
|
||||
NAME: str
|
||||
NFL: str
|
||||
PCALLS: str
|
||||
STDNAME: str
|
||||
TIME: str
|
||||
CALLS = "calls"
|
||||
CUMULATIVE = "cumulative"
|
||||
FILENAME = "filename"
|
||||
LINE = "line"
|
||||
NAME = "name"
|
||||
NFL = "nfl"
|
||||
PCALLS = "pcalls"
|
||||
STDNAME = "stdname"
|
||||
TIME = "time"
|
||||
|
||||
if sys.version_info >= (3, 9):
|
||||
from dataclasses import dataclass
|
||||
|
@ -12,9 +12,9 @@ class PyCompileError(Exception):
|
||||
def __init__(self, exc_type: type[BaseException], exc_value: BaseException, file: str, msg: str = "") -> None: ...
|
||||
|
||||
class PycInvalidationMode(enum.Enum):
|
||||
TIMESTAMP: int
|
||||
CHECKED_HASH: int
|
||||
UNCHECKED_HASH: int
|
||||
TIMESTAMP = 1
|
||||
CHECKED_HASH = 2
|
||||
UNCHECKED_HASH = 3
|
||||
|
||||
def _get_default_invalidation_mode() -> PycInvalidationMode: ...
|
||||
def compile(
|
||||
|
@ -9,57 +9,57 @@ from typing_extensions import Never, TypeAlias
|
||||
NSIG: int
|
||||
|
||||
class Signals(IntEnum):
|
||||
SIGABRT: int
|
||||
SIGFPE: int
|
||||
SIGILL: int
|
||||
SIGINT: int
|
||||
SIGSEGV: int
|
||||
SIGTERM: int
|
||||
SIGABRT = 6
|
||||
SIGFPE = 8
|
||||
SIGILL = 4
|
||||
SIGINT = 2
|
||||
SIGSEGV = 11
|
||||
SIGTERM = 15
|
||||
|
||||
if sys.platform == "win32":
|
||||
SIGBREAK: int
|
||||
CTRL_C_EVENT: int
|
||||
CTRL_BREAK_EVENT: int
|
||||
SIGBREAK = 21
|
||||
CTRL_C_EVENT = 0
|
||||
CTRL_BREAK_EVENT = 1
|
||||
else:
|
||||
SIGALRM: int
|
||||
SIGBUS: int
|
||||
SIGCHLD: int
|
||||
SIGCONT: int
|
||||
SIGHUP: int
|
||||
SIGIO: int
|
||||
SIGIOT: int
|
||||
SIGKILL: int
|
||||
SIGPIPE: int
|
||||
SIGPROF: int
|
||||
SIGQUIT: int
|
||||
SIGSTOP: int
|
||||
SIGSYS: int
|
||||
SIGTRAP: int
|
||||
SIGTSTP: int
|
||||
SIGTTIN: int
|
||||
SIGTTOU: int
|
||||
SIGURG: int
|
||||
SIGUSR1: int
|
||||
SIGUSR2: int
|
||||
SIGVTALRM: int
|
||||
SIGWINCH: int
|
||||
SIGXCPU: int
|
||||
SIGXFSZ: int
|
||||
SIGALRM = 14
|
||||
SIGBUS = 7
|
||||
SIGCHLD = 17
|
||||
SIGCONT = 18
|
||||
SIGHUP = 1
|
||||
SIGIO = 29
|
||||
SIGIOT = 6
|
||||
SIGKILL = 9
|
||||
SIGPIPE = 13
|
||||
SIGPROF = 27
|
||||
SIGQUIT = 3
|
||||
SIGSTOP = 19
|
||||
SIGSYS = 31
|
||||
SIGTRAP = 5
|
||||
SIGTSTP = 20
|
||||
SIGTTIN = 21
|
||||
SIGTTOU = 22
|
||||
SIGURG = 23
|
||||
SIGUSR1 = 10
|
||||
SIGUSR2 = 12
|
||||
SIGVTALRM = 26
|
||||
SIGWINCH = 28
|
||||
SIGXCPU = 24
|
||||
SIGXFSZ = 25
|
||||
if sys.platform != "linux":
|
||||
SIGEMT: int
|
||||
SIGINFO: int
|
||||
SIGEMT = 7
|
||||
SIGINFO = 29
|
||||
if sys.platform != "darwin":
|
||||
SIGCLD: int
|
||||
SIGPOLL: int
|
||||
SIGPWR: int
|
||||
SIGRTMAX: int
|
||||
SIGRTMIN: int
|
||||
SIGCLD = 17
|
||||
SIGPOLL = 29
|
||||
SIGPWR = 30
|
||||
SIGRTMAX = 64
|
||||
SIGRTMIN = 34
|
||||
if sys.version_info >= (3, 11):
|
||||
SIGSTKFLT: int
|
||||
SIGSTKFLT = 16
|
||||
|
||||
class Handlers(IntEnum):
|
||||
SIG_DFL: int
|
||||
SIG_IGN: int
|
||||
SIG_DFL = 0
|
||||
SIG_IGN = 1
|
||||
|
||||
SIG_DFL: Handlers
|
||||
SIG_IGN: Handlers
|
||||
@ -123,9 +123,9 @@ else:
|
||||
ITIMER_VIRTUAL: int
|
||||
|
||||
class Sigmasks(IntEnum):
|
||||
SIG_BLOCK: int
|
||||
SIG_UNBLOCK: int
|
||||
SIG_SETMASK: int
|
||||
SIG_BLOCK = 0
|
||||
SIG_UNBLOCK = 1
|
||||
SIG_SETMASK = 2
|
||||
|
||||
SIG_BLOCK = Sigmasks.SIG_BLOCK
|
||||
SIG_UNBLOCK = Sigmasks.SIG_UNBLOCK
|
||||
|
@ -480,51 +480,51 @@ EAGAIN: int
|
||||
EWOULDBLOCK: int
|
||||
|
||||
class AddressFamily(IntEnum):
|
||||
AF_INET: int
|
||||
AF_INET6: int
|
||||
AF_APPLETALK: int
|
||||
AF_DECnet: int
|
||||
AF_IPX: int
|
||||
AF_SNA: int
|
||||
AF_UNSPEC: int
|
||||
AF_INET = 2
|
||||
AF_INET6 = 10
|
||||
AF_APPLETALK = 5
|
||||
AF_DECnet = ...
|
||||
AF_IPX = 4
|
||||
AF_SNA = 22
|
||||
AF_UNSPEC = 0
|
||||
if sys.platform != "darwin":
|
||||
AF_IRDA: int
|
||||
AF_IRDA = 23
|
||||
if sys.platform != "win32":
|
||||
AF_ROUTE: int
|
||||
AF_SYSTEM: int
|
||||
AF_UNIX: int
|
||||
AF_ROUTE = 16
|
||||
AF_SYSTEM = 32
|
||||
AF_UNIX = 1
|
||||
if sys.platform != "win32" and sys.platform != "darwin":
|
||||
AF_AAL5: int
|
||||
AF_ASH: int
|
||||
AF_ATMPVC: int
|
||||
AF_ATMSVC: int
|
||||
AF_AX25: int
|
||||
AF_BRIDGE: int
|
||||
AF_ECONET: int
|
||||
AF_KEY: int
|
||||
AF_LLC: int
|
||||
AF_NETBEUI: int
|
||||
AF_NETROM: int
|
||||
AF_PPPOX: int
|
||||
AF_ROSE: int
|
||||
AF_SECURITY: int
|
||||
AF_WANPIPE: int
|
||||
AF_X25: int
|
||||
AF_AAL5 = ...
|
||||
AF_ASH = 18
|
||||
AF_ATMPVC = 8
|
||||
AF_ATMSVC = 20
|
||||
AF_AX25 = 3
|
||||
AF_BRIDGE = 7
|
||||
AF_ECONET = 19
|
||||
AF_KEY = 15
|
||||
AF_LLC = 26
|
||||
AF_NETBEUI = 13
|
||||
AF_NETROM = 6
|
||||
AF_PPPOX = 24
|
||||
AF_ROSE = 11
|
||||
AF_SECURITY = 14
|
||||
AF_WANPIPE = 25
|
||||
AF_X25 = 9
|
||||
if sys.platform == "linux":
|
||||
AF_CAN: int
|
||||
AF_PACKET: int
|
||||
AF_RDS: int
|
||||
AF_TIPC: int
|
||||
AF_ALG: int
|
||||
AF_NETLINK: int
|
||||
AF_VSOCK: int
|
||||
AF_QIPCRTR: int
|
||||
AF_CAN = 29
|
||||
AF_PACKET = 17
|
||||
AF_RDS = 21
|
||||
AF_TIPC = 30
|
||||
AF_ALG = 38
|
||||
AF_NETLINK = 16
|
||||
AF_VSOCK = 40
|
||||
AF_QIPCRTR = 42
|
||||
if sys.platform != "win32" or sys.version_info >= (3, 9):
|
||||
AF_LINK: int
|
||||
AF_LINK = 33
|
||||
if sys.platform != "darwin":
|
||||
AF_BLUETOOTH: int
|
||||
AF_BLUETOOTH = 32
|
||||
if sys.platform == "win32" and sys.version_info >= (3, 12):
|
||||
AF_HYPERV: int
|
||||
AF_HYPERV = 34
|
||||
|
||||
AF_INET = AddressFamily.AF_INET
|
||||
AF_INET6 = AddressFamily.AF_INET6
|
||||
@ -579,14 +579,14 @@ if sys.platform == "win32" and sys.version_info >= (3, 12):
|
||||
AF_HYPERV = AddressFamily.AF_HYPERV
|
||||
|
||||
class SocketKind(IntEnum):
|
||||
SOCK_STREAM: int
|
||||
SOCK_DGRAM: int
|
||||
SOCK_RAW: int
|
||||
SOCK_RDM: int
|
||||
SOCK_SEQPACKET: int
|
||||
SOCK_STREAM = 1
|
||||
SOCK_DGRAM = 2
|
||||
SOCK_RAW = 3
|
||||
SOCK_RDM = 4
|
||||
SOCK_SEQPACKET = 5
|
||||
if sys.platform == "linux":
|
||||
SOCK_CLOEXEC: int
|
||||
SOCK_NONBLOCK: int
|
||||
SOCK_CLOEXEC = 524288
|
||||
SOCK_NONBLOCK = 2048
|
||||
|
||||
SOCK_STREAM = SocketKind.SOCK_STREAM
|
||||
SOCK_DGRAM = SocketKind.SOCK_DGRAM
|
||||
@ -598,32 +598,32 @@ if sys.platform == "linux":
|
||||
SOCK_NONBLOCK = SocketKind.SOCK_NONBLOCK
|
||||
|
||||
class MsgFlag(IntFlag):
|
||||
MSG_CTRUNC: int
|
||||
MSG_DONTROUTE: int
|
||||
MSG_OOB: int
|
||||
MSG_PEEK: int
|
||||
MSG_TRUNC: int
|
||||
MSG_WAITALL: int
|
||||
MSG_CTRUNC = 8
|
||||
MSG_DONTROUTE = 4
|
||||
MSG_OOB = 1
|
||||
MSG_PEEK = 2
|
||||
MSG_TRUNC = 32
|
||||
MSG_WAITALL = 256
|
||||
|
||||
if sys.platform != "darwin":
|
||||
MSG_BCAST: int
|
||||
MSG_MCAST: int
|
||||
MSG_ERRQUEUE: int
|
||||
MSG_BCAST = 1024
|
||||
MSG_MCAST = 2048
|
||||
MSG_ERRQUEUE = 8192
|
||||
|
||||
if sys.platform != "win32" and sys.platform != "darwin":
|
||||
MSG_BTAG: int
|
||||
MSG_CMSG_CLOEXEC: int
|
||||
MSG_CONFIRM: int
|
||||
MSG_ETAG: int
|
||||
MSG_FASTOPEN: int
|
||||
MSG_MORE: int
|
||||
MSG_NOTIFICATION: int
|
||||
MSG_BTAG = ...
|
||||
MSG_CMSG_CLOEXEC = 1073741821
|
||||
MSG_CONFIRM = 2048
|
||||
MSG_ETAG = ...
|
||||
MSG_FASTOPEN = 536870912
|
||||
MSG_MORE = 32768
|
||||
MSG_NOTIFICATION = ...
|
||||
|
||||
if sys.platform != "win32":
|
||||
MSG_DONTWAIT: int
|
||||
MSG_EOF: int
|
||||
MSG_EOR: int
|
||||
MSG_NOSIGNAL: int # sometimes this exists on darwin, sometimes not
|
||||
MSG_DONTWAIT = 64
|
||||
MSG_EOF = 256
|
||||
MSG_EOR = 128
|
||||
MSG_NOSIGNAL = 16384 # sometimes this exists on darwin, sometimes not
|
||||
|
||||
MSG_CTRUNC = MsgFlag.MSG_CTRUNC
|
||||
MSG_DONTROUTE = MsgFlag.MSG_DONTROUTE
|
||||
@ -653,17 +653,17 @@ if sys.platform != "win32" and sys.platform != "darwin":
|
||||
MSG_NOTIFICATION = MsgFlag.MSG_NOTIFICATION
|
||||
|
||||
class AddressInfo(IntFlag):
|
||||
AI_ADDRCONFIG: int
|
||||
AI_ALL: int
|
||||
AI_CANONNAME: int
|
||||
AI_NUMERICHOST: int
|
||||
AI_NUMERICSERV: int
|
||||
AI_PASSIVE: int
|
||||
AI_V4MAPPED: int
|
||||
AI_ADDRCONFIG = 32
|
||||
AI_ALL = 16
|
||||
AI_CANONNAME = 2
|
||||
AI_NUMERICHOST = 4
|
||||
AI_NUMERICSERV = 1024
|
||||
AI_PASSIVE = 1
|
||||
AI_V4MAPPED = 8
|
||||
if sys.platform != "win32":
|
||||
AI_DEFAULT: int
|
||||
AI_MASK: int
|
||||
AI_V4MAPPED_CFG: int
|
||||
AI_DEFAULT = 1536
|
||||
AI_MASK = 5127
|
||||
AI_V4MAPPED_CFG = 512
|
||||
|
||||
AI_ADDRCONFIG = AddressInfo.AI_ADDRCONFIG
|
||||
AI_ALL = AddressInfo.AI_ALL
|
||||
|
@ -138,23 +138,23 @@ if sys.platform == "win32":
|
||||
def enum_crls(store_name: str) -> _EnumRetType: ...
|
||||
|
||||
class VerifyMode(enum.IntEnum):
|
||||
CERT_NONE: int
|
||||
CERT_OPTIONAL: int
|
||||
CERT_REQUIRED: int
|
||||
CERT_NONE = 0
|
||||
CERT_OPTIONAL = 1
|
||||
CERT_REQUIRED = 2
|
||||
|
||||
CERT_NONE: VerifyMode
|
||||
CERT_OPTIONAL: VerifyMode
|
||||
CERT_REQUIRED: VerifyMode
|
||||
|
||||
class VerifyFlags(enum.IntFlag):
|
||||
VERIFY_DEFAULT: int
|
||||
VERIFY_CRL_CHECK_LEAF: int
|
||||
VERIFY_CRL_CHECK_CHAIN: int
|
||||
VERIFY_X509_STRICT: int
|
||||
VERIFY_X509_TRUSTED_FIRST: int
|
||||
VERIFY_DEFAULT = 0
|
||||
VERIFY_CRL_CHECK_LEAF = 4
|
||||
VERIFY_CRL_CHECK_CHAIN = 12
|
||||
VERIFY_X509_STRICT = 32
|
||||
VERIFY_X509_TRUSTED_FIRST = 32768
|
||||
if sys.version_info >= (3, 10):
|
||||
VERIFY_ALLOW_PROXY_CERTS: int
|
||||
VERIFY_X509_PARTIAL_CHAIN: int
|
||||
VERIFY_ALLOW_PROXY_CERTS = 64
|
||||
VERIFY_X509_PARTIAL_CHAIN = 524288
|
||||
|
||||
VERIFY_DEFAULT: VerifyFlags
|
||||
VERIFY_CRL_CHECK_LEAF: VerifyFlags
|
||||
@ -167,15 +167,15 @@ if sys.version_info >= (3, 10):
|
||||
VERIFY_X509_PARTIAL_CHAIN: VerifyFlags
|
||||
|
||||
class _SSLMethod(enum.IntEnum):
|
||||
PROTOCOL_SSLv23: int
|
||||
PROTOCOL_SSLv2: int
|
||||
PROTOCOL_SSLv3: int
|
||||
PROTOCOL_TLSv1: int
|
||||
PROTOCOL_TLSv1_1: int
|
||||
PROTOCOL_TLSv1_2: int
|
||||
PROTOCOL_TLS: int
|
||||
PROTOCOL_TLS_CLIENT: int
|
||||
PROTOCOL_TLS_SERVER: int
|
||||
PROTOCOL_SSLv23 = 2
|
||||
PROTOCOL_SSLv2 = ...
|
||||
PROTOCOL_SSLv3 = ...
|
||||
PROTOCOL_TLSv1 = 3
|
||||
PROTOCOL_TLSv1_1 = 4
|
||||
PROTOCOL_TLSv1_2 = 5
|
||||
PROTOCOL_TLS = 2
|
||||
PROTOCOL_TLS_CLIENT = 16
|
||||
PROTOCOL_TLS_SERVER = 17
|
||||
|
||||
PROTOCOL_SSLv23: _SSLMethod
|
||||
PROTOCOL_SSLv2: _SSLMethod
|
||||
@ -188,25 +188,25 @@ PROTOCOL_TLS_CLIENT: _SSLMethod
|
||||
PROTOCOL_TLS_SERVER: _SSLMethod
|
||||
|
||||
class Options(enum.IntFlag):
|
||||
OP_ALL: int
|
||||
OP_NO_SSLv2: int
|
||||
OP_NO_SSLv3: int
|
||||
OP_NO_TLSv1: int
|
||||
OP_NO_TLSv1_1: int
|
||||
OP_NO_TLSv1_2: int
|
||||
OP_NO_TLSv1_3: int
|
||||
OP_CIPHER_SERVER_PREFERENCE: int
|
||||
OP_SINGLE_DH_USE: int
|
||||
OP_SINGLE_ECDH_USE: int
|
||||
OP_NO_COMPRESSION: int
|
||||
OP_NO_TICKET: int
|
||||
OP_NO_RENEGOTIATION: int
|
||||
OP_ENABLE_MIDDLEBOX_COMPAT: int
|
||||
OP_ALL = 2147483728
|
||||
OP_NO_SSLv2 = 0
|
||||
OP_NO_SSLv3 = 33554432
|
||||
OP_NO_TLSv1 = 67108864
|
||||
OP_NO_TLSv1_1 = 268435456
|
||||
OP_NO_TLSv1_2 = 134217728
|
||||
OP_NO_TLSv1_3 = 536870912
|
||||
OP_CIPHER_SERVER_PREFERENCE = 4194304
|
||||
OP_SINGLE_DH_USE = 0
|
||||
OP_SINGLE_ECDH_USE = 0
|
||||
OP_NO_COMPRESSION = 131072
|
||||
OP_NO_TICKET = 16384
|
||||
OP_NO_RENEGOTIATION = 1073741824
|
||||
OP_ENABLE_MIDDLEBOX_COMPAT = 1048576
|
||||
if sys.version_info >= (3, 12):
|
||||
OP_LEGACY_SERVER_CONNECT: int
|
||||
OP_ENABLE_KTLS: int
|
||||
OP_LEGACY_SERVER_CONNECT = 4
|
||||
OP_ENABLE_KTLS = 8
|
||||
if sys.version_info >= (3, 11) or sys.platform == "linux":
|
||||
OP_IGNORE_UNEXPECTED_EOF: int
|
||||
OP_IGNORE_UNEXPECTED_EOF = 128
|
||||
|
||||
OP_ALL: Options
|
||||
OP_NO_SSLv2: Options
|
||||
@ -246,33 +246,33 @@ OPENSSL_VERSION_INFO: tuple[int, int, int, int, int]
|
||||
OPENSSL_VERSION_NUMBER: int
|
||||
|
||||
class AlertDescription(enum.IntEnum):
|
||||
ALERT_DESCRIPTION_ACCESS_DENIED: int
|
||||
ALERT_DESCRIPTION_BAD_CERTIFICATE: int
|
||||
ALERT_DESCRIPTION_BAD_CERTIFICATE_HASH_VALUE: int
|
||||
ALERT_DESCRIPTION_BAD_CERTIFICATE_STATUS_RESPONSE: int
|
||||
ALERT_DESCRIPTION_BAD_RECORD_MAC: int
|
||||
ALERT_DESCRIPTION_CERTIFICATE_EXPIRED: int
|
||||
ALERT_DESCRIPTION_CERTIFICATE_REVOKED: int
|
||||
ALERT_DESCRIPTION_CERTIFICATE_UNKNOWN: int
|
||||
ALERT_DESCRIPTION_CERTIFICATE_UNOBTAINABLE: int
|
||||
ALERT_DESCRIPTION_CLOSE_NOTIFY: int
|
||||
ALERT_DESCRIPTION_DECODE_ERROR: int
|
||||
ALERT_DESCRIPTION_DECOMPRESSION_FAILURE: int
|
||||
ALERT_DESCRIPTION_DECRYPT_ERROR: int
|
||||
ALERT_DESCRIPTION_HANDSHAKE_FAILURE: int
|
||||
ALERT_DESCRIPTION_ILLEGAL_PARAMETER: int
|
||||
ALERT_DESCRIPTION_INSUFFICIENT_SECURITY: int
|
||||
ALERT_DESCRIPTION_INTERNAL_ERROR: int
|
||||
ALERT_DESCRIPTION_NO_RENEGOTIATION: int
|
||||
ALERT_DESCRIPTION_PROTOCOL_VERSION: int
|
||||
ALERT_DESCRIPTION_RECORD_OVERFLOW: int
|
||||
ALERT_DESCRIPTION_UNEXPECTED_MESSAGE: int
|
||||
ALERT_DESCRIPTION_UNKNOWN_CA: int
|
||||
ALERT_DESCRIPTION_UNKNOWN_PSK_IDENTITY: int
|
||||
ALERT_DESCRIPTION_UNRECOGNIZED_NAME: int
|
||||
ALERT_DESCRIPTION_UNSUPPORTED_CERTIFICATE: int
|
||||
ALERT_DESCRIPTION_UNSUPPORTED_EXTENSION: int
|
||||
ALERT_DESCRIPTION_USER_CANCELLED: int
|
||||
ALERT_DESCRIPTION_ACCESS_DENIED = 49
|
||||
ALERT_DESCRIPTION_BAD_CERTIFICATE = 42
|
||||
ALERT_DESCRIPTION_BAD_CERTIFICATE_HASH_VALUE = 114
|
||||
ALERT_DESCRIPTION_BAD_CERTIFICATE_STATUS_RESPONSE = 113
|
||||
ALERT_DESCRIPTION_BAD_RECORD_MAC = 20
|
||||
ALERT_DESCRIPTION_CERTIFICATE_EXPIRED = 45
|
||||
ALERT_DESCRIPTION_CERTIFICATE_REVOKED = 44
|
||||
ALERT_DESCRIPTION_CERTIFICATE_UNKNOWN = 46
|
||||
ALERT_DESCRIPTION_CERTIFICATE_UNOBTAINABLE = 111
|
||||
ALERT_DESCRIPTION_CLOSE_NOTIFY = 0
|
||||
ALERT_DESCRIPTION_DECODE_ERROR = 50
|
||||
ALERT_DESCRIPTION_DECOMPRESSION_FAILURE = 30
|
||||
ALERT_DESCRIPTION_DECRYPT_ERROR = 51
|
||||
ALERT_DESCRIPTION_HANDSHAKE_FAILURE = 40
|
||||
ALERT_DESCRIPTION_ILLEGAL_PARAMETER = 47
|
||||
ALERT_DESCRIPTION_INSUFFICIENT_SECURITY = 71
|
||||
ALERT_DESCRIPTION_INTERNAL_ERROR = 80
|
||||
ALERT_DESCRIPTION_NO_RENEGOTIATION = 100
|
||||
ALERT_DESCRIPTION_PROTOCOL_VERSION = 70
|
||||
ALERT_DESCRIPTION_RECORD_OVERFLOW = 22
|
||||
ALERT_DESCRIPTION_UNEXPECTED_MESSAGE = 10
|
||||
ALERT_DESCRIPTION_UNKNOWN_CA = 48
|
||||
ALERT_DESCRIPTION_UNKNOWN_PSK_IDENTITY = 115
|
||||
ALERT_DESCRIPTION_UNRECOGNIZED_NAME = 112
|
||||
ALERT_DESCRIPTION_UNSUPPORTED_CERTIFICATE = 43
|
||||
ALERT_DESCRIPTION_UNSUPPORTED_EXTENSION = 110
|
||||
ALERT_DESCRIPTION_USER_CANCELLED = 90
|
||||
|
||||
ALERT_DESCRIPTION_HANDSHAKE_FAILURE: AlertDescription
|
||||
ALERT_DESCRIPTION_INTERNAL_ERROR: AlertDescription
|
||||
@ -316,8 +316,8 @@ class _ASN1Object(_ASN1ObjectBase):
|
||||
def fromname(cls, name: str) -> Self: ...
|
||||
|
||||
class Purpose(_ASN1Object, enum.Enum):
|
||||
SERVER_AUTH: _ASN1Object
|
||||
CLIENT_AUTH: _ASN1Object
|
||||
SERVER_AUTH = (129, "serverAuth", "TLS Web Server Authentication", "1.3.6.1.5.5.7.3.2") # pyright: ignore[reportCallIssue]
|
||||
CLIENT_AUTH = (130, "clientAuth", "TLS Web Client Authentication", "1.3.6.1.5.5.7.3.1") # pyright: ignore[reportCallIssue]
|
||||
|
||||
class SSLSocket(socket.socket):
|
||||
context: SSLContext
|
||||
@ -371,13 +371,13 @@ class SSLSocket(socket.socket):
|
||||
def get_unverified_chain(self) -> list[bytes]: ...
|
||||
|
||||
class TLSVersion(enum.IntEnum):
|
||||
MINIMUM_SUPPORTED: int
|
||||
MAXIMUM_SUPPORTED: int
|
||||
SSLv3: int
|
||||
TLSv1: int
|
||||
TLSv1_1: int
|
||||
TLSv1_2: int
|
||||
TLSv1_3: int
|
||||
MINIMUM_SUPPORTED = -2
|
||||
MAXIMUM_SUPPORTED = -1
|
||||
SSLv3 = 768
|
||||
TLSv1 = 769
|
||||
TLSv1_1 = 770
|
||||
TLSv1_2 = 771
|
||||
TLSv1_3 = 772
|
||||
|
||||
class SSLContext:
|
||||
check_hostname: bool
|
||||
@ -506,15 +506,15 @@ class SSLSession:
|
||||
def __eq__(self, value: object, /) -> bool: ...
|
||||
|
||||
class SSLErrorNumber(enum.IntEnum):
|
||||
SSL_ERROR_EOF: int
|
||||
SSL_ERROR_INVALID_ERROR_CODE: int
|
||||
SSL_ERROR_SSL: int
|
||||
SSL_ERROR_SYSCALL: int
|
||||
SSL_ERROR_WANT_CONNECT: int
|
||||
SSL_ERROR_WANT_READ: int
|
||||
SSL_ERROR_WANT_WRITE: int
|
||||
SSL_ERROR_WANT_X509_LOOKUP: int
|
||||
SSL_ERROR_ZERO_RETURN: int
|
||||
SSL_ERROR_EOF = 8
|
||||
SSL_ERROR_INVALID_ERROR_CODE = 10
|
||||
SSL_ERROR_SSL = 1
|
||||
SSL_ERROR_SYSCALL = 5
|
||||
SSL_ERROR_WANT_CONNECT = 7
|
||||
SSL_ERROR_WANT_READ = 2
|
||||
SSL_ERROR_WANT_WRITE = 3
|
||||
SSL_ERROR_WANT_X509_LOOKUP = 4
|
||||
SSL_ERROR_ZERO_RETURN = 6
|
||||
|
||||
SSL_ERROR_EOF: SSLErrorNumber # undocumented
|
||||
SSL_ERROR_INVALID_ERROR_CODE: SSLErrorNumber # undocumented
|
||||
|
@ -194,45 +194,45 @@ if sys.version_info >= (3, 11):
|
||||
serial: int
|
||||
|
||||
class EventType(StrEnum):
|
||||
Activate: str
|
||||
ButtonPress: str
|
||||
Activate = "36"
|
||||
ButtonPress = "4"
|
||||
Button = ButtonPress
|
||||
ButtonRelease: str
|
||||
Circulate: str
|
||||
CirculateRequest: str
|
||||
ClientMessage: str
|
||||
Colormap: str
|
||||
Configure: str
|
||||
ConfigureRequest: str
|
||||
Create: str
|
||||
Deactivate: str
|
||||
Destroy: str
|
||||
Enter: str
|
||||
Expose: str
|
||||
FocusIn: str
|
||||
FocusOut: str
|
||||
GraphicsExpose: str
|
||||
Gravity: str
|
||||
KeyPress: str
|
||||
Key = KeyPress
|
||||
KeyRelease: str
|
||||
Keymap: str
|
||||
Leave: str
|
||||
Map: str
|
||||
MapRequest: str
|
||||
Mapping: str
|
||||
Motion: str
|
||||
MouseWheel: str
|
||||
NoExpose: str
|
||||
Property: str
|
||||
Reparent: str
|
||||
ResizeRequest: str
|
||||
Selection: str
|
||||
SelectionClear: str
|
||||
SelectionRequest: str
|
||||
Unmap: str
|
||||
VirtualEvent: str
|
||||
Visibility: str
|
||||
ButtonRelease = "5"
|
||||
Circulate = "26"
|
||||
CirculateRequest = "27"
|
||||
ClientMessage = "33"
|
||||
Colormap = "32"
|
||||
Configure = "22"
|
||||
ConfigureRequest = "23"
|
||||
Create = "16"
|
||||
Deactivate = "37"
|
||||
Destroy = "17"
|
||||
Enter = "7"
|
||||
Expose = "12"
|
||||
FocusIn = "9"
|
||||
FocusOut = "10"
|
||||
GraphicsExpose = "13"
|
||||
Gravity = "24"
|
||||
KeyPress = "2"
|
||||
Key = "2"
|
||||
KeyRelease = "3"
|
||||
Keymap = "11"
|
||||
Leave = "8"
|
||||
Map = "19"
|
||||
MapRequest = "20"
|
||||
Mapping = "34"
|
||||
Motion = "6"
|
||||
MouseWheel = "38"
|
||||
NoExpose = "14"
|
||||
Property = "28"
|
||||
Reparent = "21"
|
||||
ResizeRequest = "25"
|
||||
Selection = "31"
|
||||
SelectionClear = "29"
|
||||
SelectionRequest = "30"
|
||||
Unmap = "18"
|
||||
VirtualEvent = "35"
|
||||
Visibility = "15"
|
||||
|
||||
_W = TypeVar("_W", bound=Misc)
|
||||
# Events considered covariant because you should never assign to event.widget.
|
||||
|
@ -129,12 +129,6 @@ if sys.version_info >= (3, 11):
|
||||
if sys.version_info >= (3, 12):
|
||||
__all__ += ["TypeAliasType", "override"]
|
||||
|
||||
ContextManager = AbstractContextManager
|
||||
AsyncContextManager = AbstractAsyncContextManager
|
||||
|
||||
# This itself is only available during type checking
|
||||
def type_check_only(func_or_cls: _F) -> _F: ...
|
||||
|
||||
Any = object()
|
||||
|
||||
def final(f: _T) -> _T: ...
|
||||
@ -183,12 +177,6 @@ class _SpecialForm:
|
||||
def __or__(self, other: Any) -> _SpecialForm: ...
|
||||
def __ror__(self, other: Any) -> _SpecialForm: ...
|
||||
|
||||
_F = TypeVar("_F", bound=Callable[..., Any])
|
||||
_P = _ParamSpec("_P")
|
||||
_T = TypeVar("_T")
|
||||
|
||||
def overload(func: _F) -> _F: ...
|
||||
|
||||
Union: _SpecialForm
|
||||
Generic: _SpecialForm
|
||||
# Protocol is only present in 3.8 and later, but mypy needs it unconditionally
|
||||
@ -290,11 +278,15 @@ if sys.version_info >= (3, 10):
|
||||
|
||||
def __or__(self, other: Any) -> _SpecialForm: ...
|
||||
def __ror__(self, other: Any) -> _SpecialForm: ...
|
||||
__supertype__: type
|
||||
__supertype__: type | NewType
|
||||
|
||||
else:
|
||||
def NewType(name: str, tp: Any) -> Any: ...
|
||||
|
||||
_F = TypeVar("_F", bound=Callable[..., Any])
|
||||
_P = _ParamSpec("_P")
|
||||
_T = TypeVar("_T")
|
||||
|
||||
# These type variables are used by the container types.
|
||||
_S = TypeVar("_S")
|
||||
_KT = TypeVar("_KT") # Key type.
|
||||
@ -304,9 +296,13 @@ _KT_co = TypeVar("_KT_co", covariant=True) # Key type covariant containers.
|
||||
_VT_co = TypeVar("_VT_co", covariant=True) # Value type covariant containers.
|
||||
_TC = TypeVar("_TC", bound=type[object])
|
||||
|
||||
def overload(func: _F) -> _F: ...
|
||||
def no_type_check(arg: _F) -> _F: ...
|
||||
def no_type_check_decorator(decorator: Callable[_P, _T]) -> Callable[_P, _T]: ...
|
||||
|
||||
# This itself is only available during type checking
|
||||
def type_check_only(func_or_cls: _F) -> _F: ...
|
||||
|
||||
# Type aliases and type constructors
|
||||
|
||||
class _Alias:
|
||||
@ -432,6 +428,18 @@ class Generator(Iterator[_YieldT_co], Generic[_YieldT_co, _SendT_contra, _Return
|
||||
@property
|
||||
def gi_yieldfrom(self) -> Generator[Any, Any, Any] | None: ...
|
||||
|
||||
# NOTE: Technically we would like this to be able to accept a second parameter as well, just
|
||||
# like it's counterpart in contextlib, however `typing._SpecialGenericAlias` enforces the
|
||||
# correct number of arguments at runtime, so we would be hiding runtime errors.
|
||||
@runtime_checkable
|
||||
class ContextManager(AbstractContextManager[_T_co, bool | None], Protocol[_T_co]): ...
|
||||
|
||||
# NOTE: Technically we would like this to be able to accept a second parameter as well, just
|
||||
# like it's counterpart in contextlib, however `typing._SpecialGenericAlias` enforces the
|
||||
# correct number of arguments at runtime, so we would be hiding runtime errors.
|
||||
@runtime_checkable
|
||||
class AsyncContextManager(AbstractAsyncContextManager[_T_co, bool | None], Protocol[_T_co]): ...
|
||||
|
||||
@runtime_checkable
|
||||
class Awaitable(Protocol[_T_co]):
|
||||
@abstractmethod
|
||||
@ -445,7 +453,7 @@ class Coroutine(Awaitable[_ReturnT_co], Generic[_YieldT_co, _SendT_contra, _Retu
|
||||
@property
|
||||
def cr_code(self) -> CodeType: ...
|
||||
@property
|
||||
def cr_frame(self) -> FrameType: ...
|
||||
def cr_frame(self) -> FrameType | None: ...
|
||||
@property
|
||||
def cr_running(self) -> bool: ...
|
||||
@abstractmethod
|
||||
|
@ -374,7 +374,7 @@ else:
|
||||
class NewType:
|
||||
def __init__(self, name: str, tp: Any) -> None: ...
|
||||
def __call__(self, obj: _T, /) -> _T: ...
|
||||
__supertype__: type
|
||||
__supertype__: type | NewType
|
||||
if sys.version_info >= (3, 10):
|
||||
def __or__(self, other: Any) -> _SpecialForm: ...
|
||||
def __ror__(self, other: Any) -> _SpecialForm: ...
|
||||
|
@ -7,9 +7,9 @@ from typing_extensions import TypeAlias
|
||||
_FieldsType: TypeAlias = tuple[int, int, int, int, int, int]
|
||||
|
||||
class SafeUUID(Enum):
|
||||
safe: int
|
||||
unsafe: int
|
||||
unknown: None
|
||||
safe = 0
|
||||
unsafe = -1
|
||||
unknown = None
|
||||
|
||||
class UUID:
|
||||
def __init__(
|
||||
|
@ -1,6 +1,7 @@
|
||||
import sys
|
||||
from _typeshed import ReadableBuffer, Unused
|
||||
from types import TracebackType
|
||||
from typing import Any, Literal, final
|
||||
from typing import Any, Final, Literal, final, overload
|
||||
from typing_extensions import Self, TypeAlias
|
||||
|
||||
if sys.platform == "win32":
|
||||
@ -24,12 +25,40 @@ if sys.platform == "win32":
|
||||
def QueryValueEx(key: _KeyType, name: str, /) -> tuple[Any, int]: ...
|
||||
def SaveKey(key: _KeyType, file_name: str, /) -> None: ...
|
||||
def SetValue(key: _KeyType, sub_key: str, type: int, value: str, /) -> None: ...
|
||||
@overload # type=REG_DWORD|REG_QWORD
|
||||
def SetValueEx(
|
||||
key: _KeyType, value_name: str | None, reserved: Any, type: int, value: str | int, /
|
||||
) -> None: ... # reserved is ignored
|
||||
key: _KeyType, value_name: str | None, reserved: Unused, type: Literal[4, 5], value: int | None, /
|
||||
) -> None: ...
|
||||
@overload # type=REG_SZ|REG_EXPAND_SZ
|
||||
def SetValueEx(
|
||||
key: _KeyType, value_name: str | None, reserved: Unused, type: Literal[1, 2], value: str | None, /
|
||||
) -> None: ...
|
||||
@overload # type=REG_MULTI_SZ
|
||||
def SetValueEx(
|
||||
key: _KeyType, value_name: str | None, reserved: Unused, type: Literal[7], value: list[str] | None, /
|
||||
) -> None: ...
|
||||
@overload # type=REG_BINARY and everything else
|
||||
def SetValueEx(
|
||||
key: _KeyType,
|
||||
value_name: str | None,
|
||||
reserved: Unused,
|
||||
type: Literal[0, 3, 8, 9, 10, 11],
|
||||
value: ReadableBuffer | None,
|
||||
/,
|
||||
) -> None: ...
|
||||
@overload # Unknown or undocumented
|
||||
def SetValueEx(
|
||||
key: _KeyType,
|
||||
value_name: str | None,
|
||||
reserved: Unused,
|
||||
type: int,
|
||||
value: int | str | list[str] | ReadableBuffer | None,
|
||||
/,
|
||||
) -> None: ...
|
||||
def DisableReflectionKey(key: _KeyType, /) -> None: ...
|
||||
def EnableReflectionKey(key: _KeyType, /) -> None: ...
|
||||
def QueryReflectionKey(key: _KeyType, /) -> bool: ...
|
||||
|
||||
HKEY_CLASSES_ROOT: int
|
||||
HKEY_CURRENT_USER: int
|
||||
HKEY_LOCAL_MACHINE: int
|
||||
@ -38,52 +67,52 @@ if sys.platform == "win32":
|
||||
HKEY_CURRENT_CONFIG: int
|
||||
HKEY_DYN_DATA: int
|
||||
|
||||
KEY_ALL_ACCESS: Literal[983103]
|
||||
KEY_WRITE: Literal[131078]
|
||||
KEY_READ: Literal[131097]
|
||||
KEY_EXECUTE: Literal[131097]
|
||||
KEY_QUERY_VALUE: Literal[1]
|
||||
KEY_SET_VALUE: Literal[2]
|
||||
KEY_CREATE_SUB_KEY: Literal[4]
|
||||
KEY_ENUMERATE_SUB_KEYS: Literal[8]
|
||||
KEY_NOTIFY: Literal[16]
|
||||
KEY_CREATE_LINK: Literal[32]
|
||||
KEY_ALL_ACCESS: Final = 983103
|
||||
KEY_WRITE: Final = 131078
|
||||
KEY_READ: Final = 131097
|
||||
KEY_EXECUTE: Final = 131097
|
||||
KEY_QUERY_VALUE: Final = 1
|
||||
KEY_SET_VALUE: Final = 2
|
||||
KEY_CREATE_SUB_KEY: Final = 4
|
||||
KEY_ENUMERATE_SUB_KEYS: Final = 8
|
||||
KEY_NOTIFY: Final = 16
|
||||
KEY_CREATE_LINK: Final = 32
|
||||
|
||||
KEY_WOW64_64KEY: Literal[256]
|
||||
KEY_WOW64_32KEY: Literal[512]
|
||||
KEY_WOW64_64KEY: Final = 256
|
||||
KEY_WOW64_32KEY: Final = 512
|
||||
|
||||
REG_BINARY: Literal[3]
|
||||
REG_DWORD: Literal[4]
|
||||
REG_DWORD_LITTLE_ENDIAN: Literal[4]
|
||||
REG_DWORD_BIG_ENDIAN: Literal[5]
|
||||
REG_EXPAND_SZ: Literal[2]
|
||||
REG_LINK: Literal[6]
|
||||
REG_MULTI_SZ: Literal[7]
|
||||
REG_NONE: Literal[0]
|
||||
REG_QWORD: Literal[11]
|
||||
REG_QWORD_LITTLE_ENDIAN: Literal[11]
|
||||
REG_RESOURCE_LIST: Literal[8]
|
||||
REG_FULL_RESOURCE_DESCRIPTOR: Literal[9]
|
||||
REG_RESOURCE_REQUIREMENTS_LIST: Literal[10]
|
||||
REG_SZ: Literal[1]
|
||||
REG_BINARY: Final = 3
|
||||
REG_DWORD: Final = 4
|
||||
REG_DWORD_LITTLE_ENDIAN: Final = 4
|
||||
REG_DWORD_BIG_ENDIAN: Final = 5
|
||||
REG_EXPAND_SZ: Final = 2
|
||||
REG_LINK: Final = 6
|
||||
REG_MULTI_SZ: Final = 7
|
||||
REG_NONE: Final = 0
|
||||
REG_QWORD: Final = 11
|
||||
REG_QWORD_LITTLE_ENDIAN: Final = 11
|
||||
REG_RESOURCE_LIST: Final = 8
|
||||
REG_FULL_RESOURCE_DESCRIPTOR: Final = 9
|
||||
REG_RESOURCE_REQUIREMENTS_LIST: Final = 10
|
||||
REG_SZ: Final = 1
|
||||
|
||||
REG_CREATED_NEW_KEY: int # undocumented
|
||||
REG_LEGAL_CHANGE_FILTER: int # undocumented
|
||||
REG_LEGAL_OPTION: int # undocumented
|
||||
REG_NOTIFY_CHANGE_ATTRIBUTES: int # undocumented
|
||||
REG_NOTIFY_CHANGE_LAST_SET: int # undocumented
|
||||
REG_NOTIFY_CHANGE_NAME: int # undocumented
|
||||
REG_NOTIFY_CHANGE_SECURITY: int # undocumented
|
||||
REG_NO_LAZY_FLUSH: int # undocumented
|
||||
REG_OPENED_EXISTING_KEY: int # undocumented
|
||||
REG_OPTION_BACKUP_RESTORE: int # undocumented
|
||||
REG_OPTION_CREATE_LINK: int # undocumented
|
||||
REG_OPTION_NON_VOLATILE: int # undocumented
|
||||
REG_OPTION_OPEN_LINK: int # undocumented
|
||||
REG_OPTION_RESERVED: int # undocumented
|
||||
REG_OPTION_VOLATILE: int # undocumented
|
||||
REG_REFRESH_HIVE: int # undocumented
|
||||
REG_WHOLE_HIVE_VOLATILE: int # undocumented
|
||||
REG_CREATED_NEW_KEY: Final = 1 # undocumented
|
||||
REG_LEGAL_CHANGE_FILTER: Final = 268435471 # undocumented
|
||||
REG_LEGAL_OPTION: Final = 31 # undocumented
|
||||
REG_NOTIFY_CHANGE_ATTRIBUTES: Final = 2 # undocumented
|
||||
REG_NOTIFY_CHANGE_LAST_SET: Final = 4 # undocumented
|
||||
REG_NOTIFY_CHANGE_NAME: Final = 1 # undocumented
|
||||
REG_NOTIFY_CHANGE_SECURITY: Final = 8 # undocumented
|
||||
REG_NO_LAZY_FLUSH: Final = 4 # undocumented
|
||||
REG_OPENED_EXISTING_KEY: Final = 2 # undocumented
|
||||
REG_OPTION_BACKUP_RESTORE: Final = 4 # undocumented
|
||||
REG_OPTION_CREATE_LINK: Final = 2 # undocumented
|
||||
REG_OPTION_NON_VOLATILE: Final = 0 # undocumented
|
||||
REG_OPTION_OPEN_LINK: Final = 8 # undocumented
|
||||
REG_OPTION_RESERVED: Final = 0 # undocumented
|
||||
REG_OPTION_VOLATILE: Final = 1 # undocumented
|
||||
REG_REFRESH_HIVE: Final = 2 # undocumented
|
||||
REG_WHOLE_HIVE_VOLATILE: Final = 1 # undocumented
|
||||
|
||||
error = OSError
|
||||
|
||||
|
@ -1,5 +1,6 @@
|
||||
version = "10.2.*"
|
||||
upstream_repository = "https://github.com/python-pillow/Pillow"
|
||||
obsolete_since = "10.3.0" # Released on 2024-04-01
|
||||
|
||||
[tool.stubtest]
|
||||
stubtest_requirements = ["olefile"]
|
||||
|
@ -5,17 +5,17 @@ from typing import ClassVar, Literal
|
||||
from .ImageFile import ImageFile, PyDecoder, PyEncoder
|
||||
|
||||
class Format(IntEnum):
|
||||
JPEG: int
|
||||
JPEG = 0
|
||||
|
||||
class Encoding(IntEnum):
|
||||
UNCOMPRESSED: int
|
||||
DXT: int
|
||||
UNCOMPRESSED_RAW_BGRA: int
|
||||
UNCOMPRESSED = 1
|
||||
DXT = 2
|
||||
UNCOMPRESSED_RAW_BGRA = 3
|
||||
|
||||
class AlphaEncoding(IntEnum):
|
||||
DXT1: int
|
||||
DXT3: int
|
||||
DXT5: int
|
||||
DXT1 = 0
|
||||
DXT3 = 1
|
||||
DXT5 = 7
|
||||
|
||||
def unpack_565(i): ...
|
||||
def decode_dxt1(data, alpha: bool = False): ...
|
||||
|
@ -2,346 +2,346 @@ from collections.abc import Mapping
|
||||
from enum import IntEnum
|
||||
|
||||
class Base(IntEnum):
|
||||
InteropIndex: int
|
||||
ProcessingSoftware: int
|
||||
NewSubfileType: int
|
||||
SubfileType: int
|
||||
ImageWidth: int
|
||||
ImageLength: int
|
||||
BitsPerSample: int
|
||||
Compression: int
|
||||
PhotometricInterpretation: int
|
||||
Thresholding: int
|
||||
CellWidth: int
|
||||
CellLength: int
|
||||
FillOrder: int
|
||||
DocumentName: int
|
||||
ImageDescription: int
|
||||
Make: int
|
||||
Model: int
|
||||
StripOffsets: int
|
||||
Orientation: int
|
||||
SamplesPerPixel: int
|
||||
RowsPerStrip: int
|
||||
StripByteCounts: int
|
||||
MinSampleValue: int
|
||||
MaxSampleValue: int
|
||||
XResolution: int
|
||||
YResolution: int
|
||||
PlanarConfiguration: int
|
||||
PageName: int
|
||||
FreeOffsets: int
|
||||
FreeByteCounts: int
|
||||
GrayResponseUnit: int
|
||||
GrayResponseCurve: int
|
||||
T4Options: int
|
||||
T6Options: int
|
||||
ResolutionUnit: int
|
||||
PageNumber: int
|
||||
TransferFunction: int
|
||||
Software: int
|
||||
DateTime: int
|
||||
Artist: int
|
||||
HostComputer: int
|
||||
Predictor: int
|
||||
WhitePoint: int
|
||||
PrimaryChromaticities: int
|
||||
ColorMap: int
|
||||
HalftoneHints: int
|
||||
TileWidth: int
|
||||
TileLength: int
|
||||
TileOffsets: int
|
||||
TileByteCounts: int
|
||||
SubIFDs: int
|
||||
InkSet: int
|
||||
InkNames: int
|
||||
NumberOfInks: int
|
||||
DotRange: int
|
||||
TargetPrinter: int
|
||||
ExtraSamples: int
|
||||
SampleFormat: int
|
||||
SMinSampleValue: int
|
||||
SMaxSampleValue: int
|
||||
TransferRange: int
|
||||
ClipPath: int
|
||||
XClipPathUnits: int
|
||||
YClipPathUnits: int
|
||||
Indexed: int
|
||||
JPEGTables: int
|
||||
OPIProxy: int
|
||||
JPEGProc: int
|
||||
JpegIFOffset: int
|
||||
JpegIFByteCount: int
|
||||
JpegRestartInterval: int
|
||||
JpegLosslessPredictors: int
|
||||
JpegPointTransforms: int
|
||||
JpegQTables: int
|
||||
JpegDCTables: int
|
||||
JpegACTables: int
|
||||
YCbCrCoefficients: int
|
||||
YCbCrSubSampling: int
|
||||
YCbCrPositioning: int
|
||||
ReferenceBlackWhite: int
|
||||
XMLPacket: int
|
||||
RelatedImageFileFormat: int
|
||||
RelatedImageWidth: int
|
||||
RelatedImageLength: int
|
||||
Rating: int
|
||||
RatingPercent: int
|
||||
ImageID: int
|
||||
CFARepeatPatternDim: int
|
||||
BatteryLevel: int
|
||||
Copyright: int
|
||||
ExposureTime: int
|
||||
FNumber: int
|
||||
IPTCNAA: int
|
||||
ImageResources: int
|
||||
ExifOffset: int
|
||||
InterColorProfile: int
|
||||
ExposureProgram: int
|
||||
SpectralSensitivity: int
|
||||
GPSInfo: int
|
||||
ISOSpeedRatings: int
|
||||
OECF: int
|
||||
Interlace: int
|
||||
TimeZoneOffset: int
|
||||
SelfTimerMode: int
|
||||
SensitivityType: int
|
||||
StandardOutputSensitivity: int
|
||||
RecommendedExposureIndex: int
|
||||
ISOSpeed: int
|
||||
ISOSpeedLatitudeyyy: int
|
||||
ISOSpeedLatitudezzz: int
|
||||
ExifVersion: int
|
||||
DateTimeOriginal: int
|
||||
DateTimeDigitized: int
|
||||
OffsetTime: int
|
||||
OffsetTimeOriginal: int
|
||||
OffsetTimeDigitized: int
|
||||
ComponentsConfiguration: int
|
||||
CompressedBitsPerPixel: int
|
||||
ShutterSpeedValue: int
|
||||
ApertureValue: int
|
||||
BrightnessValue: int
|
||||
ExposureBiasValue: int
|
||||
MaxApertureValue: int
|
||||
SubjectDistance: int
|
||||
MeteringMode: int
|
||||
LightSource: int
|
||||
Flash: int
|
||||
FocalLength: int
|
||||
Noise: int
|
||||
ImageNumber: int
|
||||
SecurityClassification: int
|
||||
ImageHistory: int
|
||||
TIFFEPStandardID: int
|
||||
MakerNote: int
|
||||
UserComment: int
|
||||
SubsecTime: int
|
||||
SubsecTimeOriginal: int
|
||||
SubsecTimeDigitized: int
|
||||
AmbientTemperature: int
|
||||
Humidity: int
|
||||
Pressure: int
|
||||
WaterDepth: int
|
||||
Acceleration: int
|
||||
CameraElevationAngle: int
|
||||
XPTitle: int
|
||||
XPComment: int
|
||||
XPAuthor: int
|
||||
XPKeywords: int
|
||||
XPSubject: int
|
||||
FlashPixVersion: int
|
||||
ColorSpace: int
|
||||
ExifImageWidth: int
|
||||
ExifImageHeight: int
|
||||
RelatedSoundFile: int
|
||||
ExifInteroperabilityOffset: int
|
||||
FlashEnergy: int
|
||||
SpatialFrequencyResponse: int
|
||||
FocalPlaneXResolution: int
|
||||
FocalPlaneYResolution: int
|
||||
FocalPlaneResolutionUnit: int
|
||||
SubjectLocation: int
|
||||
ExposureIndex: int
|
||||
SensingMethod: int
|
||||
FileSource: int
|
||||
SceneType: int
|
||||
CFAPattern: int
|
||||
CustomRendered: int
|
||||
ExposureMode: int
|
||||
WhiteBalance: int
|
||||
DigitalZoomRatio: int
|
||||
FocalLengthIn35mmFilm: int
|
||||
SceneCaptureType: int
|
||||
GainControl: int
|
||||
Contrast: int
|
||||
Saturation: int
|
||||
Sharpness: int
|
||||
DeviceSettingDescription: int
|
||||
SubjectDistanceRange: int
|
||||
ImageUniqueID: int
|
||||
CameraOwnerName: int
|
||||
BodySerialNumber: int
|
||||
LensSpecification: int
|
||||
LensMake: int
|
||||
LensModel: int
|
||||
LensSerialNumber: int
|
||||
CompositeImage: int
|
||||
CompositeImageCount: int
|
||||
CompositeImageExposureTimes: int
|
||||
Gamma: int
|
||||
PrintImageMatching: int
|
||||
DNGVersion: int
|
||||
DNGBackwardVersion: int
|
||||
UniqueCameraModel: int
|
||||
LocalizedCameraModel: int
|
||||
CFAPlaneColor: int
|
||||
CFALayout: int
|
||||
LinearizationTable: int
|
||||
BlackLevelRepeatDim: int
|
||||
BlackLevel: int
|
||||
BlackLevelDeltaH: int
|
||||
BlackLevelDeltaV: int
|
||||
WhiteLevel: int
|
||||
DefaultScale: int
|
||||
DefaultCropOrigin: int
|
||||
DefaultCropSize: int
|
||||
ColorMatrix1: int
|
||||
ColorMatrix2: int
|
||||
CameraCalibration1: int
|
||||
CameraCalibration2: int
|
||||
ReductionMatrix1: int
|
||||
ReductionMatrix2: int
|
||||
AnalogBalance: int
|
||||
AsShotNeutral: int
|
||||
AsShotWhiteXY: int
|
||||
BaselineExposure: int
|
||||
BaselineNoise: int
|
||||
BaselineSharpness: int
|
||||
BayerGreenSplit: int
|
||||
LinearResponseLimit: int
|
||||
CameraSerialNumber: int
|
||||
LensInfo: int
|
||||
ChromaBlurRadius: int
|
||||
AntiAliasStrength: int
|
||||
ShadowScale: int
|
||||
DNGPrivateData: int
|
||||
MakerNoteSafety: int
|
||||
CalibrationIlluminant1: int
|
||||
CalibrationIlluminant2: int
|
||||
BestQualityScale: int
|
||||
RawDataUniqueID: int
|
||||
OriginalRawFileName: int
|
||||
OriginalRawFileData: int
|
||||
ActiveArea: int
|
||||
MaskedAreas: int
|
||||
AsShotICCProfile: int
|
||||
AsShotPreProfileMatrix: int
|
||||
CurrentICCProfile: int
|
||||
CurrentPreProfileMatrix: int
|
||||
ColorimetricReference: int
|
||||
CameraCalibrationSignature: int
|
||||
ProfileCalibrationSignature: int
|
||||
AsShotProfileName: int
|
||||
NoiseReductionApplied: int
|
||||
ProfileName: int
|
||||
ProfileHueSatMapDims: int
|
||||
ProfileHueSatMapData1: int
|
||||
ProfileHueSatMapData2: int
|
||||
ProfileToneCurve: int
|
||||
ProfileEmbedPolicy: int
|
||||
ProfileCopyright: int
|
||||
ForwardMatrix1: int
|
||||
ForwardMatrix2: int
|
||||
PreviewApplicationName: int
|
||||
PreviewApplicationVersion: int
|
||||
PreviewSettingsName: int
|
||||
PreviewSettingsDigest: int
|
||||
PreviewColorSpace: int
|
||||
PreviewDateTime: int
|
||||
RawImageDigest: int
|
||||
OriginalRawFileDigest: int
|
||||
SubTileBlockSize: int
|
||||
RowInterleaveFactor: int
|
||||
ProfileLookTableDims: int
|
||||
ProfileLookTableData: int
|
||||
OpcodeList1: int
|
||||
OpcodeList2: int
|
||||
OpcodeList3: int
|
||||
NoiseProfile: int
|
||||
InteropIndex = 0x0001
|
||||
ProcessingSoftware = 0x000B
|
||||
NewSubfileType = 0x00FE
|
||||
SubfileType = 0x00FF
|
||||
ImageWidth = 0x0100
|
||||
ImageLength = 0x0101
|
||||
BitsPerSample = 0x0102
|
||||
Compression = 0x0103
|
||||
PhotometricInterpretation = 0x0106
|
||||
Thresholding = 0x0107
|
||||
CellWidth = 0x0108
|
||||
CellLength = 0x0109
|
||||
FillOrder = 0x010A
|
||||
DocumentName = 0x010D
|
||||
ImageDescription = 0x010E
|
||||
Make = 0x010F
|
||||
Model = 0x0110
|
||||
StripOffsets = 0x0111
|
||||
Orientation = 0x0112
|
||||
SamplesPerPixel = 0x0115
|
||||
RowsPerStrip = 0x0116
|
||||
StripByteCounts = 0x0117
|
||||
MinSampleValue = 0x0118
|
||||
MaxSampleValue = 0x0119
|
||||
XResolution = 0x011A
|
||||
YResolution = 0x011B
|
||||
PlanarConfiguration = 0x011C
|
||||
PageName = 0x011D
|
||||
FreeOffsets = 0x0120
|
||||
FreeByteCounts = 0x0121
|
||||
GrayResponseUnit = 0x0122
|
||||
GrayResponseCurve = 0x0123
|
||||
T4Options = 0x0124
|
||||
T6Options = 0x0125
|
||||
ResolutionUnit = 0x0128
|
||||
PageNumber = 0x0129
|
||||
TransferFunction = 0x012D
|
||||
Software = 0x0131
|
||||
DateTime = 0x0132
|
||||
Artist = 0x013B
|
||||
HostComputer = 0x013C
|
||||
Predictor = 0x013D
|
||||
WhitePoint = 0x013E
|
||||
PrimaryChromaticities = 0x013F
|
||||
ColorMap = 0x0140
|
||||
HalftoneHints = 0x0141
|
||||
TileWidth = 0x0142
|
||||
TileLength = 0x0143
|
||||
TileOffsets = 0x0144
|
||||
TileByteCounts = 0x0145
|
||||
SubIFDs = 0x014A
|
||||
InkSet = 0x014C
|
||||
InkNames = 0x014D
|
||||
NumberOfInks = 0x014E
|
||||
DotRange = 0x0150
|
||||
TargetPrinter = 0x0151
|
||||
ExtraSamples = 0x0152
|
||||
SampleFormat = 0x0153
|
||||
SMinSampleValue = 0x0154
|
||||
SMaxSampleValue = 0x0155
|
||||
TransferRange = 0x0156
|
||||
ClipPath = 0x0157
|
||||
XClipPathUnits = 0x0158
|
||||
YClipPathUnits = 0x0159
|
||||
Indexed = 0x015A
|
||||
JPEGTables = 0x015B
|
||||
OPIProxy = 0x015F
|
||||
JPEGProc = 0x0200
|
||||
JpegIFOffset = 0x0201
|
||||
JpegIFByteCount = 0x0202
|
||||
JpegRestartInterval = 0x0203
|
||||
JpegLosslessPredictors = 0x0205
|
||||
JpegPointTransforms = 0x0206
|
||||
JpegQTables = 0x0207
|
||||
JpegDCTables = 0x0208
|
||||
JpegACTables = 0x0209
|
||||
YCbCrCoefficients = 0x0211
|
||||
YCbCrSubSampling = 0x0212
|
||||
YCbCrPositioning = 0x0213
|
||||
ReferenceBlackWhite = 0x0214
|
||||
XMLPacket = 0x02BC
|
||||
RelatedImageFileFormat = 0x1000
|
||||
RelatedImageWidth = 0x1001
|
||||
RelatedImageLength = 0x1002
|
||||
Rating = 0x4746
|
||||
RatingPercent = 0x4749
|
||||
ImageID = 0x800D
|
||||
CFARepeatPatternDim = 0x828D
|
||||
BatteryLevel = 0x828F
|
||||
Copyright = 0x8298
|
||||
ExposureTime = 0x829A
|
||||
FNumber = 0x829D
|
||||
IPTCNAA = 0x83BB
|
||||
ImageResources = 0x8649
|
||||
ExifOffset = 0x8769
|
||||
InterColorProfile = 0x8773
|
||||
ExposureProgram = 0x8822
|
||||
SpectralSensitivity = 0x8824
|
||||
GPSInfo = 0x8825
|
||||
ISOSpeedRatings = 0x8827
|
||||
OECF = 0x8828
|
||||
Interlace = 0x8829
|
||||
TimeZoneOffset = 0x882A
|
||||
SelfTimerMode = 0x882B
|
||||
SensitivityType = 0x8830
|
||||
StandardOutputSensitivity = 0x8831
|
||||
RecommendedExposureIndex = 0x8832
|
||||
ISOSpeed = 0x8833
|
||||
ISOSpeedLatitudeyyy = 0x8834
|
||||
ISOSpeedLatitudezzz = 0x8835
|
||||
ExifVersion = 0x9000
|
||||
DateTimeOriginal = 0x9003
|
||||
DateTimeDigitized = 0x9004
|
||||
OffsetTime = 0x9010
|
||||
OffsetTimeOriginal = 0x9011
|
||||
OffsetTimeDigitized = 0x9012
|
||||
ComponentsConfiguration = 0x9101
|
||||
CompressedBitsPerPixel = 0x9102
|
||||
ShutterSpeedValue = 0x9201
|
||||
ApertureValue = 0x9202
|
||||
BrightnessValue = 0x9203
|
||||
ExposureBiasValue = 0x9204
|
||||
MaxApertureValue = 0x9205
|
||||
SubjectDistance = 0x9206
|
||||
MeteringMode = 0x9207
|
||||
LightSource = 0x9208
|
||||
Flash = 0x9209
|
||||
FocalLength = 0x920A
|
||||
Noise = 0x920D
|
||||
ImageNumber = 0x9211
|
||||
SecurityClassification = 0x9212
|
||||
ImageHistory = 0x9213
|
||||
TIFFEPStandardID = 0x9216
|
||||
MakerNote = 0x927C
|
||||
UserComment = 0x9286
|
||||
SubsecTime = 0x9290
|
||||
SubsecTimeOriginal = 0x9291
|
||||
SubsecTimeDigitized = 0x9292
|
||||
AmbientTemperature = 0x9400
|
||||
Humidity = 0x9401
|
||||
Pressure = 0x9402
|
||||
WaterDepth = 0x9403
|
||||
Acceleration = 0x9404
|
||||
CameraElevationAngle = 0x9405
|
||||
XPTitle = 0x9C9B
|
||||
XPComment = 0x9C9C
|
||||
XPAuthor = 0x9C9D
|
||||
XPKeywords = 0x9C9E
|
||||
XPSubject = 0x9C9F
|
||||
FlashPixVersion = 0xA000
|
||||
ColorSpace = 0xA001
|
||||
ExifImageWidth = 0xA002
|
||||
ExifImageHeight = 0xA003
|
||||
RelatedSoundFile = 0xA004
|
||||
ExifInteroperabilityOffset = 0xA005
|
||||
FlashEnergy = 0xA20B
|
||||
SpatialFrequencyResponse = 0xA20C
|
||||
FocalPlaneXResolution = 0xA20E
|
||||
FocalPlaneYResolution = 0xA20F
|
||||
FocalPlaneResolutionUnit = 0xA210
|
||||
SubjectLocation = 0xA214
|
||||
ExposureIndex = 0xA215
|
||||
SensingMethod = 0xA217
|
||||
FileSource = 0xA300
|
||||
SceneType = 0xA301
|
||||
CFAPattern = 0xA302
|
||||
CustomRendered = 0xA401
|
||||
ExposureMode = 0xA402
|
||||
WhiteBalance = 0xA403
|
||||
DigitalZoomRatio = 0xA404
|
||||
FocalLengthIn35mmFilm = 0xA405
|
||||
SceneCaptureType = 0xA406
|
||||
GainControl = 0xA407
|
||||
Contrast = 0xA408
|
||||
Saturation = 0xA409
|
||||
Sharpness = 0xA40A
|
||||
DeviceSettingDescription = 0xA40B
|
||||
SubjectDistanceRange = 0xA40C
|
||||
ImageUniqueID = 0xA420
|
||||
CameraOwnerName = 0xA430
|
||||
BodySerialNumber = 0xA431
|
||||
LensSpecification = 0xA432
|
||||
LensMake = 0xA433
|
||||
LensModel = 0xA434
|
||||
LensSerialNumber = 0xA435
|
||||
CompositeImage = 0xA460
|
||||
CompositeImageCount = 0xA461
|
||||
CompositeImageExposureTimes = 0xA462
|
||||
Gamma = 0xA500
|
||||
PrintImageMatching = 0xC4A5
|
||||
DNGVersion = 0xC612
|
||||
DNGBackwardVersion = 0xC613
|
||||
UniqueCameraModel = 0xC614
|
||||
LocalizedCameraModel = 0xC615
|
||||
CFAPlaneColor = 0xC616
|
||||
CFALayout = 0xC617
|
||||
LinearizationTable = 0xC618
|
||||
BlackLevelRepeatDim = 0xC619
|
||||
BlackLevel = 0xC61A
|
||||
BlackLevelDeltaH = 0xC61B
|
||||
BlackLevelDeltaV = 0xC61C
|
||||
WhiteLevel = 0xC61D
|
||||
DefaultScale = 0xC61E
|
||||
DefaultCropOrigin = 0xC61F
|
||||
DefaultCropSize = 0xC620
|
||||
ColorMatrix1 = 0xC621
|
||||
ColorMatrix2 = 0xC622
|
||||
CameraCalibration1 = 0xC623
|
||||
CameraCalibration2 = 0xC624
|
||||
ReductionMatrix1 = 0xC625
|
||||
ReductionMatrix2 = 0xC626
|
||||
AnalogBalance = 0xC627
|
||||
AsShotNeutral = 0xC628
|
||||
AsShotWhiteXY = 0xC629
|
||||
BaselineExposure = 0xC62A
|
||||
BaselineNoise = 0xC62B
|
||||
BaselineSharpness = 0xC62C
|
||||
BayerGreenSplit = 0xC62D
|
||||
LinearResponseLimit = 0xC62E
|
||||
CameraSerialNumber = 0xC62F
|
||||
LensInfo = 0xC630
|
||||
ChromaBlurRadius = 0xC631
|
||||
AntiAliasStrength = 0xC632
|
||||
ShadowScale = 0xC633
|
||||
DNGPrivateData = 0xC634
|
||||
MakerNoteSafety = 0xC635
|
||||
CalibrationIlluminant1 = 0xC65A
|
||||
CalibrationIlluminant2 = 0xC65B
|
||||
BestQualityScale = 0xC65C
|
||||
RawDataUniqueID = 0xC65D
|
||||
OriginalRawFileName = 0xC68B
|
||||
OriginalRawFileData = 0xC68C
|
||||
ActiveArea = 0xC68D
|
||||
MaskedAreas = 0xC68E
|
||||
AsShotICCProfile = 0xC68F
|
||||
AsShotPreProfileMatrix = 0xC690
|
||||
CurrentICCProfile = 0xC691
|
||||
CurrentPreProfileMatrix = 0xC692
|
||||
ColorimetricReference = 0xC6BF
|
||||
CameraCalibrationSignature = 0xC6F3
|
||||
ProfileCalibrationSignature = 0xC6F4
|
||||
AsShotProfileName = 0xC6F6
|
||||
NoiseReductionApplied = 0xC6F7
|
||||
ProfileName = 0xC6F8
|
||||
ProfileHueSatMapDims = 0xC6F9
|
||||
ProfileHueSatMapData1 = 0xC6FA
|
||||
ProfileHueSatMapData2 = 0xC6FB
|
||||
ProfileToneCurve = 0xC6FC
|
||||
ProfileEmbedPolicy = 0xC6FD
|
||||
ProfileCopyright = 0xC6FE
|
||||
ForwardMatrix1 = 0xC714
|
||||
ForwardMatrix2 = 0xC715
|
||||
PreviewApplicationName = 0xC716
|
||||
PreviewApplicationVersion = 0xC717
|
||||
PreviewSettingsName = 0xC718
|
||||
PreviewSettingsDigest = 0xC719
|
||||
PreviewColorSpace = 0xC71A
|
||||
PreviewDateTime = 0xC71B
|
||||
RawImageDigest = 0xC71C
|
||||
OriginalRawFileDigest = 0xC71D
|
||||
SubTileBlockSize = 0xC71E
|
||||
RowInterleaveFactor = 0xC71F
|
||||
ProfileLookTableDims = 0xC725
|
||||
ProfileLookTableData = 0xC726
|
||||
OpcodeList1 = 0xC740
|
||||
OpcodeList2 = 0xC741
|
||||
OpcodeList3 = 0xC74E
|
||||
NoiseProfile = 0xC761
|
||||
|
||||
TAGS: Mapping[int, str]
|
||||
|
||||
class GPS(IntEnum):
|
||||
GPSVersionID: int
|
||||
GPSLatitudeRef: int
|
||||
GPSLatitude: int
|
||||
GPSLongitudeRef: int
|
||||
GPSLongitude: int
|
||||
GPSAltitudeRef: int
|
||||
GPSAltitude: int
|
||||
GPSTimeStamp: int
|
||||
GPSSatellites: int
|
||||
GPSStatus: int
|
||||
GPSMeasureMode: int
|
||||
GPSDOP: int
|
||||
GPSSpeedRef: int
|
||||
GPSSpeed: int
|
||||
GPSTrackRef: int
|
||||
GPSTrack: int
|
||||
GPSImgDirectionRef: int
|
||||
GPSImgDirection: int
|
||||
GPSMapDatum: int
|
||||
GPSDestLatitudeRef: int
|
||||
GPSDestLatitude: int
|
||||
GPSDestLongitudeRef: int
|
||||
GPSDestLongitude: int
|
||||
GPSDestBearingRef: int
|
||||
GPSDestBearing: int
|
||||
GPSDestDistanceRef: int
|
||||
GPSDestDistance: int
|
||||
GPSProcessingMethod: int
|
||||
GPSAreaInformation: int
|
||||
GPSDateStamp: int
|
||||
GPSDifferential: int
|
||||
GPSHPositioningError: int
|
||||
GPSVersionID = 0
|
||||
GPSLatitudeRef = 1
|
||||
GPSLatitude = 2
|
||||
GPSLongitudeRef = 3
|
||||
GPSLongitude = 4
|
||||
GPSAltitudeRef = 5
|
||||
GPSAltitude = 6
|
||||
GPSTimeStamp = 7
|
||||
GPSSatellites = 8
|
||||
GPSStatus = 9
|
||||
GPSMeasureMode = 10
|
||||
GPSDOP = 11
|
||||
GPSSpeedRef = 12
|
||||
GPSSpeed = 13
|
||||
GPSTrackRef = 14
|
||||
GPSTrack = 15
|
||||
GPSImgDirectionRef = 16
|
||||
GPSImgDirection = 17
|
||||
GPSMapDatum = 18
|
||||
GPSDestLatitudeRef = 19
|
||||
GPSDestLatitude = 20
|
||||
GPSDestLongitudeRef = 21
|
||||
GPSDestLongitude = 22
|
||||
GPSDestBearingRef = 23
|
||||
GPSDestBearing = 24
|
||||
GPSDestDistanceRef = 25
|
||||
GPSDestDistance = 26
|
||||
GPSProcessingMethod = 27
|
||||
GPSAreaInformation = 28
|
||||
GPSDateStamp = 29
|
||||
GPSDifferential = 30
|
||||
GPSHPositioningError = 31
|
||||
|
||||
GPSTAGS: Mapping[int, str]
|
||||
|
||||
class Interop(IntEnum):
|
||||
InteropIndex: int
|
||||
InteropVersion: int
|
||||
RelatedImageFileFormat: int
|
||||
RelatedImageWidth: int
|
||||
RleatedImageHeight: int
|
||||
InteropIndex = 1
|
||||
InteropVersion = 2
|
||||
RelatedImageFileFormat = 4096
|
||||
RelatedImageWidth = 4097
|
||||
RleatedImageHeight = 4098
|
||||
|
||||
class IFD(IntEnum):
|
||||
Exif: int
|
||||
GPSInfo: int
|
||||
Makernote: int
|
||||
Interop: int
|
||||
IFD1: int
|
||||
Exif = 34665
|
||||
GPSInfo = 34853
|
||||
Makernote = 37500
|
||||
Interop = 40965
|
||||
IFD1 = -1
|
||||
|
||||
class LightSource(IntEnum):
|
||||
Unknown: int
|
||||
Daylight: int
|
||||
Fluorescent: int
|
||||
Tungsten: int
|
||||
Flash: int
|
||||
Fine: int
|
||||
Cloudy: int
|
||||
Shade: int
|
||||
DaylightFluorescent: int
|
||||
DayWhiteFluorescent: int
|
||||
CoolWhiteFluorescent: int
|
||||
WhiteFluorescent: int
|
||||
StandardLightA: int
|
||||
StandardLightB: int
|
||||
StandardLightC: int
|
||||
D55: int
|
||||
D65: int
|
||||
D75: int
|
||||
D50: int
|
||||
ISO: int
|
||||
Other: int
|
||||
Unknown = 0
|
||||
Daylight = 1
|
||||
Fluorescent = 2
|
||||
Tungsten = 3
|
||||
Flash = 4
|
||||
Fine = 9
|
||||
Cloudy = 10
|
||||
Shade = 11
|
||||
DaylightFluorescent = 12
|
||||
DayWhiteFluorescent = 13
|
||||
CoolWhiteFluorescent = 14
|
||||
WhiteFluorescent = 15
|
||||
StandardLightA = 17
|
||||
StandardLightB = 18
|
||||
StandardLightC = 19
|
||||
D55 = 20
|
||||
D65 = 21
|
||||
D75 = 22
|
||||
D50 = 23
|
||||
ISO = 24
|
||||
Other = 255
|
||||
|
@ -6,8 +6,8 @@ from .ImageFile import ImageFile
|
||||
MAGIC: bytes
|
||||
|
||||
class Format(IntEnum):
|
||||
DXT1: int
|
||||
UNCOMPRESSED: int
|
||||
DXT1 = 0
|
||||
UNCOMPRESSED = 1
|
||||
|
||||
class FtexImageFile(ImageFile):
|
||||
format: ClassVar[Literal["FTEX"]]
|
||||
|
@ -56,13 +56,13 @@ USE_CFFI_ACCESS: bool
|
||||
def isImageType(t: object) -> TypeGuard[Image]: ...
|
||||
|
||||
class Transpose(IntEnum):
|
||||
FLIP_LEFT_RIGHT: Literal[0]
|
||||
FLIP_TOP_BOTTOM: Literal[1]
|
||||
ROTATE_90: Literal[2]
|
||||
ROTATE_180: Literal[3]
|
||||
ROTATE_270: Literal[4]
|
||||
TRANSPOSE: Literal[5]
|
||||
TRANSVERSE: Literal[6]
|
||||
FLIP_LEFT_RIGHT = 0
|
||||
FLIP_TOP_BOTTOM = 1
|
||||
ROTATE_90 = 2
|
||||
ROTATE_180 = 3
|
||||
ROTATE_270 = 4
|
||||
TRANSPOSE = 5
|
||||
TRANSVERSE = 6
|
||||
|
||||
# All Transpose items
|
||||
FLIP_LEFT_RIGHT: Literal[0]
|
||||
@ -74,11 +74,11 @@ TRANSPOSE: Literal[5]
|
||||
TRANSVERSE: Literal[6]
|
||||
|
||||
class Transform(IntEnum):
|
||||
AFFINE: Literal[0]
|
||||
EXTENT: Literal[1]
|
||||
PERSPECTIVE: Literal[2]
|
||||
QUAD: Literal[3]
|
||||
MESH: Literal[4]
|
||||
AFFINE = 0
|
||||
EXTENT = 1
|
||||
PERSPECTIVE = 2
|
||||
QUAD = 3
|
||||
MESH = 4
|
||||
|
||||
# All Transform items
|
||||
AFFINE: Literal[0]
|
||||
@ -88,12 +88,12 @@ QUAD: Literal[3]
|
||||
MESH: Literal[4]
|
||||
|
||||
class Resampling(IntEnum):
|
||||
NEAREST: Literal[0]
|
||||
LANCZOS: Literal[1]
|
||||
BILINEAR: Literal[2]
|
||||
BICUBIC: Literal[3]
|
||||
BOX: Literal[4]
|
||||
HAMMING: Literal[5]
|
||||
NEAREST = 0
|
||||
LANCZOS = 1
|
||||
BILINEAR = 2
|
||||
BICUBIC = 3
|
||||
BOX = 4
|
||||
HAMMING = 5
|
||||
|
||||
# All Resampling items
|
||||
NEAREST: Literal[0]
|
||||
@ -104,10 +104,10 @@ BOX: Literal[4]
|
||||
HAMMING: Literal[5]
|
||||
|
||||
class Dither(IntEnum):
|
||||
NONE: Literal[0]
|
||||
ORDERED: Literal[1]
|
||||
RASTERIZE: Literal[2]
|
||||
FLOYDSTEINBERG: Literal[3]
|
||||
NONE = 0
|
||||
ORDERED = 1
|
||||
RASTERIZE = 2
|
||||
FLOYDSTEINBERG = 3
|
||||
|
||||
# All Dither items
|
||||
NONE: Literal[0]
|
||||
@ -116,18 +116,18 @@ RASTERIZE: Literal[2]
|
||||
FLOYDSTEINBERG: Literal[3]
|
||||
|
||||
class Palette(IntEnum):
|
||||
WEB: Literal[0]
|
||||
ADAPTIVE: Literal[1]
|
||||
WEB = 0
|
||||
ADAPTIVE = 1
|
||||
|
||||
# All Palette items
|
||||
WEB: Literal[0]
|
||||
ADAPTIVE: Literal[1]
|
||||
|
||||
class Quantize(IntEnum):
|
||||
MEDIANCUT: Literal[0]
|
||||
MAXCOVERAGE: Literal[1]
|
||||
FASTOCTREE: Literal[2]
|
||||
LIBIMAGEQUANT: Literal[3]
|
||||
MEDIANCUT = 0
|
||||
MAXCOVERAGE = 1
|
||||
FASTOCTREE = 2
|
||||
LIBIMAGEQUANT = 3
|
||||
|
||||
# All Quantize items
|
||||
MEDIANCUT: Literal[0]
|
||||
|
@ -9,15 +9,15 @@ VERSION: str
|
||||
core: Incomplete
|
||||
|
||||
class Intent(IntEnum):
|
||||
PERCEPTUAL: int
|
||||
RELATIVE_COLORIMETRIC: int
|
||||
SATURATION: int
|
||||
ABSOLUTE_COLORIMETRIC: int
|
||||
PERCEPTUAL = 0
|
||||
RELATIVE_COLORIMETRIC = 1
|
||||
SATURATION = 2
|
||||
ABSOLUTE_COLORIMETRIC = 3
|
||||
|
||||
class Direction(IntEnum):
|
||||
INPUT: int
|
||||
OUTPUT: int
|
||||
PROOF: int
|
||||
INPUT = 0
|
||||
OUTPUT = 1
|
||||
PROOF = 2
|
||||
|
||||
FLAGS: Incomplete
|
||||
|
||||
|
@ -6,8 +6,8 @@ from typing import Final, Literal, Protocol
|
||||
from PIL.Image import Transpose
|
||||
|
||||
class Layout(IntEnum):
|
||||
BASIC: Literal[0]
|
||||
RAQM: Literal[1]
|
||||
BASIC = 0
|
||||
RAQM = 1
|
||||
|
||||
MAX_STRING_LENGTH: Final[int] = 1_000_000
|
||||
|
||||
|
@ -10,13 +10,13 @@ MAX_TEXT_CHUNK: Incomplete
|
||||
MAX_TEXT_MEMORY: Incomplete
|
||||
|
||||
class Disposal(IntEnum):
|
||||
OP_NONE: int
|
||||
OP_BACKGROUND: int
|
||||
OP_PREVIOUS: int
|
||||
OP_NONE = 0
|
||||
OP_BACKGROUND = 1
|
||||
OP_PREVIOUS = 2
|
||||
|
||||
class Blend(IntEnum):
|
||||
OP_SOURCE: int
|
||||
OP_OVER: int
|
||||
OP_SOURCE = 0
|
||||
OP_OVER = 1
|
||||
|
||||
class ChunkStream:
|
||||
fp: Incomplete
|
||||
|
@ -10,6 +10,6 @@ class Reservoir:
|
||||
def TTL(self): ...
|
||||
|
||||
class ReservoirDecision(Enum):
|
||||
TAKE: str
|
||||
BORROW: str
|
||||
NO: str
|
||||
TAKE = "take"
|
||||
BORROW = "borrow"
|
||||
NO = "no"
|
||||
|
@ -1,2 +1,2 @@
|
||||
version = "23.1.*"
|
||||
version = "24.0.*"
|
||||
upstream_repository = "https://github.com/mahmoud/boltons"
|
||||
|
@ -1,7 +1,6 @@
|
||||
from typing import Any
|
||||
|
||||
ECO_VERSION: str
|
||||
PY_GT_2: bool
|
||||
HAVE_URANDOM: bool
|
||||
INSTANCE_ID: str
|
||||
IS_64BIT: bool
|
||||
|
@ -4,6 +4,21 @@ from functools import total_ordering as total_ordering
|
||||
|
||||
NO_DEFAULT: Incomplete
|
||||
|
||||
def inspect_formatargspec(
|
||||
args,
|
||||
varargs=None,
|
||||
varkw=None,
|
||||
defaults=None,
|
||||
kwonlyargs=(),
|
||||
kwonlydefaults={},
|
||||
annotations={},
|
||||
formatarg=...,
|
||||
formatvarargs=...,
|
||||
formatvarkw=...,
|
||||
formatvalue=...,
|
||||
formatreturns=...,
|
||||
formatannotation=...,
|
||||
): ...
|
||||
def get_module_callables(mod, ignore: Incomplete | None = None): ...
|
||||
def mro_items(type_obj): ...
|
||||
def dir_dict(obj, raise_exc: bool = False): ...
|
||||
|
@ -2,8 +2,6 @@ import abc
|
||||
from _typeshed import Incomplete
|
||||
from abc import abstractmethod
|
||||
|
||||
text_type = str
|
||||
binary_type = bytes
|
||||
READ_CHUNK_SIZE: int
|
||||
EINVAL: Incomplete
|
||||
|
||||
|
@ -5,8 +5,6 @@ from typing import Any, TypeVar
|
||||
_KT = TypeVar("_KT")
|
||||
_VT = TypeVar("_VT")
|
||||
|
||||
unichr = chr
|
||||
|
||||
def camel2under(camel_string: str) -> str: ...
|
||||
def under2camel(under_string: str) -> str: ...
|
||||
def slugify(text: str, delim: str = "_", lower: bool = True, ascii: bool = False) -> str: ...
|
||||
@ -49,6 +47,10 @@ def args2sh(args: list[str], sep: str = " ") -> str: ...
|
||||
def args2cmd(args: list[str], sep: str = " ") -> str: ...
|
||||
def parse_int_list(range_string: str, delim: str = ",", range_delim: str = "-") -> list[int]: ...
|
||||
def format_int_list(int_list: list[int], delim: str = ",", range_delim: str = "-", delim_space: bool = False) -> str: ...
|
||||
def complement_int_list(
|
||||
range_string: str, range_start: int = 0, range_end: int | None = None, delim: str = ",", range_delim: str = "-"
|
||||
) -> str: ...
|
||||
def int_ranges_from_int_list(range_string: str, delim: str = ",", range_delim: str = "-") -> tuple[int, int]: ...
|
||||
|
||||
class MultiReplace:
|
||||
group_map: dict[str, str]
|
||||
@ -58,7 +60,3 @@ class MultiReplace:
|
||||
|
||||
def multi_replace(text: str, sub_map: dict[str, str], **kwargs) -> str: ...
|
||||
def unwrap_text(text: str, ending: str = "\n\n") -> str: ...
|
||||
|
||||
# Names in __all__ with no definition:
|
||||
# int_list_complement
|
||||
# int_list_to_int_tuples
|
||||
|
@ -80,6 +80,8 @@ VALUE: Incomplete
|
||||
SPREV: Incomplete
|
||||
SNEXT: Incomplete
|
||||
|
||||
OMD = OrderedMultiDict
|
||||
|
||||
class QueryParamDict(OrderedMultiDict[Incomplete, Incomplete]):
|
||||
@classmethod
|
||||
def from_text(cls, query_string): ...
|
||||
|
@ -0,0 +1,2 @@
|
||||
version = "3.0.*"
|
||||
upstream_repository = "https://github.com/xolox/python-capturer"
|
@ -0,0 +1,122 @@
|
||||
from _typeshed import FileDescriptorOrPath, SupportsWrite
|
||||
from collections.abc import Callable
|
||||
from io import BufferedReader
|
||||
from multiprocessing import Process
|
||||
from multiprocessing.queues import Queue
|
||||
from multiprocessing.synchronize import Event
|
||||
from signal import Signals
|
||||
from types import FrameType, TracebackType
|
||||
from typing import IO, Any, NoReturn
|
||||
from typing_extensions import Self
|
||||
|
||||
__version__: str
|
||||
aliases: dict[str, Any]
|
||||
DEFAULT_TEXT_ENCODING: str
|
||||
GRACEFUL_SHUTDOWN_SIGNAL: Signals
|
||||
TERMINATION_DELAY: float
|
||||
PARTIAL_DEFAULT: bool
|
||||
STDOUT_FD: int
|
||||
STDERR_FD: int
|
||||
|
||||
def enable_old_api() -> None: ...
|
||||
def create_proxy_method(name: str) -> Callable[..., Any]: ...
|
||||
|
||||
class MultiProcessHelper:
|
||||
processes: list[Process]
|
||||
def __init__(self) -> None: ...
|
||||
def start_child(self, target: Callable[[Event], Any]) -> None: ...
|
||||
def stop_children(self) -> None: ...
|
||||
def wait_for_children(self) -> None: ...
|
||||
def enable_graceful_shutdown(self) -> None: ...
|
||||
def raise_shutdown_request(self, signum: int, frame: FrameType | None) -> NoReturn: ...
|
||||
|
||||
class CaptureOutput(MultiProcessHelper):
|
||||
chunk_size: int
|
||||
encoding: str
|
||||
merged: bool
|
||||
relay: bool
|
||||
termination_delay: float
|
||||
pseudo_terminals: list[PseudoTerminal]
|
||||
streams: list[tuple[int, Stream]]
|
||||
stdout_stream: Stream
|
||||
stderr_stream: Stream
|
||||
output: PseudoTerminal
|
||||
output_queue: Queue[tuple[Any, bytes]]
|
||||
stdout: PseudoTerminal
|
||||
stderr: PseudoTerminal
|
||||
def __init__(
|
||||
self, merged: bool = True, encoding: str = ..., termination_delay: float = ..., chunk_size: int = 1024, relay: bool = True
|
||||
) -> None: ...
|
||||
def initialize_stream(self, file_obj: IO[str], expected_fd: int) -> Stream: ...
|
||||
def __enter__(self) -> Self: ...
|
||||
def __exit__(
|
||||
self,
|
||||
exc_type: type[BaseException] | None = None,
|
||||
exc_val: BaseException | None = None,
|
||||
exc_tb: TracebackType | None = None,
|
||||
) -> bool | None: ...
|
||||
@property
|
||||
def is_capturing(self) -> bool: ...
|
||||
def start_capture(self) -> None: ...
|
||||
def finish_capture(self) -> None: ...
|
||||
def allocate_pty(
|
||||
self, relay_fd: int | None = None, output_queue: Queue[tuple[Any, bytes]] | None = None, queue_token: Any | None = None
|
||||
) -> PseudoTerminal: ...
|
||||
def merge_loop(self, started_event: Event) -> None: ...
|
||||
def get_handle(self, partial: bool = ...) -> BufferedReader: ...
|
||||
def get_bytes(self, partial: bool = ...) -> bytes: ...
|
||||
def get_lines(self, interpreted: bool = True, partial: bool = ...) -> list[str]: ...
|
||||
def get_text(self, interpreted: bool = ..., partial: bool = ...) -> str: ...
|
||||
def save_to_handle(self, handle: SupportsWrite[bytes], partial: bool = ...) -> None: ...
|
||||
def save_to_path(self, filename: FileDescriptorOrPath, partial: bool = ...) -> None: ...
|
||||
|
||||
class OutputBuffer:
|
||||
fd: int
|
||||
buffer: bytes
|
||||
def __init__(self, fd: int) -> None: ...
|
||||
def add(self, output: bytes) -> None: ...
|
||||
def flush(self) -> None: ...
|
||||
|
||||
class PseudoTerminal(MultiProcessHelper):
|
||||
encoding: str
|
||||
termination_delay: float
|
||||
chunk_size: int
|
||||
relay_fd: int | None
|
||||
output_queue: Queue[tuple[Any, bytes]] | None
|
||||
queue_token: Any | None
|
||||
streams: list[Stream]
|
||||
master_fd: int
|
||||
slave_fd: int
|
||||
output_fd: int
|
||||
output_handle: BufferedReader
|
||||
def __init__(
|
||||
self,
|
||||
encoding: str,
|
||||
termination_delay: float,
|
||||
chunk_size: int,
|
||||
relay_fd: int | None,
|
||||
output_queue: Queue[tuple[int, bytes]] | None,
|
||||
queue_token: Any | None,
|
||||
) -> None: ...
|
||||
def attach(self, stream: Stream) -> None: ...
|
||||
def start_capture(self) -> None: ...
|
||||
def finish_capture(self) -> None: ...
|
||||
def close_pseudo_terminal(self) -> None: ...
|
||||
def restore_streams(self) -> None: ...
|
||||
def get_handle(self, partial: bool = ...) -> BufferedReader: ...
|
||||
def get_bytes(self, partial: bool = ...) -> bytes: ...
|
||||
def get_lines(self, interpreted: bool = True, partial: bool = ...) -> list[str]: ...
|
||||
def get_text(self, interpreted: bool = ..., partial: bool = ...) -> str: ...
|
||||
def save_to_handle(self, handle: SupportsWrite[bytes], partial: bool = ...) -> None: ...
|
||||
def save_to_path(self, filename: FileDescriptorOrPath, partial: bool = ...) -> None: ...
|
||||
def capture_loop(self, started_event: Event) -> None: ...
|
||||
|
||||
class Stream:
|
||||
fd: int
|
||||
original_fd: int
|
||||
is_redirected: bool
|
||||
def __init__(self, fd: int) -> None: ...
|
||||
def redirect(self, target_fd: int) -> None: ...
|
||||
def restore(self) -> None: ...
|
||||
|
||||
class ShutdownRequested(Exception): ...
|
@ -103,7 +103,7 @@ class croniter(Iterator[Any]):
|
||||
@classmethod
|
||||
def expand(cls, expr_format: str, hash_id: bytes | None = None) -> tuple[list[list[str]], dict[str, set[int]]]: ...
|
||||
@classmethod
|
||||
def is_valid(cls, expression: str, hash_id: bytes | None = None) -> bool: ...
|
||||
def is_valid(cls, expression: str, hash_id: bytes | None = None, encoding: str = "UTF-8") -> bool: ...
|
||||
@classmethod
|
||||
def match(cls, cron_expression: str, testdate: float | datetime.datetime | None, day_or: bool = True) -> bool: ...
|
||||
@classmethod
|
||||
|
@ -1,4 +1,4 @@
|
||||
version = "1.1.*"
|
||||
version = "1.2.*"
|
||||
upstream_repository = "https://github.com/scrapinghub/dateparser"
|
||||
|
||||
[tool.stubtest]
|
||||
|
@ -18,6 +18,7 @@ def get_last_day_of_month(year, month): ...
|
||||
def get_previous_leap_year(year): ...
|
||||
def get_next_leap_year(year): ...
|
||||
def set_correct_day_from_settings(date_obj, settings, current_day: Incomplete | None = None): ...
|
||||
def set_correct_month_from_settings(date_obj, settings, current_month=None): ...
|
||||
def registry(cls): ...
|
||||
def get_logger() -> Any: ...
|
||||
def setup_logging() -> None: ...
|
||||
|
@ -0,0 +1,3 @@
|
||||
version = "7.0.*"
|
||||
upstream_repository = "https://github.com/docker/docker-py"
|
||||
requires = ["types-requests", "urllib3>=2"]
|
@ -0,0 +1,7 @@
|
||||
from .api import APIClient as APIClient
|
||||
from .client import DockerClient as DockerClient, from_env as from_env
|
||||
from .context import Context as Context, ContextAPI as ContextAPI
|
||||
from .tls import TLSConfig as TLSConfig
|
||||
from .version import __version__ as __version__
|
||||
|
||||
__title__: str
|
@ -0,0 +1 @@
|
||||
from .client import APIClient as APIClient
|
@ -0,0 +1,55 @@
|
||||
from collections.abc import Generator
|
||||
from io import StringIO
|
||||
from logging import Logger
|
||||
from typing import IO, Any, TypedDict, type_check_only
|
||||
|
||||
log: Logger
|
||||
|
||||
@type_check_only
|
||||
class _ContainerLimits(TypedDict, total=False):
|
||||
memory: int
|
||||
memswap: int
|
||||
cpushares: int
|
||||
cpusetcpus: str
|
||||
|
||||
@type_check_only
|
||||
class _Filers(TypedDict, total=False):
|
||||
dangling: bool
|
||||
until: str
|
||||
|
||||
class BuildApiMixin:
|
||||
def build(
|
||||
self,
|
||||
path: str | None = None,
|
||||
tag: str | None = None,
|
||||
quiet: bool = False,
|
||||
fileobj: StringIO | IO[bytes] | None = None,
|
||||
nocache: bool = False,
|
||||
rm: bool = False,
|
||||
timeout: int | None = None,
|
||||
custom_context: bool = False,
|
||||
encoding: str | None = None,
|
||||
pull: bool = False,
|
||||
forcerm: bool = False,
|
||||
dockerfile: str | None = None,
|
||||
container_limits: _ContainerLimits | None = None,
|
||||
decode: bool = False,
|
||||
buildargs: dict[str, Any] | None = None,
|
||||
gzip: bool = False,
|
||||
shmsize: int | None = None,
|
||||
labels: dict[str, Any] | None = None,
|
||||
# need to use list, because the type must be json serializable
|
||||
cache_from: list[str] | None = None,
|
||||
target: str | None = None,
|
||||
network_mode: str | None = None,
|
||||
squash: bool | None = None,
|
||||
extra_hosts: list[str] | dict[str, str] | None = None,
|
||||
platform: str | None = None,
|
||||
isolation: str | None = None,
|
||||
use_config_proxy: bool = True,
|
||||
) -> Generator[Any, None, None]: ...
|
||||
def prune_builds(
|
||||
self, filters: _Filers | None = None, keep_storage: int | None = None, all: bool | None = None
|
||||
) -> dict[str, Any]: ...
|
||||
|
||||
def process_dockerfile(dockerfile: str | None, path: str) -> tuple[str | None, str | None]: ...
|
@ -0,0 +1,55 @@
|
||||
from _typeshed import Incomplete
|
||||
from collections.abc import Mapping, Sequence
|
||||
|
||||
import requests
|
||||
from docker.tls import TLSConfig
|
||||
from requests.adapters import BaseAdapter
|
||||
|
||||
from .build import BuildApiMixin
|
||||
from .config import ConfigApiMixin
|
||||
from .container import ContainerApiMixin
|
||||
from .daemon import DaemonApiMixin
|
||||
from .exec_api import ExecApiMixin
|
||||
from .image import ImageApiMixin
|
||||
from .network import NetworkApiMixin
|
||||
from .plugin import PluginApiMixin
|
||||
from .secret import SecretApiMixin
|
||||
from .service import ServiceApiMixin
|
||||
from .swarm import SwarmApiMixin
|
||||
from .volume import VolumeApiMixin
|
||||
|
||||
class APIClient(
|
||||
requests.Session,
|
||||
BuildApiMixin,
|
||||
ConfigApiMixin,
|
||||
ContainerApiMixin,
|
||||
DaemonApiMixin,
|
||||
ExecApiMixin,
|
||||
ImageApiMixin,
|
||||
NetworkApiMixin,
|
||||
PluginApiMixin,
|
||||
SecretApiMixin,
|
||||
ServiceApiMixin,
|
||||
SwarmApiMixin,
|
||||
VolumeApiMixin,
|
||||
):
|
||||
__attrs__: Sequence[str]
|
||||
base_url: str
|
||||
timeout: int
|
||||
credstore_env: Mapping[Incomplete, Incomplete] | None
|
||||
def __init__(
|
||||
self,
|
||||
base_url: str | None = None,
|
||||
version: str | None = None,
|
||||
timeout: int = 60,
|
||||
tls: bool | TLSConfig = False,
|
||||
user_agent: str = "docker-sdk-python/7.0.0",
|
||||
num_pools: int | None = None,
|
||||
credstore_env: Mapping[Incomplete, Incomplete] | None = None,
|
||||
use_ssh_client: bool = False,
|
||||
max_pool_size: int = 10,
|
||||
) -> None: ...
|
||||
def get_adapter(self, url: str) -> BaseAdapter: ...
|
||||
@property
|
||||
def api_version(self) -> str: ...
|
||||
def reload_config(self, dockercfg_path: str | None = None) -> None: ...
|
@ -0,0 +1,7 @@
|
||||
from _typeshed import Incomplete
|
||||
|
||||
class ConfigApiMixin:
|
||||
def create_config(self, name, data, labels: Incomplete | None = None, templating: Incomplete | None = None): ...
|
||||
def inspect_config(self, id): ...
|
||||
def remove_config(self, id): ...
|
||||
def configs(self, filters: Incomplete | None = None): ...
|
@ -0,0 +1,109 @@
|
||||
from _typeshed import Incomplete
|
||||
|
||||
class ContainerApiMixin:
|
||||
def attach(
|
||||
self, container, stdout: bool = True, stderr: bool = True, stream: bool = False, logs: bool = False, demux: bool = False
|
||||
): ...
|
||||
def attach_socket(self, container, params: Incomplete | None = None, ws: bool = False): ...
|
||||
def commit(
|
||||
self,
|
||||
container,
|
||||
repository: str | None = None,
|
||||
tag: str | None = None,
|
||||
message: Incomplete | None = None,
|
||||
author: Incomplete | None = None,
|
||||
pause: bool = True,
|
||||
changes: Incomplete | None = None,
|
||||
conf: Incomplete | None = None,
|
||||
): ...
|
||||
def containers(
|
||||
self,
|
||||
quiet: bool = False,
|
||||
all: bool = False,
|
||||
trunc: bool = False,
|
||||
latest: bool = False,
|
||||
since: Incomplete | None = None,
|
||||
before: Incomplete | None = None,
|
||||
limit: int = -1,
|
||||
size: bool = False,
|
||||
filters: Incomplete | None = None,
|
||||
): ...
|
||||
def create_container(
|
||||
self,
|
||||
image,
|
||||
command: Incomplete | None = None,
|
||||
hostname: Incomplete | None = None,
|
||||
user: Incomplete | None = None,
|
||||
detach: bool = False,
|
||||
stdin_open: bool = False,
|
||||
tty: bool = False,
|
||||
ports: Incomplete | None = None,
|
||||
environment: Incomplete | None = None,
|
||||
volumes: Incomplete | None = None,
|
||||
network_disabled: bool = False,
|
||||
name: Incomplete | None = None,
|
||||
entrypoint: Incomplete | None = None,
|
||||
working_dir: Incomplete | None = None,
|
||||
domainname: Incomplete | None = None,
|
||||
host_config: Incomplete | None = None,
|
||||
mac_address: Incomplete | None = None,
|
||||
labels: Incomplete | None = None,
|
||||
stop_signal: Incomplete | None = None,
|
||||
networking_config: Incomplete | None = None,
|
||||
healthcheck: Incomplete | None = None,
|
||||
stop_timeout: Incomplete | None = None,
|
||||
runtime: Incomplete | None = None,
|
||||
use_config_proxy: bool = True,
|
||||
platform: Incomplete | None = None,
|
||||
): ...
|
||||
def create_container_config(self, *args, **kwargs): ...
|
||||
def create_container_from_config(self, config, name: Incomplete | None = None, platform: Incomplete | None = None): ...
|
||||
def create_host_config(self, *args, **kwargs): ...
|
||||
def create_networking_config(self, *args, **kwargs): ...
|
||||
def create_endpoint_config(self, *args, **kwargs): ...
|
||||
def diff(self, container): ...
|
||||
def export(self, container, chunk_size=2097152): ...
|
||||
def get_archive(self, container, path, chunk_size=2097152, encode_stream: bool = False): ...
|
||||
def inspect_container(self, container): ...
|
||||
def kill(self, container, signal: Incomplete | None = None) -> None: ...
|
||||
def logs(
|
||||
self,
|
||||
container,
|
||||
stdout: bool = True,
|
||||
stderr: bool = True,
|
||||
stream: bool = False,
|
||||
timestamps: bool = False,
|
||||
tail: str = "all",
|
||||
since: Incomplete | None = None,
|
||||
follow: Incomplete | None = None,
|
||||
until: Incomplete | None = None,
|
||||
): ...
|
||||
def pause(self, container) -> None: ...
|
||||
def port(self, container, private_port): ...
|
||||
def put_archive(self, container, path, data): ...
|
||||
def prune_containers(self, filters: Incomplete | None = None): ...
|
||||
def remove_container(self, container, v: bool = False, link: bool = False, force: bool = False) -> None: ...
|
||||
def rename(self, container, name) -> None: ...
|
||||
def resize(self, container, height, width) -> None: ...
|
||||
def restart(self, container, timeout: int = 10) -> None: ...
|
||||
def start(self, container, *args, **kwargs) -> None: ...
|
||||
def stats(self, container, decode: Incomplete | None = None, stream: bool = True, one_shot: Incomplete | None = None): ...
|
||||
def stop(self, container, timeout: Incomplete | None = None) -> None: ...
|
||||
def top(self, container, ps_args: Incomplete | None = None): ...
|
||||
def unpause(self, container) -> None: ...
|
||||
def update_container(
|
||||
self,
|
||||
container,
|
||||
blkio_weight: Incomplete | None = None,
|
||||
cpu_period: Incomplete | None = None,
|
||||
cpu_quota: Incomplete | None = None,
|
||||
cpu_shares: Incomplete | None = None,
|
||||
cpuset_cpus: Incomplete | None = None,
|
||||
cpuset_mems: Incomplete | None = None,
|
||||
mem_limit: Incomplete | None = None,
|
||||
mem_reservation: Incomplete | None = None,
|
||||
memswap_limit: Incomplete | None = None,
|
||||
kernel_memory: Incomplete | None = None,
|
||||
restart_policy: Incomplete | None = None,
|
||||
): ...
|
||||
def wait(self, container, timeout: Incomplete | None = None, condition: Incomplete | None = None): ...
|
@ -0,0 +1,23 @@
|
||||
from _typeshed import Incomplete
|
||||
|
||||
class DaemonApiMixin:
|
||||
def df(self): ...
|
||||
def events(
|
||||
self,
|
||||
since: Incomplete | None = None,
|
||||
until: Incomplete | None = None,
|
||||
filters: Incomplete | None = None,
|
||||
decode: Incomplete | None = None,
|
||||
): ...
|
||||
def info(self): ...
|
||||
def login(
|
||||
self,
|
||||
username,
|
||||
password: Incomplete | None = None,
|
||||
email: Incomplete | None = None,
|
||||
registry: Incomplete | None = None,
|
||||
reauth: bool = False,
|
||||
dockercfg_path: Incomplete | None = None,
|
||||
): ...
|
||||
def ping(self): ...
|
||||
def version(self, api_version: bool = True): ...
|
@ -0,0 +1,22 @@
|
||||
from _typeshed import Incomplete
|
||||
|
||||
class ExecApiMixin:
|
||||
def exec_create(
|
||||
self,
|
||||
container,
|
||||
cmd,
|
||||
stdout: bool = True,
|
||||
stderr: bool = True,
|
||||
stdin: bool = False,
|
||||
tty: bool = False,
|
||||
privileged: bool = False,
|
||||
user: str = "",
|
||||
environment: Incomplete | None = None,
|
||||
workdir: Incomplete | None = None,
|
||||
detach_keys: Incomplete | None = None,
|
||||
): ...
|
||||
def exec_inspect(self, exec_id): ...
|
||||
def exec_resize(self, exec_id, height: Incomplete | None = None, width: Incomplete | None = None) -> None: ...
|
||||
def exec_start(
|
||||
self, exec_id, detach: bool = False, tty: bool = False, stream: bool = False, socket: bool = False, demux: bool = False
|
||||
): ...
|
@ -0,0 +1,59 @@
|
||||
from _typeshed import Incomplete
|
||||
|
||||
log: Incomplete
|
||||
|
||||
class ImageApiMixin:
|
||||
def get_image(self, image: str, chunk_size: int = 2097152): ...
|
||||
def history(self, image): ...
|
||||
def images(self, name: str | None = None, quiet: bool = False, all: bool = False, filters: Incomplete | None = None): ...
|
||||
def import_image(
|
||||
self,
|
||||
src: Incomplete | None = None,
|
||||
repository: str | None = None,
|
||||
tag: str | None = None,
|
||||
image: str | None = None,
|
||||
changes: Incomplete | None = None,
|
||||
stream_src: bool = False,
|
||||
): ...
|
||||
def import_image_from_data(
|
||||
self, data, repository: str | None = None, tag: str | None = None, changes: Incomplete | None = None
|
||||
): ...
|
||||
def import_image_from_file(
|
||||
self, filename: str, repository: str | None = None, tag: str | None = None, changes: Incomplete | None = None
|
||||
): ...
|
||||
def import_image_from_stream(
|
||||
self, stream, repository: str | None = None, tag: str | None = None, changes: Incomplete | None = None
|
||||
): ...
|
||||
def import_image_from_url(
|
||||
self, url, repository: str | None = None, tag: str | None = None, changes: Incomplete | None = None
|
||||
): ...
|
||||
def import_image_from_image(
|
||||
self, image, repository: str | None = None, tag: str | None = None, changes: Incomplete | None = None
|
||||
): ...
|
||||
def inspect_image(self, image): ...
|
||||
def inspect_distribution(self, image, auth_config: Incomplete | None = None): ...
|
||||
def load_image(self, data, quiet: Incomplete | None = None): ...
|
||||
def prune_images(self, filters: Incomplete | None = None): ...
|
||||
def pull(
|
||||
self,
|
||||
repository: str,
|
||||
tag: str | None = None,
|
||||
stream: bool = False,
|
||||
auth_config: Incomplete | None = None,
|
||||
decode: bool = False,
|
||||
platform: Incomplete | None = None,
|
||||
all_tags: bool = False,
|
||||
): ...
|
||||
def push(
|
||||
self,
|
||||
repository: str,
|
||||
tag: str | None = None,
|
||||
stream: bool = False,
|
||||
auth_config: Incomplete | None = None,
|
||||
decode: bool = False,
|
||||
): ...
|
||||
def remove_image(self, image: str, force: bool = False, noprune: bool = False): ...
|
||||
def search(self, term: str, limit: int | None = None): ...
|
||||
def tag(self, image, repository, tag: str | None = None, force: bool = False): ...
|
||||
|
||||
def is_file(src: str) -> bool: ...
|
@ -0,0 +1,34 @@
|
||||
from _typeshed import Incomplete
|
||||
|
||||
class NetworkApiMixin:
|
||||
def networks(self, names: Incomplete | None = None, ids: Incomplete | None = None, filters: Incomplete | None = None): ...
|
||||
def create_network(
|
||||
self,
|
||||
name,
|
||||
driver: Incomplete | None = None,
|
||||
options: Incomplete | None = None,
|
||||
ipam: Incomplete | None = None,
|
||||
check_duplicate: Incomplete | None = None,
|
||||
internal: bool = False,
|
||||
labels: Incomplete | None = None,
|
||||
enable_ipv6: bool = False,
|
||||
attachable: Incomplete | None = None,
|
||||
scope: Incomplete | None = None,
|
||||
ingress: Incomplete | None = None,
|
||||
): ...
|
||||
def prune_networks(self, filters: Incomplete | None = None): ...
|
||||
def remove_network(self, net_id) -> None: ...
|
||||
def inspect_network(self, net_id, verbose: Incomplete | None = None, scope: Incomplete | None = None): ...
|
||||
def connect_container_to_network(
|
||||
self,
|
||||
container,
|
||||
net_id,
|
||||
ipv4_address: Incomplete | None = None,
|
||||
ipv6_address: Incomplete | None = None,
|
||||
aliases: Incomplete | None = None,
|
||||
links: Incomplete | None = None,
|
||||
link_local_ips: Incomplete | None = None,
|
||||
driver_opt: Incomplete | None = None,
|
||||
mac_address: Incomplete | None = None,
|
||||
) -> None: ...
|
||||
def disconnect_container_from_network(self, container, net_id, force: bool = False) -> None: ...
|
@ -0,0 +1,14 @@
|
||||
from _typeshed import Incomplete
|
||||
|
||||
class PluginApiMixin:
|
||||
def configure_plugin(self, name, options): ...
|
||||
def create_plugin(self, name, plugin_data_dir, gzip: bool = False): ...
|
||||
def disable_plugin(self, name, force: bool = False): ...
|
||||
def enable_plugin(self, name, timeout: int = 0): ...
|
||||
def inspect_plugin(self, name): ...
|
||||
def pull_plugin(self, remote, privileges, name: Incomplete | None = None): ...
|
||||
def plugins(self): ...
|
||||
def plugin_privileges(self, name): ...
|
||||
def push_plugin(self, name): ...
|
||||
def remove_plugin(self, name, force: bool = False): ...
|
||||
def upgrade_plugin(self, name, remote, privileges): ...
|
@ -0,0 +1,7 @@
|
||||
from _typeshed import Incomplete
|
||||
|
||||
class SecretApiMixin:
|
||||
def create_secret(self, name, data, labels: Incomplete | None = None, driver: Incomplete | None = None): ...
|
||||
def inspect_secret(self, id): ...
|
||||
def remove_secret(self, id): ...
|
||||
def secrets(self, filters: Incomplete | None = None): ...
|
@ -0,0 +1,47 @@
|
||||
from _typeshed import Incomplete
|
||||
|
||||
class ServiceApiMixin:
|
||||
def create_service(
|
||||
self,
|
||||
task_template,
|
||||
name: Incomplete | None = None,
|
||||
labels: Incomplete | None = None,
|
||||
mode: Incomplete | None = None,
|
||||
update_config: Incomplete | None = None,
|
||||
networks: Incomplete | None = None,
|
||||
endpoint_config: Incomplete | None = None,
|
||||
endpoint_spec: Incomplete | None = None,
|
||||
rollback_config: Incomplete | None = None,
|
||||
): ...
|
||||
def inspect_service(self, service, insert_defaults: Incomplete | None = None): ...
|
||||
def inspect_task(self, task): ...
|
||||
def remove_service(self, service): ...
|
||||
def services(self, filters: Incomplete | None = None, status: Incomplete | None = None): ...
|
||||
def service_logs(
|
||||
self,
|
||||
service,
|
||||
details: bool = False,
|
||||
follow: bool = False,
|
||||
stdout: bool = False,
|
||||
stderr: bool = False,
|
||||
since: int = 0,
|
||||
timestamps: bool = False,
|
||||
tail: str = "all",
|
||||
is_tty: Incomplete | None = None,
|
||||
): ...
|
||||
def tasks(self, filters: Incomplete | None = None): ...
|
||||
def update_service(
|
||||
self,
|
||||
service,
|
||||
version,
|
||||
task_template: Incomplete | None = None,
|
||||
name: Incomplete | None = None,
|
||||
labels: Incomplete | None = None,
|
||||
mode: Incomplete | None = None,
|
||||
update_config: Incomplete | None = None,
|
||||
networks: Incomplete | None = None,
|
||||
endpoint_config: Incomplete | None = None,
|
||||
endpoint_spec: Incomplete | None = None,
|
||||
fetch_current_spec: bool = False,
|
||||
rollback_config: Incomplete | None = None,
|
||||
): ...
|
@ -0,0 +1,41 @@
|
||||
from _typeshed import Incomplete
|
||||
|
||||
log: Incomplete
|
||||
|
||||
class SwarmApiMixin:
|
||||
def create_swarm_spec(self, *args, **kwargs): ...
|
||||
def get_unlock_key(self): ...
|
||||
def init_swarm(
|
||||
self,
|
||||
advertise_addr: Incomplete | None = None,
|
||||
listen_addr: str = "0.0.0.0:2377",
|
||||
force_new_cluster: bool = False,
|
||||
swarm_spec: Incomplete | None = None,
|
||||
default_addr_pool: Incomplete | None = None,
|
||||
subnet_size: Incomplete | None = None,
|
||||
data_path_addr: Incomplete | None = None,
|
||||
data_path_port: Incomplete | None = None,
|
||||
): ...
|
||||
def inspect_swarm(self): ...
|
||||
def inspect_node(self, node_id): ...
|
||||
def join_swarm(
|
||||
self,
|
||||
remote_addrs,
|
||||
join_token,
|
||||
listen_addr: str = "0.0.0.0:2377",
|
||||
advertise_addr: Incomplete | None = None,
|
||||
data_path_addr: Incomplete | None = None,
|
||||
): ...
|
||||
def leave_swarm(self, force: bool = False): ...
|
||||
def nodes(self, filters: Incomplete | None = None): ...
|
||||
def remove_node(self, node_id, force: bool = False): ...
|
||||
def unlock_swarm(self, key): ...
|
||||
def update_node(self, node_id, version, node_spec: Incomplete | None = None): ...
|
||||
def update_swarm(
|
||||
self,
|
||||
version,
|
||||
swarm_spec: Incomplete | None = None,
|
||||
rotate_worker_token: bool = False,
|
||||
rotate_manager_token: bool = False,
|
||||
rotate_manager_unlock_key: bool = False,
|
||||
): ...
|
@ -0,0 +1,14 @@
|
||||
from _typeshed import Incomplete
|
||||
|
||||
class VolumeApiMixin:
|
||||
def volumes(self, filters: Incomplete | None = None): ...
|
||||
def create_volume(
|
||||
self,
|
||||
name: Incomplete | None = None,
|
||||
driver: Incomplete | None = None,
|
||||
driver_opts: Incomplete | None = None,
|
||||
labels: Incomplete | None = None,
|
||||
): ...
|
||||
def inspect_volume(self, name): ...
|
||||
def prune_volumes(self, filters: Incomplete | None = None): ...
|
||||
def remove_volume(self, name, force: bool = False) -> None: ...
|
@ -0,0 +1,40 @@
|
||||
from _typeshed import Incomplete
|
||||
|
||||
INDEX_NAME: str
|
||||
INDEX_URL: Incomplete
|
||||
TOKEN_USERNAME: str
|
||||
log: Incomplete
|
||||
|
||||
def resolve_repository_name(repo_name): ...
|
||||
def resolve_index_name(index_name): ...
|
||||
def get_config_header(client, registry): ...
|
||||
def split_repo_name(repo_name): ...
|
||||
def get_credential_store(authconfig, registry): ...
|
||||
|
||||
class AuthConfig(dict[str, Incomplete]):
|
||||
def __init__(self, dct, credstore_env: Incomplete | None = None) -> None: ...
|
||||
@classmethod
|
||||
def parse_auth(cls, entries, raise_on_error: bool = False): ...
|
||||
@classmethod
|
||||
def load_config(cls, config_path, config_dict, credstore_env: Incomplete | None = None): ...
|
||||
@property
|
||||
def auths(self): ...
|
||||
@property
|
||||
def creds_store(self): ...
|
||||
@property
|
||||
def cred_helpers(self): ...
|
||||
@property
|
||||
def is_empty(self): ...
|
||||
def resolve_authconfig(self, registry: Incomplete | None = None): ...
|
||||
def get_credential_store(self, registry): ...
|
||||
def get_all_credentials(self): ...
|
||||
def add_auth(self, reg, data) -> None: ...
|
||||
|
||||
def resolve_authconfig(authconfig, registry: Incomplete | None = None, credstore_env: Incomplete | None = None): ...
|
||||
def convert_to_hostname(url): ...
|
||||
def decode_auth(auth): ...
|
||||
def encode_header(auth): ...
|
||||
def parse_auth(entries, raise_on_error: bool = False): ...
|
||||
def load_config(
|
||||
config_path: Incomplete | None = None, config_dict: Incomplete | None = None, credstore_env: Incomplete | None = None
|
||||
): ...
|
@ -0,0 +1,49 @@
|
||||
from typing import NoReturn
|
||||
|
||||
from docker import APIClient
|
||||
from docker.models.configs import ConfigCollection
|
||||
from docker.models.containers import ContainerCollection
|
||||
from docker.models.images import ImageCollection
|
||||
from docker.models.networks import NetworkCollection
|
||||
from docker.models.nodes import NodeCollection
|
||||
from docker.models.plugins import PluginCollection
|
||||
from docker.models.secrets import SecretCollection
|
||||
from docker.models.services import ServiceCollection
|
||||
from docker.models.swarm import Swarm
|
||||
from docker.models.volumes import VolumeCollection
|
||||
|
||||
class DockerClient:
|
||||
api: APIClient
|
||||
def __init__(self, *args, **kwargs) -> None: ...
|
||||
@classmethod
|
||||
def from_env(cls, **kwargs) -> DockerClient: ...
|
||||
@property
|
||||
def configs(self) -> ConfigCollection: ...
|
||||
@property
|
||||
def containers(self) -> ContainerCollection: ...
|
||||
@property
|
||||
def images(self) -> ImageCollection: ...
|
||||
@property
|
||||
def networks(self) -> NetworkCollection: ...
|
||||
@property
|
||||
def nodes(self) -> NodeCollection: ...
|
||||
@property
|
||||
def plugins(self) -> PluginCollection: ...
|
||||
@property
|
||||
def secrets(self) -> SecretCollection: ...
|
||||
@property
|
||||
def services(self) -> ServiceCollection: ...
|
||||
@property
|
||||
def swarm(self) -> Swarm: ...
|
||||
@property
|
||||
def volumes(self) -> VolumeCollection: ...
|
||||
def events(self, *args, **kwargs): ...
|
||||
def df(self): ...
|
||||
def info(self, *args, **kwargs): ...
|
||||
def login(self, *args, **kwargs): ...
|
||||
def ping(self, *args, **kwargs): ...
|
||||
def version(self, *args, **kwargs): ...
|
||||
def close(self): ...
|
||||
def __getattr__(self, name: str) -> NoReturn: ...
|
||||
|
||||
from_env = DockerClient.from_env
|
@ -0,0 +1,22 @@
|
||||
from collections.abc import Mapping, Sequence
|
||||
from typing import Final
|
||||
|
||||
DEFAULT_DOCKER_API_VERSION: Final[str]
|
||||
MINIMUM_DOCKER_API_VERSION: Final[str]
|
||||
DEFAULT_TIMEOUT_SECONDS: Final[int]
|
||||
STREAM_HEADER_SIZE_BYTES: Final[int]
|
||||
CONTAINER_LIMITS_KEYS: Final[Sequence[str]]
|
||||
DEFAULT_HTTP_HOST: Final[str]
|
||||
DEFAULT_UNIX_SOCKET: Final[str]
|
||||
DEFAULT_NPIPE: Final[str]
|
||||
BYTE_UNITS: Final[Mapping[str, int]]
|
||||
INSECURE_REGISTRY_DEPRECATION_WARNING: Final[str]
|
||||
IS_WINDOWS_PLATFORM: Final[bool]
|
||||
WINDOWS_LONGPATH_PREFIX: Final[str]
|
||||
DEFAULT_USER_AGENT: Final[str]
|
||||
DEFAULT_NUM_POOLS: Final[int]
|
||||
DEFAULT_NUM_POOLS_SSH: Final[int]
|
||||
DEFAULT_MAX_POOL_SIZE: Final[int]
|
||||
DEFAULT_DATA_CHUNK_SIZE: Final[int]
|
||||
DEFAULT_SWARM_ADDR_POOL: Final[Sequence[str]]
|
||||
DEFAULT_SWARM_SUBNET_SIZE: Final[int]
|
@ -0,0 +1,2 @@
|
||||
from .api import ContextAPI as ContextAPI
|
||||
from .context import Context as Context
|
@ -0,0 +1,30 @@
|
||||
from _typeshed import Incomplete
|
||||
from collections.abc import Mapping, Sequence
|
||||
|
||||
from docker.context.context import Context
|
||||
from docker.tls import TLSConfig
|
||||
|
||||
class ContextAPI:
|
||||
DEFAULT_CONTEXT: Context
|
||||
@classmethod
|
||||
def create_context(
|
||||
cls,
|
||||
name: str,
|
||||
orchestrator: str | None = None,
|
||||
host: str | None = None,
|
||||
tls_cfg: TLSConfig | None = None,
|
||||
default_namespace: str | None = None,
|
||||
skip_tls_verify: bool = False,
|
||||
) -> Context: ...
|
||||
@classmethod
|
||||
def get_context(cls, name: str | None = None) -> Context: ...
|
||||
@classmethod
|
||||
def contexts(cls) -> Sequence[Context]: ...
|
||||
@classmethod
|
||||
def get_current_context(cls) -> Context: ...
|
||||
@classmethod
|
||||
def set_current_context(cls, name: str = "default") -> None: ...
|
||||
@classmethod
|
||||
def remove_context(cls, name: str) -> None: ...
|
||||
@classmethod
|
||||
def inspect_context(cls, name: str = "default") -> Mapping[str, Incomplete]: ...
|
@ -0,0 +1,10 @@
|
||||
METAFILE: str
|
||||
|
||||
def get_current_context_name() -> str: ...
|
||||
def write_context_name_to_docker_config(name: str | None = None) -> Exception | None: ...
|
||||
def get_context_id(name: str) -> str: ...
|
||||
def get_context_dir() -> str: ...
|
||||
def get_meta_dir(name: str | None = None) -> str: ...
|
||||
def get_meta_file(name: str) -> str: ...
|
||||
def get_tls_dir(name: str | None = None, endpoint: str = "") -> str: ...
|
||||
def get_context_host(path: str | None = None, tls: bool = False) -> str: ...
|
@ -0,0 +1,47 @@
|
||||
from _typeshed import Incomplete
|
||||
|
||||
class Context:
|
||||
name: Incomplete
|
||||
context_type: Incomplete
|
||||
orchestrator: Incomplete
|
||||
endpoints: Incomplete
|
||||
tls_cfg: Incomplete
|
||||
meta_path: str
|
||||
tls_path: str
|
||||
def __init__(
|
||||
self,
|
||||
name,
|
||||
orchestrator: Incomplete | None = None,
|
||||
host: Incomplete | None = None,
|
||||
endpoints: Incomplete | None = None,
|
||||
tls: bool = False,
|
||||
) -> None: ...
|
||||
def set_endpoint(
|
||||
self,
|
||||
name: str = "docker",
|
||||
host: Incomplete | None = None,
|
||||
tls_cfg: Incomplete | None = None,
|
||||
skip_tls_verify: bool = False,
|
||||
def_namespace: Incomplete | None = None,
|
||||
) -> None: ...
|
||||
def inspect(self): ...
|
||||
@classmethod
|
||||
def load_context(cls, name): ...
|
||||
def save(self) -> None: ...
|
||||
def remove(self) -> None: ...
|
||||
def __call__(self): ...
|
||||
def is_docker_host(self): ...
|
||||
@property
|
||||
def Name(self): ...
|
||||
@property
|
||||
def Host(self): ...
|
||||
@property
|
||||
def Orchestrator(self): ...
|
||||
@property
|
||||
def Metadata(self): ...
|
||||
@property
|
||||
def TLSConfig(self): ...
|
||||
@property
|
||||
def TLSMaterial(self): ...
|
||||
@property
|
||||
def Storage(self): ...
|
@ -0,0 +1,8 @@
|
||||
from .constants import (
|
||||
DEFAULT_LINUX_STORE as DEFAULT_LINUX_STORE,
|
||||
DEFAULT_OSX_STORE as DEFAULT_OSX_STORE,
|
||||
DEFAULT_WIN32_STORE as DEFAULT_WIN32_STORE,
|
||||
PROGRAM_PREFIX as PROGRAM_PREFIX,
|
||||
)
|
||||
from .errors import CredentialsNotFound as CredentialsNotFound, StoreError as StoreError
|
||||
from .store import Store as Store
|
@ -0,0 +1,4 @@
|
||||
PROGRAM_PREFIX: str
|
||||
DEFAULT_LINUX_STORE: str
|
||||
DEFAULT_OSX_STORE: str
|
||||
DEFAULT_WIN32_STORE: str
|
@ -0,0 +1,7 @@
|
||||
from subprocess import CalledProcessError
|
||||
|
||||
class StoreError(RuntimeError): ...
|
||||
class CredentialsNotFound(StoreError): ...
|
||||
class InitializationError(StoreError): ...
|
||||
|
||||
def process_store_error(cpe: CalledProcessError, program: str) -> Exception: ...
|
@ -0,0 +1,11 @@
|
||||
from _typeshed import Incomplete
|
||||
|
||||
class Store:
|
||||
program: Incomplete
|
||||
exe: Incomplete
|
||||
environment: Incomplete
|
||||
def __init__(self, program, environment: Incomplete | None = None) -> None: ...
|
||||
def get(self, server): ...
|
||||
def store(self, server, username, secret): ...
|
||||
def erase(self, server) -> None: ...
|
||||
def list(self): ...
|
@ -0,0 +1 @@
|
||||
def create_environment_dict(overrides): ...
|
@ -0,0 +1,71 @@
|
||||
from _typeshed import Incomplete
|
||||
from collections.abc import Mapping
|
||||
from typing import NoReturn
|
||||
|
||||
from docker.models.containers import Container
|
||||
from requests import HTTPError, Response
|
||||
|
||||
class DockerException(Exception): ...
|
||||
|
||||
def create_api_error_from_http_exception(e: HTTPError) -> NoReturn: ...
|
||||
|
||||
class APIError(HTTPError, DockerException):
|
||||
response: Response | None
|
||||
explanation: str | None
|
||||
def __init__(self, message: str, response: Response | None = None, explanation: str | None = None) -> None: ...
|
||||
@property
|
||||
def status_code(self) -> int | None: ...
|
||||
def is_error(self) -> bool: ...
|
||||
def is_client_error(self) -> bool: ...
|
||||
def is_server_error(self) -> bool: ...
|
||||
|
||||
class NotFound(APIError): ...
|
||||
class ImageNotFound(NotFound): ...
|
||||
class InvalidVersion(DockerException): ...
|
||||
class InvalidRepository(DockerException): ...
|
||||
class InvalidConfigFile(DockerException): ...
|
||||
class InvalidArgument(DockerException): ...
|
||||
class DeprecatedMethod(DockerException): ...
|
||||
|
||||
class TLSParameterError(DockerException):
|
||||
msg: str
|
||||
def __init__(self, msg: str) -> None: ...
|
||||
|
||||
class NullResource(DockerException, ValueError): ...
|
||||
|
||||
class ContainerError(DockerException):
|
||||
container: Container
|
||||
exit_status: Incomplete
|
||||
command: Incomplete
|
||||
image: Incomplete
|
||||
stderr: str | None
|
||||
def __init__(self, container: Container, exit_status, command, image, stderr: str | None) -> None: ...
|
||||
|
||||
class StreamParseError(RuntimeError):
|
||||
msg: str
|
||||
def __init__(self, reason: str) -> None: ...
|
||||
|
||||
class BuildError(DockerException):
|
||||
msg: str
|
||||
build_log: str
|
||||
def __init__(self, reason: str, build_log: str) -> None: ...
|
||||
|
||||
class ImageLoadError(DockerException): ...
|
||||
|
||||
def create_unexpected_kwargs_error(name, kwargs: Mapping[str, Incomplete]) -> NoReturn: ...
|
||||
|
||||
class MissingContextParameter(DockerException):
|
||||
param: str
|
||||
def __init__(self, param: str) -> None: ...
|
||||
|
||||
class ContextAlreadyExists(DockerException):
|
||||
name: str
|
||||
def __init__(self, name: str) -> None: ...
|
||||
|
||||
class ContextException(DockerException):
|
||||
msg: str
|
||||
def __init__(self, msg: str) -> None: ...
|
||||
|
||||
class ContextNotFound(DockerException):
|
||||
name: str
|
||||
def __init__(self, name: str) -> None: ...
|
@ -0,0 +1,13 @@
|
||||
from .resource import Collection, Model
|
||||
|
||||
class Config(Model):
|
||||
id_attribute: str
|
||||
@property
|
||||
def name(self): ...
|
||||
def remove(self): ...
|
||||
|
||||
class ConfigCollection(Collection):
|
||||
model: type[Config]
|
||||
def create(self, **kwargs): ...
|
||||
def get(self, config_id): ...
|
||||
def list(self, **kwargs): ...
|
@ -0,0 +1,81 @@
|
||||
from _typeshed import Incomplete
|
||||
from typing import NamedTuple
|
||||
|
||||
from .resource import Collection, Model
|
||||
|
||||
class Container(Model):
|
||||
@property
|
||||
def name(self): ...
|
||||
@property
|
||||
def image(self): ...
|
||||
@property
|
||||
def labels(self): ...
|
||||
@property
|
||||
def status(self): ...
|
||||
@property
|
||||
def health(self): ...
|
||||
@property
|
||||
def ports(self): ...
|
||||
def attach(self, **kwargs): ...
|
||||
def attach_socket(self, **kwargs): ...
|
||||
def commit(self, repository: str | None = None, tag: str | None = None, **kwargs): ...
|
||||
def diff(self): ...
|
||||
def exec_run(
|
||||
self,
|
||||
cmd,
|
||||
stdout: bool = True,
|
||||
stderr: bool = True,
|
||||
stdin: bool = False,
|
||||
tty: bool = False,
|
||||
privileged: bool = False,
|
||||
user: str = "",
|
||||
detach: bool = False,
|
||||
stream: bool = False,
|
||||
socket: bool = False,
|
||||
environment: Incomplete | None = None,
|
||||
workdir: Incomplete | None = None,
|
||||
demux: bool = False,
|
||||
): ...
|
||||
def export(self, chunk_size=2097152): ...
|
||||
def get_archive(self, path, chunk_size=2097152, encode_stream: bool = False): ...
|
||||
def kill(self, signal: Incomplete | None = None): ...
|
||||
def logs(self, **kwargs): ...
|
||||
def pause(self): ...
|
||||
def put_archive(self, path, data): ...
|
||||
def remove(self, **kwargs): ...
|
||||
def rename(self, name): ...
|
||||
def resize(self, height, width): ...
|
||||
def restart(self, **kwargs): ...
|
||||
def start(self, **kwargs): ...
|
||||
def stats(self, **kwargs): ...
|
||||
def stop(self, **kwargs): ...
|
||||
def top(self, **kwargs): ...
|
||||
def unpause(self): ...
|
||||
def update(self, **kwargs): ...
|
||||
def wait(self, **kwargs): ...
|
||||
|
||||
class ContainerCollection(Collection):
|
||||
model: type[Container]
|
||||
def run(
|
||||
self, image, command: Incomplete | None = None, stdout: bool = True, stderr: bool = False, remove: bool = False, **kwargs
|
||||
): ...
|
||||
def create(self, image, command: Incomplete | None = None, **kwargs): ... # type:ignore[override]
|
||||
def get(self, container_id): ...
|
||||
def list(
|
||||
self,
|
||||
all: bool = False,
|
||||
before: Incomplete | None = None,
|
||||
filters: Incomplete | None = None,
|
||||
limit: int = -1,
|
||||
since: Incomplete | None = None,
|
||||
sparse: bool = False,
|
||||
ignore_removed: bool = False,
|
||||
): ...
|
||||
def prune(self, filters: Incomplete | None = None): ...
|
||||
|
||||
RUN_CREATE_KWARGS: Incomplete
|
||||
RUN_HOST_CONFIG_KWARGS: Incomplete
|
||||
|
||||
class ExecResult(NamedTuple):
|
||||
exit_code: Incomplete
|
||||
output: Incomplete
|
@ -0,0 +1,43 @@
|
||||
from _typeshed import Incomplete
|
||||
|
||||
from .resource import Collection, Model
|
||||
|
||||
class Image(Model):
|
||||
@property
|
||||
def labels(self): ...
|
||||
@property
|
||||
def short_id(self): ...
|
||||
@property
|
||||
def tags(self): ...
|
||||
def history(self): ...
|
||||
def remove(self, force: bool = False, noprune: bool = False): ...
|
||||
def save(self, chunk_size=2097152, named: bool = False): ...
|
||||
def tag(self, repository, tag: str | None = None, **kwargs): ...
|
||||
|
||||
class RegistryData(Model):
|
||||
image_name: Incomplete
|
||||
def __init__(self, image_name, *args, **kwargs) -> None: ...
|
||||
@property
|
||||
def id(self): ...
|
||||
@property
|
||||
def short_id(self): ...
|
||||
def pull(self, platform: Incomplete | None = None): ...
|
||||
def has_platform(self, platform): ...
|
||||
attrs: Incomplete
|
||||
def reload(self) -> None: ...
|
||||
|
||||
class ImageCollection(Collection):
|
||||
model: type[Image]
|
||||
def build(self, **kwargs): ...
|
||||
def get(self, name): ...
|
||||
def get_registry_data(self, name, auth_config: Incomplete | None = None): ...
|
||||
def list(self, name: Incomplete | None = None, all: bool = False, filters: Incomplete | None = None): ...
|
||||
def load(self, data): ...
|
||||
def pull(self, repository, tag: str | None = None, all_tags: bool = False, **kwargs): ...
|
||||
def push(self, repository, tag: str | None = None, **kwargs): ...
|
||||
def remove(self, *args, **kwargs) -> None: ...
|
||||
def search(self, *args, **kwargs): ...
|
||||
def prune(self, filters: Incomplete | None = None): ...
|
||||
def prune_builds(self, *args, **kwargs): ...
|
||||
|
||||
def normalize_platform(platform, engine_info): ...
|
@ -0,0 +1,19 @@
|
||||
from _typeshed import Incomplete
|
||||
|
||||
from .resource import Collection, Model
|
||||
|
||||
class Network(Model):
|
||||
@property
|
||||
def name(self): ...
|
||||
@property
|
||||
def containers(self): ...
|
||||
def connect(self, container, *args, **kwargs): ...
|
||||
def disconnect(self, container, *args, **kwargs): ...
|
||||
def remove(self): ...
|
||||
|
||||
class NetworkCollection(Collection):
|
||||
model: type[Network]
|
||||
def create(self, name, *args, **kwargs): ...
|
||||
def get(self, network_id, *args, **kwargs): ...
|
||||
def list(self, *args, **kwargs): ...
|
||||
def prune(self, filters: Incomplete | None = None): ...
|
@ -0,0 +1,13 @@
|
||||
from .resource import Collection, Model
|
||||
|
||||
class Node(Model):
|
||||
id_attribute: str
|
||||
@property
|
||||
def version(self): ...
|
||||
def update(self, node_spec): ...
|
||||
def remove(self, force: bool = False): ...
|
||||
|
||||
class NodeCollection(Collection):
|
||||
model: type[Node]
|
||||
def get(self, node_id): ...
|
||||
def list(self, *args, **kwargs): ...
|
@ -0,0 +1,25 @@
|
||||
from _typeshed import Incomplete
|
||||
from collections.abc import Generator
|
||||
|
||||
from .resource import Collection, Model
|
||||
|
||||
class Plugin(Model):
|
||||
@property
|
||||
def name(self): ...
|
||||
@property
|
||||
def enabled(self): ...
|
||||
@property
|
||||
def settings(self): ...
|
||||
def configure(self, options) -> None: ...
|
||||
def disable(self, force: bool = False) -> None: ...
|
||||
def enable(self, timeout: int = 0) -> None: ...
|
||||
def push(self): ...
|
||||
def remove(self, force: bool = False): ...
|
||||
def upgrade(self, remote: Incomplete | None = None) -> Generator[Incomplete, Incomplete, None]: ...
|
||||
|
||||
class PluginCollection(Collection):
|
||||
model: type[Plugin]
|
||||
def create(self, name, plugin_data_dir, gzip: bool = False): ... # type:ignore[override]
|
||||
def get(self, name): ...
|
||||
def install(self, remote_name, local_name: Incomplete | None = None): ...
|
||||
def list(self): ...
|
@ -0,0 +1,27 @@
|
||||
from _typeshed import Incomplete
|
||||
|
||||
class Model:
|
||||
id_attribute: str
|
||||
client: Incomplete
|
||||
collection: Incomplete
|
||||
attrs: Incomplete
|
||||
def __init__(
|
||||
self, attrs: Incomplete | None = None, client: Incomplete | None = None, collection: Incomplete | None = None
|
||||
) -> None: ...
|
||||
def __eq__(self, other): ...
|
||||
def __hash__(self): ...
|
||||
@property
|
||||
def id(self): ...
|
||||
@property
|
||||
def short_id(self): ...
|
||||
def reload(self) -> None: ...
|
||||
|
||||
class Collection:
|
||||
model: Incomplete
|
||||
client: Incomplete
|
||||
def __init__(self, client: Incomplete | None = None) -> None: ...
|
||||
def __call__(self, *args, **kwargs) -> None: ...
|
||||
def list(self) -> None: ...
|
||||
def get(self, key) -> None: ...
|
||||
def create(self, attrs: Incomplete | None = None) -> None: ...
|
||||
def prepare_model(self, attrs): ...
|
@ -0,0 +1,13 @@
|
||||
from .resource import Collection, Model
|
||||
|
||||
class Secret(Model):
|
||||
id_attribute: str
|
||||
@property
|
||||
def name(self): ...
|
||||
def remove(self): ...
|
||||
|
||||
class SecretCollection(Collection):
|
||||
model: type[Secret]
|
||||
def create(self, **kwargs): ...
|
||||
def get(self, secret_id): ...
|
||||
def list(self, **kwargs): ...
|
@ -0,0 +1,27 @@
|
||||
from _typeshed import Incomplete
|
||||
|
||||
from .resource import Collection, Model
|
||||
|
||||
class Service(Model):
|
||||
id_attribute: str
|
||||
@property
|
||||
def name(self): ...
|
||||
@property
|
||||
def version(self): ...
|
||||
def remove(self): ...
|
||||
def tasks(self, filters: Incomplete | None = None): ...
|
||||
def update(self, **kwargs): ...
|
||||
def logs(self, **kwargs): ...
|
||||
def scale(self, replicas): ...
|
||||
def force_update(self): ...
|
||||
|
||||
class ServiceCollection(Collection):
|
||||
model: type[Service]
|
||||
def create(self, image, command: Incomplete | None = None, **kwargs): ... # type:ignore[override]
|
||||
def get(self, service_id, insert_defaults: Incomplete | None = None): ...
|
||||
def list(self, **kwargs): ...
|
||||
|
||||
CONTAINER_SPEC_KWARGS: Incomplete
|
||||
TASK_TEMPLATE_KWARGS: Incomplete
|
||||
CREATE_SERVICE_KWARGS: Incomplete
|
||||
PLACEMENT_KWARGS: Incomplete
|
@ -0,0 +1,33 @@
|
||||
from _typeshed import Incomplete
|
||||
|
||||
from .resource import Model
|
||||
|
||||
class Swarm(Model):
|
||||
id_attribute: str
|
||||
def __init__(self, *args, **kwargs) -> None: ...
|
||||
@property
|
||||
def version(self): ...
|
||||
def get_unlock_key(self): ...
|
||||
def init(
|
||||
self,
|
||||
advertise_addr: Incomplete | None = None,
|
||||
listen_addr: str = "0.0.0.0:2377",
|
||||
force_new_cluster: bool = False,
|
||||
default_addr_pool: Incomplete | None = None,
|
||||
subnet_size: Incomplete | None = None,
|
||||
data_path_addr: Incomplete | None = None,
|
||||
data_path_port: Incomplete | None = None,
|
||||
**kwargs,
|
||||
): ...
|
||||
def join(self, *args, **kwargs): ...
|
||||
def leave(self, *args, **kwargs): ...
|
||||
attrs: Incomplete
|
||||
def reload(self) -> None: ...
|
||||
def unlock(self, key): ...
|
||||
def update(
|
||||
self,
|
||||
rotate_worker_token: bool = False,
|
||||
rotate_manager_token: bool = False,
|
||||
rotate_manager_unlock_key: bool = False,
|
||||
**kwargs,
|
||||
): ...
|
@ -0,0 +1,16 @@
|
||||
from _typeshed import Incomplete
|
||||
|
||||
from .resource import Collection, Model
|
||||
|
||||
class Volume(Model):
|
||||
id_attribute: str
|
||||
@property
|
||||
def name(self): ...
|
||||
def remove(self, force: bool = False): ...
|
||||
|
||||
class VolumeCollection(Collection):
|
||||
model: type[Volume]
|
||||
def create(self, name: Incomplete | None = None, **kwargs): ... # type:ignore[override]
|
||||
def get(self, volume_id): ...
|
||||
def list(self, **kwargs): ...
|
||||
def prune(self, filters: Incomplete | None = None): ...
|
@ -0,0 +1,10 @@
|
||||
from docker import APIClient
|
||||
|
||||
class TLSConfig:
|
||||
cert: tuple[str, str] | None
|
||||
ca_cert: str | None
|
||||
verify: bool | str | None
|
||||
def __init__(
|
||||
self, client_cert: tuple[str, str] | None = None, ca_cert: str | None = None, verify: bool | str | None = None
|
||||
) -> None: ...
|
||||
def configure_client(self, client: APIClient) -> None: ...
|
@ -0,0 +1,4 @@
|
||||
from .npipeconn import NpipeHTTPAdapter as NpipeHTTPAdapter
|
||||
from .npipesocket import NpipeSocket as NpipeSocket
|
||||
from .sshconn import SSHHTTPAdapter as SSHHTTPAdapter
|
||||
from .unixconn import UnixHTTPAdapter as UnixHTTPAdapter
|
@ -0,0 +1,4 @@
|
||||
import requests.adapters
|
||||
|
||||
class BaseHTTPAdapter(requests.adapters.HTTPAdapter):
|
||||
def close(self) -> None: ...
|
@ -0,0 +1,29 @@
|
||||
from _typeshed import Incomplete
|
||||
|
||||
import urllib3
|
||||
import urllib3.connection
|
||||
from docker.transport.basehttpadapter import BaseHTTPAdapter
|
||||
|
||||
RecentlyUsedContainer: Incomplete
|
||||
|
||||
class NpipeHTTPConnection(urllib3.connection.HTTPConnection):
|
||||
npipe_path: Incomplete
|
||||
timeout: Incomplete
|
||||
def __init__(self, npipe_path, timeout: int = 60) -> None: ...
|
||||
sock: Incomplete
|
||||
def connect(self) -> None: ...
|
||||
|
||||
class NpipeHTTPConnectionPool(urllib3.connectionpool.HTTPConnectionPool):
|
||||
npipe_path: Incomplete
|
||||
timeout: Incomplete
|
||||
def __init__(self, npipe_path, timeout: int = 60, maxsize: int = 10) -> None: ...
|
||||
|
||||
class NpipeHTTPAdapter(BaseHTTPAdapter):
|
||||
__attrs__: Incomplete
|
||||
npipe_path: Incomplete
|
||||
timeout: Incomplete
|
||||
max_pool_size: Incomplete
|
||||
pools: Incomplete
|
||||
def __init__(self, base_url, timeout: int = 60, pool_connections=..., max_pool_size=...) -> None: ...
|
||||
def get_connection(self, url, proxies: Incomplete | None = None): ...
|
||||
def request_url(self, request, proxies): ...
|
@ -0,0 +1,49 @@
|
||||
import io
|
||||
from _typeshed import Incomplete
|
||||
|
||||
cERROR_PIPE_BUSY: int
|
||||
cSECURITY_SQOS_PRESENT: int
|
||||
cSECURITY_ANONYMOUS: int
|
||||
MAXIMUM_RETRY_COUNT: int
|
||||
|
||||
def check_closed(f): ...
|
||||
|
||||
class NpipeSocket:
|
||||
def __init__(self, handle: Incomplete | None = None) -> None: ...
|
||||
def accept(self) -> None: ...
|
||||
def bind(self, address) -> None: ...
|
||||
def close(self) -> None: ...
|
||||
flags: Incomplete
|
||||
def connect(self, address, retry_count: int = 0): ...
|
||||
def connect_ex(self, address): ...
|
||||
def detach(self): ...
|
||||
def dup(self): ...
|
||||
def getpeername(self): ...
|
||||
def getsockname(self): ...
|
||||
def getsockopt(self, level, optname, buflen: Incomplete | None = None) -> None: ...
|
||||
def ioctl(self, control, option) -> None: ...
|
||||
def listen(self, backlog) -> None: ...
|
||||
def makefile(self, mode: Incomplete | None = None, bufsize: Incomplete | None = None): ...
|
||||
def recv(self, bufsize, flags: int = 0): ...
|
||||
def recvfrom(self, bufsize, flags: int = 0): ...
|
||||
def recvfrom_into(self, buf, nbytes: int = 0, flags: int = 0): ...
|
||||
def recv_into(self, buf, nbytes: int = 0): ...
|
||||
def send(self, string, flags: int = 0): ...
|
||||
def sendall(self, string, flags: int = 0): ...
|
||||
def sendto(self, string, address): ...
|
||||
def setblocking(self, flag): ...
|
||||
def settimeout(self, value) -> None: ...
|
||||
def gettimeout(self): ...
|
||||
def setsockopt(self, level, optname, value) -> None: ...
|
||||
def shutdown(self, how): ...
|
||||
|
||||
class NpipeFileIOBase(io.RawIOBase):
|
||||
sock: Incomplete
|
||||
def __init__(self, npipe_socket) -> None: ...
|
||||
def close(self) -> None: ...
|
||||
def fileno(self): ...
|
||||
def isatty(self): ...
|
||||
def readable(self): ...
|
||||
def readinto(self, buf): ...
|
||||
def seekable(self): ...
|
||||
def writable(self): ...
|
@ -0,0 +1,49 @@
|
||||
import socket
|
||||
from _typeshed import Incomplete
|
||||
|
||||
import urllib3
|
||||
import urllib3.connection
|
||||
from docker.transport.basehttpadapter import BaseHTTPAdapter
|
||||
|
||||
RecentlyUsedContainer: Incomplete
|
||||
|
||||
class SSHSocket(socket.socket):
|
||||
host: Incomplete
|
||||
port: Incomplete
|
||||
user: Incomplete
|
||||
proc: Incomplete
|
||||
def __init__(self, host) -> None: ...
|
||||
def connect(self, **kwargs) -> None: ... # type:ignore[override]
|
||||
def sendall(self, data) -> None: ... # type:ignore[override]
|
||||
def send(self, data): ...
|
||||
def recv(self, n): ...
|
||||
def makefile(self, mode): ...
|
||||
def close(self) -> None: ...
|
||||
|
||||
class SSHConnection(urllib3.connection.HTTPConnection):
|
||||
ssh_transport: Incomplete
|
||||
timeout: Incomplete
|
||||
ssh_host: Incomplete
|
||||
def __init__(self, ssh_transport: Incomplete | None = None, timeout: int = 60, host: Incomplete | None = None) -> None: ...
|
||||
sock: Incomplete
|
||||
def connect(self) -> None: ...
|
||||
|
||||
class SSHConnectionPool(urllib3.connectionpool.HTTPConnectionPool):
|
||||
scheme: str
|
||||
ssh_transport: Incomplete
|
||||
timeout: Incomplete
|
||||
ssh_host: Incomplete
|
||||
def __init__(
|
||||
self, ssh_client: Incomplete | None = None, timeout: int = 60, maxsize: int = 10, host: Incomplete | None = None
|
||||
) -> None: ...
|
||||
|
||||
class SSHHTTPAdapter(BaseHTTPAdapter):
|
||||
__attrs__: Incomplete
|
||||
ssh_client: Incomplete
|
||||
ssh_host: Incomplete
|
||||
timeout: Incomplete
|
||||
max_pool_size: Incomplete
|
||||
pools: Incomplete
|
||||
def __init__(self, base_url, timeout: int = 60, pool_connections=..., max_pool_size=..., shell_out: bool = False) -> None: ...
|
||||
def get_connection(self, url, proxies: Incomplete | None = None): ...
|
||||
def close(self) -> None: ...
|
@ -0,0 +1,31 @@
|
||||
from _typeshed import Incomplete
|
||||
|
||||
import urllib3
|
||||
import urllib3.connection
|
||||
from docker.transport.basehttpadapter import BaseHTTPAdapter
|
||||
|
||||
RecentlyUsedContainer: Incomplete
|
||||
|
||||
class UnixHTTPConnection(urllib3.connection.HTTPConnection):
|
||||
base_url: Incomplete
|
||||
unix_socket: Incomplete
|
||||
timeout: Incomplete
|
||||
def __init__(self, base_url, unix_socket, timeout: int = 60) -> None: ...
|
||||
sock: Incomplete
|
||||
def connect(self) -> None: ...
|
||||
|
||||
class UnixHTTPConnectionPool(urllib3.connectionpool.HTTPConnectionPool):
|
||||
base_url: Incomplete
|
||||
socket_path: Incomplete
|
||||
timeout: Incomplete
|
||||
def __init__(self, base_url, socket_path, timeout: int = 60, maxsize: int = 10) -> None: ...
|
||||
|
||||
class UnixHTTPAdapter(BaseHTTPAdapter):
|
||||
__attrs__: Incomplete
|
||||
socket_path: Incomplete
|
||||
timeout: Incomplete
|
||||
max_pool_size: Incomplete
|
||||
pools: Incomplete
|
||||
def __init__(self, socket_url, timeout: int = 60, pool_connections=25, max_pool_size=10) -> None: ...
|
||||
def get_connection(self, url, proxies: Incomplete | None = None): ...
|
||||
def request_url(self, request, proxies): ...
|
@ -0,0 +1,35 @@
|
||||
from .containers import (
|
||||
ContainerConfig as ContainerConfig,
|
||||
DeviceRequest as DeviceRequest,
|
||||
HostConfig as HostConfig,
|
||||
LogConfig as LogConfig,
|
||||
Ulimit as Ulimit,
|
||||
)
|
||||
from .daemon import CancellableStream as CancellableStream
|
||||
from .healthcheck import Healthcheck as Healthcheck
|
||||
from .networks import (
|
||||
EndpointConfig as EndpointConfig,
|
||||
IPAMConfig as IPAMConfig,
|
||||
IPAMPool as IPAMPool,
|
||||
NetworkingConfig as NetworkingConfig,
|
||||
)
|
||||
from .services import (
|
||||
ConfigReference as ConfigReference,
|
||||
ContainerSpec as ContainerSpec,
|
||||
DNSConfig as DNSConfig,
|
||||
DriverConfig as DriverConfig,
|
||||
EndpointSpec as EndpointSpec,
|
||||
Mount as Mount,
|
||||
NetworkAttachmentConfig as NetworkAttachmentConfig,
|
||||
Placement as Placement,
|
||||
PlacementPreference as PlacementPreference,
|
||||
Privileges as Privileges,
|
||||
Resources as Resources,
|
||||
RestartPolicy as RestartPolicy,
|
||||
RollbackConfig as RollbackConfig,
|
||||
SecretReference as SecretReference,
|
||||
ServiceMode as ServiceMode,
|
||||
TaskTemplate as TaskTemplate,
|
||||
UpdateConfig as UpdateConfig,
|
||||
)
|
||||
from .swarm import SwarmExternalCA as SwarmExternalCA, SwarmSpec as SwarmSpec
|
@ -0,0 +1,5 @@
|
||||
from _typeshed import Incomplete
|
||||
from collections.abc import Mapping
|
||||
|
||||
class DictType(dict[str, Incomplete]):
|
||||
def __init__(self, init: Mapping[str, Incomplete]) -> None: ...
|
@ -0,0 +1,164 @@
|
||||
from _typeshed import Incomplete
|
||||
|
||||
from .base import DictType
|
||||
|
||||
class LogConfigTypesEnum:
|
||||
JSON: Incomplete
|
||||
SYSLOG: Incomplete
|
||||
JOURNALD: Incomplete
|
||||
GELF: Incomplete
|
||||
FLUENTD: Incomplete
|
||||
NONE: Incomplete
|
||||
|
||||
class LogConfig(DictType):
|
||||
types: type[LogConfigTypesEnum]
|
||||
def __init__(self, **kwargs) -> None: ...
|
||||
@property
|
||||
def type(self): ...
|
||||
@type.setter
|
||||
def type(self, value) -> None: ...
|
||||
@property
|
||||
def config(self): ...
|
||||
def set_config_value(self, key, value) -> None: ...
|
||||
def unset_config(self, key) -> None: ...
|
||||
|
||||
class Ulimit(DictType):
|
||||
def __init__(self, **kwargs) -> None: ...
|
||||
@property
|
||||
def name(self): ...
|
||||
@name.setter
|
||||
def name(self, value) -> None: ...
|
||||
@property
|
||||
def soft(self): ...
|
||||
@soft.setter
|
||||
def soft(self, value) -> None: ...
|
||||
@property
|
||||
def hard(self): ...
|
||||
@hard.setter
|
||||
def hard(self, value) -> None: ...
|
||||
|
||||
class DeviceRequest(DictType):
|
||||
def __init__(self, **kwargs) -> None: ...
|
||||
@property
|
||||
def driver(self): ...
|
||||
@driver.setter
|
||||
def driver(self, value) -> None: ...
|
||||
@property
|
||||
def count(self): ...
|
||||
@count.setter
|
||||
def count(self, value) -> None: ...
|
||||
@property
|
||||
def device_ids(self): ...
|
||||
@device_ids.setter
|
||||
def device_ids(self, value) -> None: ...
|
||||
@property
|
||||
def capabilities(self): ...
|
||||
@capabilities.setter
|
||||
def capabilities(self, value) -> None: ...
|
||||
@property
|
||||
def options(self): ...
|
||||
@options.setter
|
||||
def options(self, value) -> None: ...
|
||||
|
||||
class HostConfig(dict[str, Incomplete]):
|
||||
def __init__(
|
||||
self,
|
||||
version,
|
||||
binds: Incomplete | None = None,
|
||||
port_bindings: Incomplete | None = None,
|
||||
lxc_conf: Incomplete | None = None,
|
||||
publish_all_ports: bool = False,
|
||||
links: Incomplete | None = None,
|
||||
privileged: bool = False,
|
||||
dns: Incomplete | None = None,
|
||||
dns_search: Incomplete | None = None,
|
||||
volumes_from: Incomplete | None = None,
|
||||
network_mode: Incomplete | None = None,
|
||||
restart_policy: Incomplete | None = None,
|
||||
cap_add: Incomplete | None = None,
|
||||
cap_drop: Incomplete | None = None,
|
||||
devices: Incomplete | None = None,
|
||||
extra_hosts: Incomplete | None = None,
|
||||
read_only: Incomplete | None = None,
|
||||
pid_mode: Incomplete | None = None,
|
||||
ipc_mode: Incomplete | None = None,
|
||||
security_opt: Incomplete | None = None,
|
||||
ulimits: Incomplete | None = None,
|
||||
log_config: Incomplete | None = None,
|
||||
mem_limit: Incomplete | None = None,
|
||||
memswap_limit: Incomplete | None = None,
|
||||
mem_reservation: Incomplete | None = None,
|
||||
kernel_memory: Incomplete | None = None,
|
||||
mem_swappiness: Incomplete | None = None,
|
||||
cgroup_parent: Incomplete | None = None,
|
||||
group_add: Incomplete | None = None,
|
||||
cpu_quota: Incomplete | None = None,
|
||||
cpu_period: Incomplete | None = None,
|
||||
blkio_weight: Incomplete | None = None,
|
||||
blkio_weight_device: Incomplete | None = None,
|
||||
device_read_bps: Incomplete | None = None,
|
||||
device_write_bps: Incomplete | None = None,
|
||||
device_read_iops: Incomplete | None = None,
|
||||
device_write_iops: Incomplete | None = None,
|
||||
oom_kill_disable: bool = False,
|
||||
shm_size: Incomplete | None = None,
|
||||
sysctls: Incomplete | None = None,
|
||||
tmpfs: Incomplete | None = None,
|
||||
oom_score_adj: Incomplete | None = None,
|
||||
dns_opt: Incomplete | None = None,
|
||||
cpu_shares: Incomplete | None = None,
|
||||
cpuset_cpus: Incomplete | None = None,
|
||||
userns_mode: Incomplete | None = None,
|
||||
uts_mode: Incomplete | None = None,
|
||||
pids_limit: Incomplete | None = None,
|
||||
isolation: Incomplete | None = None,
|
||||
auto_remove: bool = False,
|
||||
storage_opt: Incomplete | None = None,
|
||||
init: Incomplete | None = None,
|
||||
init_path: Incomplete | None = None,
|
||||
volume_driver: Incomplete | None = None,
|
||||
cpu_count: Incomplete | None = None,
|
||||
cpu_percent: Incomplete | None = None,
|
||||
nano_cpus: Incomplete | None = None,
|
||||
cpuset_mems: Incomplete | None = None,
|
||||
runtime: Incomplete | None = None,
|
||||
mounts: Incomplete | None = None,
|
||||
cpu_rt_period: Incomplete | None = None,
|
||||
cpu_rt_runtime: Incomplete | None = None,
|
||||
device_cgroup_rules: Incomplete | None = None,
|
||||
device_requests: Incomplete | None = None,
|
||||
cgroupns: Incomplete | None = None,
|
||||
) -> None: ...
|
||||
|
||||
def host_config_type_error(param, param_value, expected): ...
|
||||
def host_config_version_error(param, version, less_than: bool = True): ...
|
||||
def host_config_value_error(param, param_value): ...
|
||||
def host_config_incompatible_error(param, param_value, incompatible_param): ...
|
||||
|
||||
class ContainerConfig(dict[str, Incomplete]):
|
||||
def __init__(
|
||||
self,
|
||||
version,
|
||||
image,
|
||||
command,
|
||||
hostname: Incomplete | None = None,
|
||||
user: Incomplete | None = None,
|
||||
detach: bool = False,
|
||||
stdin_open: bool = False,
|
||||
tty: bool = False,
|
||||
ports: Incomplete | None = None,
|
||||
environment: Incomplete | None = None,
|
||||
volumes: Incomplete | None = None,
|
||||
network_disabled: bool = False,
|
||||
entrypoint: Incomplete | None = None,
|
||||
working_dir: Incomplete | None = None,
|
||||
domainname: Incomplete | None = None,
|
||||
host_config: Incomplete | None = None,
|
||||
mac_address: Incomplete | None = None,
|
||||
labels: Incomplete | None = None,
|
||||
stop_signal: Incomplete | None = None,
|
||||
networking_config: Incomplete | None = None,
|
||||
healthcheck: Incomplete | None = None,
|
||||
stop_timeout: Incomplete | None = None,
|
||||
runtime: Incomplete | None = None,
|
||||
) -> None: ...
|
@ -0,0 +1,6 @@
|
||||
class CancellableStream:
|
||||
def __init__(self, stream, response) -> None: ...
|
||||
def __iter__(self): ...
|
||||
def __next__(self): ...
|
||||
next = __next__
|
||||
def close(self) -> None: ...
|
@ -0,0 +1,24 @@
|
||||
from .base import DictType
|
||||
|
||||
class Healthcheck(DictType):
|
||||
def __init__(self, **kwargs) -> None: ...
|
||||
@property
|
||||
def test(self): ...
|
||||
@test.setter
|
||||
def test(self, value) -> None: ...
|
||||
@property
|
||||
def interval(self): ...
|
||||
@interval.setter
|
||||
def interval(self, value) -> None: ...
|
||||
@property
|
||||
def timeout(self): ...
|
||||
@timeout.setter
|
||||
def timeout(self, value) -> None: ...
|
||||
@property
|
||||
def retries(self): ...
|
||||
@retries.setter
|
||||
def retries(self, value) -> None: ...
|
||||
@property
|
||||
def start_period(self): ...
|
||||
@start_period.setter
|
||||
def start_period(self, value) -> None: ...
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user