mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-08 04:54:47 +08:00
Specify stream type of Docker logs (#12214)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
This commit is contained in:
@@ -105,7 +105,7 @@ class ContainerApiMixin:
|
||||
since: datetime.datetime | float | None = None,
|
||||
follow: bool | None = None,
|
||||
until: datetime.datetime | float | None = None,
|
||||
) -> CancellableStream: ...
|
||||
) -> CancellableStream[bytes]: ...
|
||||
@overload
|
||||
def logs(
|
||||
self,
|
||||
@@ -118,7 +118,7 @@ class ContainerApiMixin:
|
||||
since: datetime.datetime | float | None = None,
|
||||
follow: bool | None = None,
|
||||
until: datetime.datetime | float | None = None,
|
||||
) -> CancellableStream: ...
|
||||
) -> CancellableStream[bytes]: ...
|
||||
@overload
|
||||
def logs(
|
||||
self,
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
from _typeshed import Incomplete
|
||||
from datetime import datetime
|
||||
from typing import Any
|
||||
|
||||
@@ -11,7 +12,7 @@ class DaemonApiMixin:
|
||||
until: datetime | int | None = None,
|
||||
filters: dict[str, Any] | None = None,
|
||||
decode: bool | None = None,
|
||||
) -> CancellableStream: ...
|
||||
) -> CancellableStream[Incomplete]: ...
|
||||
def info(self) -> dict[str, Any]: ...
|
||||
def login(
|
||||
self,
|
||||
|
||||
@@ -61,7 +61,7 @@ class Container(Model):
|
||||
since: datetime.datetime | float | None = None,
|
||||
follow: bool | None = None,
|
||||
until: datetime.datetime | float | None = None,
|
||||
) -> CancellableStream: ...
|
||||
) -> CancellableStream[bytes]: ...
|
||||
@overload
|
||||
def logs(
|
||||
self,
|
||||
|
||||
@@ -1,6 +1,12 @@
|
||||
class CancellableStream:
|
||||
def __init__(self, stream, response) -> None: ...
|
||||
def __iter__(self): ...
|
||||
def __next__(self): ...
|
||||
from collections.abc import Iterator
|
||||
from typing import Generic, TypeVar
|
||||
from typing_extensions import Self
|
||||
|
||||
_T_co = TypeVar("_T_co", covariant=True)
|
||||
|
||||
class CancellableStream(Generic[_T_co]):
|
||||
def __init__(self, stream: Iterator[_T_co], response) -> None: ...
|
||||
def __iter__(self) -> Self: ...
|
||||
def __next__(self) -> _T_co: ...
|
||||
next = __next__
|
||||
def close(self) -> None: ...
|
||||
|
||||
Reference in New Issue
Block a user