mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-03-17 20:15:00 +08:00
Add default values for third-party stubs beginning with 'P' (#9957)
This commit is contained in:
@@ -28,7 +28,7 @@ BLP_ALPHA_ENCODING_DXT3: Literal[AlphaEncoding.DXT3]
|
||||
BLP_ALPHA_ENCODING_DXT5: Literal[AlphaEncoding.DXT5]
|
||||
|
||||
def unpack_565(i): ...
|
||||
def decode_dxt1(data, alpha: bool = ...): ...
|
||||
def decode_dxt1(data, alpha: bool = False): ...
|
||||
def decode_dxt3(data): ...
|
||||
def decode_dxt5(data): ...
|
||||
|
||||
|
||||
@@ -7,8 +7,8 @@ class ContainerIO:
|
||||
length: Any
|
||||
def __init__(self, file, offset, length) -> None: ...
|
||||
def isatty(self): ...
|
||||
def seek(self, offset, mode=...) -> None: ...
|
||||
def seek(self, offset, mode=0) -> None: ...
|
||||
def tell(self): ...
|
||||
def read(self, n: int = ...): ...
|
||||
def read(self, n: int = 0): ...
|
||||
def readline(self): ...
|
||||
def readlines(self): ...
|
||||
|
||||
@@ -8,13 +8,13 @@ field: Any
|
||||
gs_windows_binary: Any
|
||||
|
||||
def has_ghostscript(): ...
|
||||
def Ghostscript(tile, size, fp, scale: int = ..., transparency: bool = ...): ...
|
||||
def Ghostscript(tile, size, fp, scale: int = 1, transparency: bool = False): ...
|
||||
|
||||
class PSFile:
|
||||
fp: Any
|
||||
char: Any
|
||||
def __init__(self, fp) -> None: ...
|
||||
def seek(self, offset, whence=...) -> None: ...
|
||||
def seek(self, offset, whence=0) -> None: ...
|
||||
def readline(self): ...
|
||||
|
||||
class EpsImageFile(ImageFile):
|
||||
@@ -24,5 +24,5 @@ class EpsImageFile(ImageFile):
|
||||
im: Any
|
||||
mode: Any
|
||||
tile: Any
|
||||
def load(self, scale: int = ..., transparency: bool = ...) -> None: ...
|
||||
def load(self, scale: int = 1, transparency: bool = False) -> None: ...
|
||||
def load_seek(self, *args, **kwargs) -> None: ...
|
||||
|
||||
@@ -7,4 +7,4 @@ class GdImageFile(ImageFile):
|
||||
format: ClassVar[Literal["GD"]]
|
||||
format_description: ClassVar[str]
|
||||
|
||||
def open(fp, mode: str = ...): ...
|
||||
def open(fp, mode: str = "r"): ...
|
||||
|
||||
@@ -20,5 +20,5 @@ class GifImageFile(ImageFile):
|
||||
RAWMODE: Any
|
||||
|
||||
def get_interlace(im): ...
|
||||
def getheader(im, palette: Incomplete | None = ..., info: Incomplete | None = ...): ...
|
||||
def getdata(im, offset=..., **params): ...
|
||||
def getheader(im, palette: Incomplete | None = None, info: Incomplete | None = None): ...
|
||||
def getdata(im, offset=(0, 0), **params): ...
|
||||
|
||||
@@ -12,7 +12,7 @@ SEGMENTS: Any
|
||||
|
||||
class GradientFile:
|
||||
gradient: Any
|
||||
def getpalette(self, entries: int = ...): ...
|
||||
def getpalette(self, entries: int = 256): ...
|
||||
|
||||
class GimpGradientFile(GradientFile):
|
||||
gradient: Any
|
||||
|
||||
@@ -21,7 +21,7 @@ class IcnsFile:
|
||||
def itersizes(self): ...
|
||||
def bestsize(self): ...
|
||||
def dataforsize(self, size): ...
|
||||
def getimage(self, size: Incomplete | None = ...): ...
|
||||
def getimage(self, size: Incomplete | None = None): ...
|
||||
|
||||
class IcnsImageFile(ImageFile):
|
||||
format: ClassVar[Literal["ICNS"]]
|
||||
|
||||
@@ -9,8 +9,8 @@ class IcoFile:
|
||||
nb_items: Any
|
||||
def __init__(self, buf): ...
|
||||
def sizes(self): ...
|
||||
def getentryindex(self, size, bpp: bool = ...): ...
|
||||
def getimage(self, size, bpp: bool = ...): ...
|
||||
def getentryindex(self, size, bpp: bool = False): ...
|
||||
def getimage(self, size, bpp: bool = False): ...
|
||||
def frame(self, idx): ...
|
||||
|
||||
class IcoImageFile(ImageFile):
|
||||
|
||||
@@ -177,74 +177,74 @@ class Image:
|
||||
def __eq__(self, other: object) -> bool: ...
|
||||
def __getstate__(self) -> _ImageState: ...
|
||||
def __setstate__(self, state: _ImageState) -> None: ...
|
||||
def tobytes(self, encoder_name: str = ..., *args) -> bytes: ...
|
||||
def tobitmap(self, name: str = ...) -> bytes: ...
|
||||
def frombytes(self, data: bytes, decoder_name: str = ..., *args) -> None: ...
|
||||
def tobytes(self, encoder_name: str = "raw", *args) -> bytes: ...
|
||||
def tobitmap(self, name: str = "image") -> bytes: ...
|
||||
def frombytes(self, data: bytes, decoder_name: str = "raw", *args) -> None: ...
|
||||
def load(self) -> None: ...
|
||||
def verify(self) -> None: ...
|
||||
def convert(
|
||||
self,
|
||||
mode: _Mode | None = ...,
|
||||
matrix: _ConversionMatrix | None = ...,
|
||||
dither: int | None = ...,
|
||||
mode: _Mode | None = None,
|
||||
matrix: _ConversionMatrix | None = None,
|
||||
dither: int | None = None,
|
||||
palette: Palette | Literal[0, 1] = ...,
|
||||
colors: int = ...,
|
||||
colors: int = 256,
|
||||
) -> Image: ...
|
||||
def quantize(
|
||||
self,
|
||||
colors: int = ...,
|
||||
method: Quantize | Literal[0, 1, 2, 3] | None = ...,
|
||||
kmeans: int = ...,
|
||||
palette: Image | None = ...,
|
||||
colors: int = 256,
|
||||
method: Quantize | Literal[0, 1, 2, 3] | None = None,
|
||||
kmeans: int = 0,
|
||||
palette: Image | None = None,
|
||||
dither: int = ...,
|
||||
) -> Image: ...
|
||||
def copy(self) -> Image: ...
|
||||
__copy__ = copy
|
||||
def crop(self, box: _Box | None = ...) -> Image: ...
|
||||
def crop(self, box: _Box | None = None) -> Image: ...
|
||||
def draft(self, mode: _Mode, size: _Size) -> None: ...
|
||||
def filter(self, filter: Filter | Callable[[], Filter]) -> Image: ...
|
||||
def getbands(self) -> tuple[str, ...]: ...
|
||||
def getbbox(self) -> tuple[int, int, int, int] | None: ...
|
||||
def getcolors(self, maxcolors: int = ...) -> list[tuple[int, int]]: ...
|
||||
def getdata(self, band: int | None = ...): ...
|
||||
def getcolors(self, maxcolors: int = 256) -> list[tuple[int, int]]: ...
|
||||
def getdata(self, band: int | None = None): ...
|
||||
def getextrema(self): ...
|
||||
def getexif(self) -> Exif: ...
|
||||
def get_child_images(self) -> list[Image]: ...
|
||||
def getim(self): ...
|
||||
def getpalette(self, rawmode: str | None = ...) -> list[int] | None: ...
|
||||
def getpalette(self, rawmode: str | None = "RGB") -> list[int] | None: ...
|
||||
def getpixel(self, xy: tuple[int, int]): ...
|
||||
def getprojection(self) -> tuple[list[int], list[int]]: ...
|
||||
def histogram(self, mask: Image | None = ..., extrema: tuple[int, int] | tuple[float, float] | None = ...) -> list[int]: ...
|
||||
def entropy(self, mask: Image | None = ..., extrema: tuple[int, int] | tuple[float, float] | None = ...) -> float: ...
|
||||
def paste(self, im: Image | _Color, box: tuple[int, int] | _Box | None = ..., mask: Image | None = ...) -> None: ...
|
||||
def alpha_composite(self, im: Image, dest: tuple[int, int] = ..., source: tuple[int, int] = ...) -> None: ...
|
||||
def point(self, lut, mode: _Mode | None = ...) -> Image: ...
|
||||
def histogram(self, mask: Image | None = None, extrema: tuple[int, int] | tuple[float, float] | None = None) -> list[int]: ...
|
||||
def entropy(self, mask: Image | None = None, extrema: tuple[int, int] | tuple[float, float] | None = None) -> float: ...
|
||||
def paste(self, im: Image | _Color, box: tuple[int, int] | _Box | None = None, mask: Image | None = None) -> None: ...
|
||||
def alpha_composite(self, im: Image, dest: tuple[int, int] = (0, 0), source: tuple[int, int] = (0, 0)) -> None: ...
|
||||
def point(self, lut, mode: _Mode | None = None) -> Image: ...
|
||||
def putalpha(self, alpha: Image | int) -> None: ...
|
||||
def putdata(self, data: Sequence[int], scale: float = ..., offset: float = ...) -> None: ...
|
||||
def putpalette(self, data: ImagePalette | bytes | Iterable[int] | SupportsBytes, rawmode: _Mode | None = ...) -> None: ...
|
||||
def putdata(self, data: Sequence[int], scale: float = 1.0, offset: float = 0.0) -> None: ...
|
||||
def putpalette(self, data: ImagePalette | bytes | Iterable[int] | SupportsBytes, rawmode: _Mode | None = "RGB") -> None: ...
|
||||
def putpixel(self, xy: tuple[int, int], value: _Color | list[float]) -> None: ...
|
||||
def remap_palette(self, dest_map: Iterable[int], source_palette: Sequence[int] | None = ...) -> Image: ...
|
||||
def remap_palette(self, dest_map: Iterable[int], source_palette: Sequence[int] | None = None) -> Image: ...
|
||||
def resize(
|
||||
self,
|
||||
size: tuple[int, int],
|
||||
resample: Resampling | _Resample | None = ...,
|
||||
box: tuple[float, float, float, float] | None = ...,
|
||||
reducing_gap: float | None = ...,
|
||||
resample: Resampling | _Resample | None = None,
|
||||
box: tuple[float, float, float, float] | None = None,
|
||||
reducing_gap: float | None = None,
|
||||
) -> Image: ...
|
||||
def reduce(self, factor: int | tuple[int, int] | list[int], box: _Box | None = ...) -> Image: ...
|
||||
def reduce(self, factor: int | tuple[int, int] | list[int], box: _Box | None = None) -> Image: ...
|
||||
def rotate(
|
||||
self,
|
||||
angle: float,
|
||||
resample: Resampling | _Resample = ...,
|
||||
expand: bool = ...,
|
||||
center: tuple[float, float] | None = ...,
|
||||
translate: tuple[float, float] | None = ...,
|
||||
fillcolor: _Color | None = ...,
|
||||
center: tuple[float, float] | None = None,
|
||||
translate: tuple[float, float] | None = None,
|
||||
fillcolor: _Color | None = None,
|
||||
) -> Image: ...
|
||||
def save(
|
||||
self,
|
||||
fp: str | bytes | Path | _Writeable,
|
||||
format: str | None = ...,
|
||||
format: str | None = None,
|
||||
*,
|
||||
save_all: bool = ...,
|
||||
bitmap_format: Literal["bmp", "png"] = ..., # for ICO files
|
||||
@@ -252,19 +252,19 @@ class Image:
|
||||
**params: Any,
|
||||
) -> None: ...
|
||||
def seek(self, frame: int) -> None: ...
|
||||
def show(self, title: str | None = ...) -> None: ...
|
||||
def show(self, title: str | None = None) -> None: ...
|
||||
def split(self) -> tuple[Image, ...]: ...
|
||||
def getchannel(self, channel: int | str) -> Image: ...
|
||||
def tell(self) -> int: ...
|
||||
def thumbnail(self, size: tuple[int, int], resample: Resampling | _Resample = ..., reducing_gap: float = ...) -> None: ...
|
||||
def thumbnail(self, size: tuple[int, int], resample: Resampling | _Resample = ..., reducing_gap: float = 2.0) -> None: ...
|
||||
def transform(
|
||||
self,
|
||||
size: _Size,
|
||||
method: Transform | Literal[0, 1, 2, 3, 4],
|
||||
data=...,
|
||||
data=None,
|
||||
resample: Resampling | _Resample = ...,
|
||||
fill: int = ...,
|
||||
fillcolor: _Color | int | None = ...,
|
||||
fill: int = 1,
|
||||
fillcolor: _Color | int | None = None,
|
||||
) -> Image: ...
|
||||
def transpose(self, method: Transpose | Literal[0, 1, 2, 3, 4, 5, 6]) -> Image: ...
|
||||
def effect_spread(self, distance: int) -> Image: ...
|
||||
@@ -274,21 +274,21 @@ class Image:
|
||||
class ImagePointHandler: ...
|
||||
class ImageTransformHandler: ...
|
||||
|
||||
def new(mode: _Mode, size: tuple[int, int], color: _Color = ...) -> Image: ...
|
||||
def frombytes(mode: _Mode, size: tuple[int, int], data, decoder_name: str = ..., *args) -> Image: ...
|
||||
def frombuffer(mode: _Mode, size: tuple[int, int], data, decoder_name: str = ..., *args) -> Image: ...
|
||||
def fromarray(obj, mode: _Mode | None = ...) -> Image: ...
|
||||
def new(mode: _Mode, size: tuple[int, int], color: _Color = 0) -> Image: ...
|
||||
def frombytes(mode: _Mode, size: tuple[int, int], data, decoder_name: str = "raw", *args) -> Image: ...
|
||||
def frombuffer(mode: _Mode, size: tuple[int, int], data, decoder_name: str = "raw", *args) -> Image: ...
|
||||
def fromarray(obj, mode: _Mode | None = None) -> Image: ...
|
||||
def fromqimage(im) -> Image: ...
|
||||
def fromqpixmap(im) -> Image: ...
|
||||
def open(
|
||||
fp: str | bytes | Path | SupportsRead[bytes], mode: Literal["r"] = ..., formats: list[str] | tuple[str, ...] | None = ...
|
||||
fp: str | bytes | Path | SupportsRead[bytes], mode: Literal["r"] = "r", formats: list[str] | tuple[str, ...] | None = None
|
||||
) -> Image: ...
|
||||
def alpha_composite(im1: Image, im2: Image) -> Image: ...
|
||||
def blend(im1: Image, im2: Image, alpha: float) -> Image: ...
|
||||
def composite(image1: Image, image2: Image, mask: Image) -> Image: ...
|
||||
def eval(image: Image, *args) -> Image: ...
|
||||
def merge(mode: _Mode, bands: Sequence[Image]) -> Image: ...
|
||||
def register_open(id: str, factory, accept=...) -> None: ...
|
||||
def register_open(id: str, factory, accept=None) -> None: ...
|
||||
def register_mime(id: str, mimetype: str) -> None: ...
|
||||
def register_save(id: str, driver) -> None: ...
|
||||
def register_save_all(id: str, driver) -> None: ...
|
||||
@@ -304,7 +304,7 @@ def radial_gradient(mode: _Mode) -> Image: ...
|
||||
|
||||
class Exif(MutableMapping[int, Any]):
|
||||
def load(self, data: bytes) -> None: ...
|
||||
def tobytes(self, offset: int = ...) -> bytes: ...
|
||||
def tobytes(self, offset: int = 8) -> bytes: ...
|
||||
def get_ifd(self, tag: int): ...
|
||||
def hide_offsets(self) -> None: ...
|
||||
def __len__(self) -> int: ...
|
||||
|
||||
@@ -11,8 +11,8 @@ def screen(image1: Image, image2: Image) -> Image: ...
|
||||
def soft_light(image1: Image, image2: Image) -> Image: ...
|
||||
def hard_light(image1: Image, image2: Image) -> Image: ...
|
||||
def overlay(image1: Image, image2: Image) -> Image: ...
|
||||
def add(image1: Image, image2: Image, scale: float = ..., offset: int = ...) -> Image: ...
|
||||
def subtract(image1: Image, image2: Image, scale: float = ..., offset: int = ...) -> Image: ...
|
||||
def add(image1: Image, image2: Image, scale: float = 1.0, offset: int = 0) -> Image: ...
|
||||
def subtract(image1: Image, image2: Image, scale: float = 1.0, offset: int = 0) -> Image: ...
|
||||
def add_modulo(image1: Image, image2: Image) -> Image: ...
|
||||
def subtract_modulo(image1: Image, image2: Image) -> Image: ...
|
||||
def logical_and(image1: Image, image2: Image) -> Image: ...
|
||||
@@ -20,4 +20,4 @@ def logical_or(image1: Image, image2: Image) -> Image: ...
|
||||
def logical_xor(image1: Image, image2: Image) -> Image: ...
|
||||
def blend(image1: Image, image2: Image, alpha: float) -> Image: ...
|
||||
def composite(image1: Image, image2: Image, mask: Image) -> Image: ...
|
||||
def offset(image: Image, xoffset: int, yoffset: int | None = ...) -> Image: ...
|
||||
def offset(image: Image, xoffset: int, yoffset: int | None = None) -> Image: ...
|
||||
|
||||
@@ -47,15 +47,15 @@ class ImageCmsTransform(ImagePointHandler):
|
||||
input_mode,
|
||||
output_mode,
|
||||
intent=...,
|
||||
proof: Incomplete | None = ...,
|
||||
proof: Incomplete | None = None,
|
||||
proof_intent=...,
|
||||
flags: int = ...,
|
||||
flags: int = 0,
|
||||
) -> None: ...
|
||||
def point(self, im): ...
|
||||
def apply(self, im, imOut: Incomplete | None = ...): ...
|
||||
def apply(self, im, imOut: Incomplete | None = None): ...
|
||||
def apply_in_place(self, im): ...
|
||||
|
||||
def get_display_profile(handle: Incomplete | None = ...): ...
|
||||
def get_display_profile(handle: Incomplete | None = None): ...
|
||||
|
||||
class PyCMSError(Exception): ...
|
||||
|
||||
@@ -64,21 +64,21 @@ def profileToProfile(
|
||||
inputProfile,
|
||||
outputProfile,
|
||||
renderingIntent=...,
|
||||
outputMode: Incomplete | None = ...,
|
||||
inPlace: bool = ...,
|
||||
flags: int = ...,
|
||||
outputMode: Incomplete | None = None,
|
||||
inPlace: bool = False,
|
||||
flags: int = 0,
|
||||
): ...
|
||||
def getOpenProfile(profileFilename): ...
|
||||
def buildTransform(inputProfile, outputProfile, inMode, outMode, renderingIntent=..., flags: int = ...): ...
|
||||
def buildTransform(inputProfile, outputProfile, inMode, outMode, renderingIntent=..., flags: int = 0): ...
|
||||
def buildProofTransform(
|
||||
inputProfile, outputProfile, proofProfile, inMode, outMode, renderingIntent=..., proofRenderingIntent=..., flags=...
|
||||
inputProfile, outputProfile, proofProfile, inMode, outMode, renderingIntent=..., proofRenderingIntent=..., flags=16384
|
||||
): ...
|
||||
|
||||
buildTransformFromOpenProfiles = buildTransform
|
||||
buildProofTransformFromOpenProfiles = buildProofTransform
|
||||
|
||||
def applyTransform(im, transform, inPlace: bool = ...): ...
|
||||
def createProfile(colorSpace, colorTemp: int = ...): ...
|
||||
def applyTransform(im, transform, inPlace: bool = False): ...
|
||||
def createProfile(colorSpace, colorTemp: int = -1): ...
|
||||
def getProfileName(profile): ...
|
||||
def getProfileInfo(profile): ...
|
||||
def getProfileCopyright(profile): ...
|
||||
|
||||
@@ -11,65 +11,65 @@ _XY: TypeAlias = Sequence[float | tuple[float, float]]
|
||||
_Outline: TypeAlias = Any
|
||||
|
||||
class ImageDraw:
|
||||
def __init__(self, im: Image, mode: str | None = ...) -> None: ...
|
||||
def __init__(self, im: Image, mode: str | None = None) -> None: ...
|
||||
def getfont(self): ...
|
||||
def arc(self, xy: _XY, start: float, end: float, fill: _Ink | None = ..., width: float = ...) -> None: ...
|
||||
def bitmap(self, xy: _XY, bitmap: Image, fill: _Ink | None = ...) -> None: ...
|
||||
def arc(self, xy: _XY, start: float, end: float, fill: _Ink | None = None, width: float = 1) -> None: ...
|
||||
def bitmap(self, xy: _XY, bitmap: Image, fill: _Ink | None = None) -> None: ...
|
||||
def chord(
|
||||
self, xy: _XY, start: float, end: float, fill: _Ink | None = ..., outline: _Ink | None = ..., width: float = ...
|
||||
self, xy: _XY, start: float, end: float, fill: _Ink | None = None, outline: _Ink | None = None, width: float = 1
|
||||
) -> None: ...
|
||||
def ellipse(self, xy: _XY, fill: _Ink | None = ..., outline: _Ink | None = ..., width: float = ...) -> None: ...
|
||||
def line(self, xy: _XY, fill: _Ink | None = ..., width: float = ..., joint: Literal["curve"] | None = ...) -> None: ...
|
||||
def shape(self, shape: _Outline, fill: _Ink | None = ..., outline: _Ink | None = ...) -> None: ...
|
||||
def ellipse(self, xy: _XY, fill: _Ink | None = None, outline: _Ink | None = None, width: float = 1) -> None: ...
|
||||
def line(self, xy: _XY, fill: _Ink | None = None, width: float = 0, joint: Literal["curve"] | None = None) -> None: ...
|
||||
def shape(self, shape: _Outline, fill: _Ink | None = None, outline: _Ink | None = None) -> None: ...
|
||||
def pieslice(
|
||||
self,
|
||||
xy: tuple[tuple[float, float], tuple[float, float]],
|
||||
start: float,
|
||||
end: float,
|
||||
fill: _Ink | None = ...,
|
||||
outline: _Ink | None = ...,
|
||||
width: float = ...,
|
||||
fill: _Ink | None = None,
|
||||
outline: _Ink | None = None,
|
||||
width: float = 1,
|
||||
) -> None: ...
|
||||
def point(self, xy: _XY, fill: _Ink | None = ...) -> None: ...
|
||||
def polygon(self, xy: _XY, fill: _Ink | None = ..., outline: _Ink | None = ..., width: float = ...) -> None: ...
|
||||
def point(self, xy: _XY, fill: _Ink | None = None) -> None: ...
|
||||
def polygon(self, xy: _XY, fill: _Ink | None = None, outline: _Ink | None = None, width: float = 1) -> None: ...
|
||||
def regular_polygon(
|
||||
self,
|
||||
bounding_circle: tuple[float, float] | tuple[float, float, float] | list[int],
|
||||
n_sides: int,
|
||||
rotation: float = ...,
|
||||
fill: _Ink | None = ...,
|
||||
outline: _Ink | None = ...,
|
||||
rotation: float = 0,
|
||||
fill: _Ink | None = None,
|
||||
outline: _Ink | None = None,
|
||||
) -> None: ...
|
||||
def rectangle(
|
||||
self,
|
||||
xy: tuple[float, float, float, float] | tuple[tuple[float, float], tuple[float, float]],
|
||||
fill: _Ink | None = ...,
|
||||
outline: _Ink | None = ...,
|
||||
width: float = ...,
|
||||
fill: _Ink | None = None,
|
||||
outline: _Ink | None = None,
|
||||
width: float = 1,
|
||||
) -> None: ...
|
||||
def rounded_rectangle(
|
||||
self,
|
||||
xy: tuple[float, float, float, float] | tuple[tuple[float, float], tuple[float, float]],
|
||||
radius: float = ...,
|
||||
fill: _Ink | None = ...,
|
||||
outline: _Ink | None = ...,
|
||||
width: float = ...,
|
||||
radius: float = 0,
|
||||
fill: _Ink | None = None,
|
||||
outline: _Ink | None = None,
|
||||
width: float = 1,
|
||||
) -> None: ...
|
||||
def text(
|
||||
self,
|
||||
xy: tuple[float, float],
|
||||
text: str | bytes,
|
||||
fill: _Ink | None = ...,
|
||||
font: _Font | None = ...,
|
||||
anchor: str | None = ...,
|
||||
spacing: float = ...,
|
||||
align: Literal["left", "center", "right"] = ...,
|
||||
direction: Literal["rtl", "ltr", "ttb"] | None = ...,
|
||||
features: Sequence[str] | None = ...,
|
||||
language: str | None = ...,
|
||||
stroke_width: int = ...,
|
||||
stroke_fill: _Ink | None = ...,
|
||||
embedded_color: bool = ...,
|
||||
fill: _Ink | None = None,
|
||||
font: _Font | None = None,
|
||||
anchor: str | None = None,
|
||||
spacing: float = 4,
|
||||
align: Literal["left", "center", "right"] = "left",
|
||||
direction: Literal["rtl", "ltr", "ttb"] | None = None,
|
||||
features: Sequence[str] | None = None,
|
||||
language: str | None = None,
|
||||
stroke_width: int = 0,
|
||||
stroke_fill: _Ink | None = None,
|
||||
embedded_color: bool = False,
|
||||
*args,
|
||||
**kwargs,
|
||||
) -> None: ...
|
||||
@@ -77,80 +77,80 @@ class ImageDraw:
|
||||
self,
|
||||
xy: tuple[float, float],
|
||||
text: str | bytes,
|
||||
fill: _Ink | None = ...,
|
||||
font: _Font | None = ...,
|
||||
anchor: str | None = ...,
|
||||
spacing: float = ...,
|
||||
align: Literal["left", "center", "right"] = ...,
|
||||
direction: Literal["rtl", "ltr", "ttb"] | None = ...,
|
||||
features: Incomplete | None = ...,
|
||||
language: str | None = ...,
|
||||
stroke_width: int = ...,
|
||||
stroke_fill: _Ink | None = ...,
|
||||
embedded_color: bool = ...,
|
||||
fill: _Ink | None = None,
|
||||
font: _Font | None = None,
|
||||
anchor: str | None = None,
|
||||
spacing: float = 4,
|
||||
align: Literal["left", "center", "right"] = "left",
|
||||
direction: Literal["rtl", "ltr", "ttb"] | None = None,
|
||||
features: Incomplete | None = None,
|
||||
language: str | None = None,
|
||||
stroke_width: int = 0,
|
||||
stroke_fill: _Ink | None = None,
|
||||
embedded_color: bool = False,
|
||||
) -> None: ...
|
||||
def textsize(
|
||||
self,
|
||||
text: str | bytes,
|
||||
font: _Font | None = ...,
|
||||
spacing: float = ...,
|
||||
direction: Literal["rtl", "ltr", "ttb"] | None = ...,
|
||||
features: Sequence[str] | None = ...,
|
||||
language: str | None = ...,
|
||||
stroke_width: int = ...,
|
||||
font: _Font | None = None,
|
||||
spacing: float = 4,
|
||||
direction: Literal["rtl", "ltr", "ttb"] | None = None,
|
||||
features: Sequence[str] | None = None,
|
||||
language: str | None = None,
|
||||
stroke_width: int = 0,
|
||||
) -> tuple[int, int]: ...
|
||||
def multiline_textsize(
|
||||
self,
|
||||
text: str | bytes,
|
||||
font: _Font | None = ...,
|
||||
spacing: float = ...,
|
||||
direction: Literal["rtl", "ltr", "ttb"] | None = ...,
|
||||
features: Sequence[str] | None = ...,
|
||||
language: str | None = ...,
|
||||
stroke_width: int = ...,
|
||||
font: _Font | None = None,
|
||||
spacing: float = 4,
|
||||
direction: Literal["rtl", "ltr", "ttb"] | None = None,
|
||||
features: Sequence[str] | None = None,
|
||||
language: str | None = None,
|
||||
stroke_width: int = 0,
|
||||
) -> tuple[int, int]: ...
|
||||
def textlength(
|
||||
self,
|
||||
text: str | bytes,
|
||||
font: _Font | None = ...,
|
||||
direction: Literal["rtl", "ltr", "ttb"] | None = ...,
|
||||
features: Sequence[str] | None = ...,
|
||||
language: str | None = ...,
|
||||
embedded_color: bool = ...,
|
||||
font: _Font | None = None,
|
||||
direction: Literal["rtl", "ltr", "ttb"] | None = None,
|
||||
features: Sequence[str] | None = None,
|
||||
language: str | None = None,
|
||||
embedded_color: bool = False,
|
||||
) -> float: ...
|
||||
def textbbox(
|
||||
self,
|
||||
xy: tuple[float, float],
|
||||
text: str | bytes,
|
||||
font: _Font | None = ...,
|
||||
anchor: str | None = ...,
|
||||
spacing: float = ...,
|
||||
align: Literal["left", "center", "right"] = ...,
|
||||
direction: Literal["rtl", "ltr", "ttb"] | None = ...,
|
||||
features: Incomplete | None = ...,
|
||||
language: str | None = ...,
|
||||
stroke_width: int = ...,
|
||||
embedded_color: bool = ...,
|
||||
font: _Font | None = None,
|
||||
anchor: str | None = None,
|
||||
spacing: float = 4,
|
||||
align: Literal["left", "center", "right"] = "left",
|
||||
direction: Literal["rtl", "ltr", "ttb"] | None = None,
|
||||
features: Incomplete | None = None,
|
||||
language: str | None = None,
|
||||
stroke_width: int = 0,
|
||||
embedded_color: bool = False,
|
||||
) -> tuple[int, int, int, int]: ...
|
||||
def multiline_textbbox(
|
||||
self,
|
||||
xy: tuple[float, float],
|
||||
text: str | bytes,
|
||||
font: _Font | None = ...,
|
||||
anchor: str | None = ...,
|
||||
spacing: float = ...,
|
||||
align: Literal["left", "center", "right"] = ...,
|
||||
direction: Literal["rtl", "ltr", "ttb"] | None = ...,
|
||||
features: Incomplete | None = ...,
|
||||
language: str | None = ...,
|
||||
stroke_width: int = ...,
|
||||
embedded_color: bool = ...,
|
||||
font: _Font | None = None,
|
||||
anchor: str | None = None,
|
||||
spacing: float = 4,
|
||||
align: Literal["left", "center", "right"] = "left",
|
||||
direction: Literal["rtl", "ltr", "ttb"] | None = None,
|
||||
features: Incomplete | None = None,
|
||||
language: str | None = None,
|
||||
stroke_width: int = 0,
|
||||
embedded_color: bool = False,
|
||||
) -> tuple[int, int, int, int]: ...
|
||||
|
||||
def Draw(im: Image, mode: str | None = ...) -> ImageDraw: ...
|
||||
def Draw(im: Image, mode: str | None = None) -> ImageDraw: ...
|
||||
def Outline() -> _Outline: ...
|
||||
@overload
|
||||
def getdraw(im: None = ..., hints: Container[Literal["nicest"]] | None = ...) -> tuple[None, Any]: ...
|
||||
def getdraw(im: None = None, hints: Container[Literal["nicest"]] | None = None) -> tuple[None, Any]: ...
|
||||
@overload
|
||||
def getdraw(im: Image, hints: Container[Literal["nicest"]] | None = ...) -> tuple[Image, Any]: ...
|
||||
def floodfill(image: Image, xy: tuple[float, float], value, border=..., thresh: float = ...) -> None: ...
|
||||
def getdraw(im: Image, hints: Container[Literal["nicest"]] | None = None) -> tuple[Image, Any]: ...
|
||||
def floodfill(image: Image, xy: tuple[float, float], value, border=None, thresh: float = 0) -> None: ...
|
||||
|
||||
@@ -4,24 +4,24 @@ from typing import Any
|
||||
class Pen:
|
||||
color: Any
|
||||
width: Any
|
||||
def __init__(self, color, width: int = ..., opacity: int = ...) -> None: ...
|
||||
def __init__(self, color, width: int = 1, opacity: int = 255) -> None: ...
|
||||
|
||||
class Brush:
|
||||
color: Any
|
||||
def __init__(self, color, opacity: int = ...) -> None: ...
|
||||
def __init__(self, color, opacity: int = 255) -> None: ...
|
||||
|
||||
class Font:
|
||||
color: Any
|
||||
font: Any
|
||||
def __init__(self, color, file, size: int = ...) -> None: ...
|
||||
def __init__(self, color, file, size: int = 12) -> None: ...
|
||||
|
||||
class Draw:
|
||||
draw: Any
|
||||
image: Any
|
||||
transform: Any
|
||||
def __init__(self, image, size: Incomplete | None = ..., color: Incomplete | None = ...) -> None: ...
|
||||
def __init__(self, image, size: Incomplete | None = None, color: Incomplete | None = None) -> None: ...
|
||||
def flush(self): ...
|
||||
def render(self, op, xy, pen, brush: Incomplete | None = ...) -> None: ...
|
||||
def render(self, op, xy, pen, brush: Incomplete | None = None) -> None: ...
|
||||
def settransform(self, offset) -> None: ...
|
||||
def arc(self, xy, start, end, *options) -> None: ...
|
||||
def chord(self, xy, start, end, *options) -> None: ...
|
||||
|
||||
@@ -19,7 +19,7 @@ class ImageFile(Image):
|
||||
decodermaxblock: Any
|
||||
fp: Any
|
||||
filename: Any
|
||||
def __init__(self, fp: Incomplete | None = ..., filename: Incomplete | None = ...) -> None: ...
|
||||
def __init__(self, fp: Incomplete | None = None, filename: Incomplete | None = None) -> None: ...
|
||||
def get_format_mimetype(self): ...
|
||||
def verify(self) -> None: ...
|
||||
map: Any
|
||||
@@ -65,5 +65,5 @@ class PyDecoder:
|
||||
def decode(self, buffer) -> None: ...
|
||||
def cleanup(self) -> None: ...
|
||||
def setfd(self, fd) -> None: ...
|
||||
def setimage(self, im, extents: Incomplete | None = ...) -> None: ...
|
||||
def set_as_raw(self, data, rawmode: Incomplete | None = ...) -> None: ...
|
||||
def setimage(self, im, extents: Incomplete | None = None) -> None: ...
|
||||
def set_as_raw(self, data, rawmode: Incomplete | None = None) -> None: ...
|
||||
|
||||
@@ -18,7 +18,7 @@ class BuiltinFilter(MultibandFilter):
|
||||
class Kernel(BuiltinFilter):
|
||||
name: str
|
||||
filterargs: _FilterArgs
|
||||
def __init__(self, size: Sequence[int], kernel: Sequence[int], scale: Incomplete | None = ..., offset: int = ...) -> None: ...
|
||||
def __init__(self, size: Sequence[int], kernel: Sequence[int], scale: Incomplete | None = None, offset: int = 0) -> None: ...
|
||||
|
||||
class RankFilter(Filter):
|
||||
name: str
|
||||
@@ -31,30 +31,30 @@ class MedianFilter(RankFilter):
|
||||
name: str
|
||||
size: int
|
||||
rank: int
|
||||
def __init__(self, size: int = ...) -> None: ...
|
||||
def __init__(self, size: int = 3) -> None: ...
|
||||
|
||||
class MinFilter(RankFilter):
|
||||
name: str
|
||||
size: int
|
||||
rank: int
|
||||
def __init__(self, size: int = ...) -> None: ...
|
||||
def __init__(self, size: int = 3) -> None: ...
|
||||
|
||||
class MaxFilter(RankFilter):
|
||||
name: str
|
||||
size: int
|
||||
rank: int
|
||||
def __init__(self, size: int = ...) -> None: ...
|
||||
def __init__(self, size: int = 3) -> None: ...
|
||||
|
||||
class ModeFilter(Filter):
|
||||
name: str
|
||||
size: int
|
||||
def __init__(self, size: int = ...) -> None: ...
|
||||
def __init__(self, size: int = 3) -> None: ...
|
||||
def filter(self, image) -> Image: ...
|
||||
|
||||
class GaussianBlur(MultibandFilter):
|
||||
name: str
|
||||
radius: float
|
||||
def __init__(self, radius: float = ...) -> None: ...
|
||||
def __init__(self, radius: float = 2) -> None: ...
|
||||
def filter(self, image) -> Image: ...
|
||||
|
||||
class BoxBlur(MultibandFilter):
|
||||
@@ -68,7 +68,7 @@ class UnsharpMask(MultibandFilter):
|
||||
radius: float
|
||||
percent: int
|
||||
threshold: int
|
||||
def __init__(self, radius: float = ..., percent: int = ..., threshold: int = ...) -> None: ...
|
||||
def __init__(self, radius: float = 2, percent: int = 150, threshold: int = 3) -> None: ...
|
||||
def filter(self, image) -> Image: ...
|
||||
|
||||
class BLUR(BuiltinFilter):
|
||||
@@ -117,22 +117,20 @@ class Color3DLUT(MultibandFilter):
|
||||
channels: int
|
||||
mode: str | None
|
||||
table: Any
|
||||
def __init__(
|
||||
self, size: int | Iterable[int], table, channels: int = ..., target_mode: str | None = ..., **kwargs
|
||||
) -> None: ...
|
||||
def __init__(self, size: int | Iterable[int], table, channels: int = 3, target_mode: str | None = None, **kwargs) -> None: ...
|
||||
@classmethod
|
||||
def generate(
|
||||
cls,
|
||||
size: int | tuple[int, int, int],
|
||||
callback: Callable[[float, float, float], Iterable[float]],
|
||||
channels: int = ...,
|
||||
target_mode: str | None = ...,
|
||||
channels: int = 3,
|
||||
target_mode: str | None = None,
|
||||
) -> Self: ...
|
||||
def transform(
|
||||
self,
|
||||
callback: Callable[..., Iterable[float]],
|
||||
with_normals: bool = ...,
|
||||
channels: Literal[3, 4] | None = ...,
|
||||
target_mode: Incomplete | None = ...,
|
||||
with_normals: bool = False,
|
||||
channels: Literal[3, 4] | None = None,
|
||||
target_mode: Incomplete | None = None,
|
||||
) -> Self: ...
|
||||
def filter(self, image) -> Image: ...
|
||||
|
||||
@@ -15,7 +15,7 @@ class _Font(Protocol):
|
||||
|
||||
class ImageFont:
|
||||
def getsize(self, text: str | bytes, *args, **kwargs) -> tuple[int, int]: ...
|
||||
def getmask(self, text: str | bytes, mode: str = ..., direction=..., features=...): ...
|
||||
def getmask(self, text: str | bytes, mode: str = "", direction=..., features=...): ...
|
||||
|
||||
class FreeTypeFont:
|
||||
path: str | bytes | SupportsRead[bytes] | None
|
||||
@@ -25,84 +25,84 @@ class FreeTypeFont:
|
||||
layout_engine: Layout
|
||||
def __init__(
|
||||
self,
|
||||
font: str | bytes | SupportsRead[bytes] | None = ...,
|
||||
size: int = ...,
|
||||
index: int = ...,
|
||||
encoding: str = ...,
|
||||
layout_engine: Layout | None = ...,
|
||||
font: str | bytes | SupportsRead[bytes] | None = None,
|
||||
size: int = 10,
|
||||
index: int = 0,
|
||||
encoding: str = "",
|
||||
layout_engine: Layout | None = None,
|
||||
) -> None: ...
|
||||
def getname(self) -> tuple[str, str]: ...
|
||||
def getmetrics(self) -> tuple[int, int]: ...
|
||||
def getlength(
|
||||
self,
|
||||
text: str | bytes,
|
||||
mode: str = ...,
|
||||
direction: Literal["ltr", "rtl", "ttb"] | None = ...,
|
||||
features: Incomplete | None = ...,
|
||||
language: str | None = ...,
|
||||
mode: str = "",
|
||||
direction: Literal["ltr", "rtl", "ttb"] | None = None,
|
||||
features: Incomplete | None = None,
|
||||
language: str | None = None,
|
||||
) -> int: ...
|
||||
def getbbox(
|
||||
self,
|
||||
text: str | bytes,
|
||||
mode: str = ...,
|
||||
direction=...,
|
||||
features=...,
|
||||
language: str | None = ...,
|
||||
stroke_width: int = ...,
|
||||
anchor: str | None = ...,
|
||||
mode: str = "",
|
||||
direction=None,
|
||||
features=None,
|
||||
language: str | None = None,
|
||||
stroke_width: int = 0,
|
||||
anchor: str | None = None,
|
||||
) -> tuple[int, int, int, int]: ...
|
||||
def getsize(
|
||||
self,
|
||||
text: str | bytes,
|
||||
direction: Literal["ltr", "rtl", "ttb"] | None = ...,
|
||||
features: Incomplete | None = ...,
|
||||
language: str | None = ...,
|
||||
stroke_width: int = ...,
|
||||
direction: Literal["ltr", "rtl", "ttb"] | None = None,
|
||||
features: Incomplete | None = None,
|
||||
language: str | None = None,
|
||||
stroke_width: int = 0,
|
||||
) -> tuple[int, int]: ...
|
||||
def getsize_multiline(
|
||||
self,
|
||||
text: str | bytes,
|
||||
direction: Literal["ltr", "rtl", "ttb"] | None = ...,
|
||||
spacing: float = ...,
|
||||
features: Incomplete | None = ...,
|
||||
language: str | None = ...,
|
||||
stroke_width: float = ...,
|
||||
direction: Literal["ltr", "rtl", "ttb"] | None = None,
|
||||
spacing: float = 4,
|
||||
features: Incomplete | None = None,
|
||||
language: str | None = None,
|
||||
stroke_width: float = 0,
|
||||
) -> tuple[int, int]: ...
|
||||
def getoffset(self, text: str | bytes) -> tuple[int, int]: ...
|
||||
def getmask(
|
||||
self,
|
||||
text: str | bytes,
|
||||
mode: str = ...,
|
||||
direction: Literal["ltr", "rtl", "ttb"] | None = ...,
|
||||
features: Incomplete | None = ...,
|
||||
language: str | None = ...,
|
||||
stroke_width: float = ...,
|
||||
anchor: str | None = ...,
|
||||
ink=...,
|
||||
start: tuple[float, float] | None = ...,
|
||||
mode: str = "",
|
||||
direction: Literal["ltr", "rtl", "ttb"] | None = None,
|
||||
features: Incomplete | None = None,
|
||||
language: str | None = None,
|
||||
stroke_width: float = 0,
|
||||
anchor: str | None = None,
|
||||
ink=0,
|
||||
start: tuple[float, float] | None = None,
|
||||
): ...
|
||||
def getmask2(
|
||||
self,
|
||||
text: str | bytes,
|
||||
mode: str = ...,
|
||||
mode: str = "",
|
||||
fill=...,
|
||||
direction: Literal["ltr", "rtl", "ttb"] | None = ...,
|
||||
features: Incomplete | None = ...,
|
||||
language: str | None = ...,
|
||||
stroke_width: float = ...,
|
||||
anchor: str | None = ...,
|
||||
ink=...,
|
||||
start: tuple[float, float] | None = ...,
|
||||
direction: Literal["ltr", "rtl", "ttb"] | None = None,
|
||||
features: Incomplete | None = None,
|
||||
language: str | None = None,
|
||||
stroke_width: float = 0,
|
||||
anchor: str | None = None,
|
||||
ink=0,
|
||||
start: tuple[float, float] | None = None,
|
||||
*args,
|
||||
**kwargs,
|
||||
): ...
|
||||
def font_variant(
|
||||
self,
|
||||
font: str | bytes | SupportsRead[bytes] | None = ...,
|
||||
size: int | None = ...,
|
||||
index: int | None = ...,
|
||||
encoding: str | None = ...,
|
||||
layout_engine: Layout | None = ...,
|
||||
font: str | bytes | SupportsRead[bytes] | None = None,
|
||||
size: int | None = None,
|
||||
index: int | None = None,
|
||||
encoding: str | None = None,
|
||||
layout_engine: Layout | None = None,
|
||||
) -> FreeTypeFont: ...
|
||||
def get_variation_names(self): ...
|
||||
def set_variation_by_name(self, name): ...
|
||||
@@ -110,17 +110,17 @@ class FreeTypeFont:
|
||||
def set_variation_by_axes(self, axes): ...
|
||||
|
||||
class TransposedFont:
|
||||
def __init__(self, font: _Font, orientation: int | None = ...) -> None: ...
|
||||
def __init__(self, font: _Font, orientation: int | None = None) -> None: ...
|
||||
def getsize(self, text: str | bytes, *args, **kwargs) -> tuple[int, int]: ...
|
||||
def getmask(self, text: str | bytes, mode: str = ..., *args, **kwargs): ...
|
||||
def getmask(self, text: str | bytes, mode: str = "", *args, **kwargs): ...
|
||||
|
||||
def load(filename: FileDescriptorOrPath) -> ImageFont: ...
|
||||
def truetype(
|
||||
font: str | bytes | SupportsRead[bytes] | None = ...,
|
||||
size: int = ...,
|
||||
index: int = ...,
|
||||
encoding: str = ...,
|
||||
layout_engine: Layout | None = ...,
|
||||
font: str | bytes | SupportsRead[bytes] | None = None,
|
||||
size: int = 10,
|
||||
index: int = 0,
|
||||
encoding: str = "",
|
||||
layout_engine: Layout | None = None,
|
||||
) -> FreeTypeFont: ...
|
||||
def load_path(filename: str | bytes) -> ImageFont: ...
|
||||
def load_default() -> ImageFont: ...
|
||||
|
||||
@@ -3,6 +3,6 @@ from _typeshed import Incomplete
|
||||
from .Image import Image, _Box
|
||||
|
||||
def grab(
|
||||
bbox: _Box | None = ..., include_layered_windows: bool = ..., all_screens: bool = ..., xdisplay: Incomplete | None = ...
|
||||
bbox: _Box | None = None, include_layered_windows: bool = False, all_screens: bool = False, xdisplay: Incomplete | None = None
|
||||
) -> Image: ...
|
||||
def grabclipboard() -> Image | None: ...
|
||||
|
||||
@@ -4,7 +4,7 @@ from typing import Any
|
||||
class _Operand:
|
||||
im: Any
|
||||
def __init__(self, im) -> None: ...
|
||||
def apply(self, op, im1, im2: Incomplete | None = ..., mode: Incomplete | None = ...): ...
|
||||
def apply(self, op, im1, im2: Incomplete | None = None, mode: Incomplete | None = None): ...
|
||||
def __bool__(self) -> bool: ...
|
||||
def __abs__(self): ...
|
||||
def __pos__(self): ...
|
||||
@@ -47,4 +47,4 @@ def imagemath_convert(self, mode): ...
|
||||
|
||||
ops: Any
|
||||
|
||||
def eval(expression, _dict=..., **kw): ...
|
||||
def eval(expression, _dict={}, **kw): ...
|
||||
|
||||
@@ -9,7 +9,7 @@ MIRROR_MATRIX: list[int]
|
||||
class LutBuilder:
|
||||
patterns: list[str]
|
||||
lut: bytearray
|
||||
def __init__(self, patterns: list[str] | None = ..., op_name: str | None = ...) -> None: ...
|
||||
def __init__(self, patterns: list[str] | None = None, op_name: str | None = None) -> None: ...
|
||||
def add_patterns(self, patterns: list[str]) -> None: ...
|
||||
def build_default_lut(self) -> None: ...
|
||||
def get_lut(self) -> bytearray: ...
|
||||
@@ -17,7 +17,7 @@ class LutBuilder:
|
||||
|
||||
class MorphOp:
|
||||
lut: bytearray
|
||||
def __init__(self, lut: bytearray | None = ..., op_name: str | None = ..., patterns: list[str] | None = ...) -> None: ...
|
||||
def __init__(self, lut: bytearray | None = None, op_name: str | None = None, patterns: list[str] | None = None) -> None: ...
|
||||
def apply(self, image: Image) -> tuple[int, Image]: ...
|
||||
def match(self, image: Image) -> list[tuple[int, int]]: ...
|
||||
def get_on_pixels(self, image: Image) -> list[tuple[int, int]]: ...
|
||||
|
||||
@@ -12,37 +12,37 @@ class _Deformer(Protocol):
|
||||
def getmesh(self, image: Image): ...
|
||||
|
||||
def autocontrast(
|
||||
image: Image, cutoff: int = ..., ignore: int | None = ..., mask: Image | None = ..., preserve_tone: bool = ...
|
||||
image: Image, cutoff: int = 0, ignore: int | None = None, mask: Image | None = None, preserve_tone: bool = False
|
||||
) -> Image: ...
|
||||
def colorize(
|
||||
image: Image,
|
||||
black: int | str,
|
||||
white: int | str,
|
||||
mid: int | str | None = ...,
|
||||
blackpoint: int = ...,
|
||||
whitepoint: int = ...,
|
||||
midpoint: int = ...,
|
||||
mid: int | str | None = None,
|
||||
blackpoint: int = 0,
|
||||
whitepoint: int = 255,
|
||||
midpoint: int = 127,
|
||||
) -> Image: ...
|
||||
def contain(image: Image, size: _Size, method: Resampling | _Resample = ...) -> Image: ...
|
||||
def pad(
|
||||
image: Image,
|
||||
size: _Size,
|
||||
method: Resampling | _Resample = ...,
|
||||
color: Incomplete | None = ...,
|
||||
centering: Iterable[float] = ...,
|
||||
color: Incomplete | None = None,
|
||||
centering: Iterable[float] = (0.5, 0.5),
|
||||
) -> Image: ...
|
||||
def crop(image: Image, border: _Border = ...) -> Image: ...
|
||||
def crop(image: Image, border: _Border = 0) -> Image: ...
|
||||
def scale(image: Image, factor: float, resample: Resampling | _Resample = ...) -> Image: ...
|
||||
def deform(image: Image, deformer: _Deformer, resample: Resampling | _Resample = ...) -> Image: ...
|
||||
def equalize(image: Image, mask: Incomplete | None = ...) -> Image: ...
|
||||
def expand(image: Image, border: _Border = ..., fill: _Ink = ...) -> Image: ...
|
||||
def equalize(image: Image, mask: Incomplete | None = None) -> Image: ...
|
||||
def expand(image: Image, border: _Border = 0, fill: _Ink = 0) -> Image: ...
|
||||
def fit(
|
||||
image: Image, size: _Size, method: Resampling | _Resample = ..., bleed: float = ..., centering: Iterable[float] = ...
|
||||
image: Image, size: _Size, method: Resampling | _Resample = ..., bleed: float = 0.0, centering: Iterable[float] = (0.5, 0.5)
|
||||
) -> Image: ...
|
||||
def flip(image: Image) -> Image: ...
|
||||
def grayscale(image: Image) -> Image: ...
|
||||
def invert(image: Image) -> Image: ...
|
||||
def mirror(image: Image) -> Image: ...
|
||||
def posterize(image: Image, bits: int) -> Image: ...
|
||||
def solarize(image: Image, threshold: int = ...) -> Image: ...
|
||||
def solarize(image: Image, threshold: int = 128) -> Image: ...
|
||||
def exif_transpose(image: Image) -> Image: ...
|
||||
|
||||
@@ -9,19 +9,19 @@ class ImagePalette:
|
||||
palette: Any
|
||||
colors: Any
|
||||
dirty: Any
|
||||
def __init__(self, mode: str = ..., palette: Incomplete | None = ..., size: int = ...) -> None: ...
|
||||
def __init__(self, mode: str = "RGB", palette: Incomplete | None = None, size: int = 0) -> None: ...
|
||||
def copy(self) -> ImagePalette: ...
|
||||
def getdata(self): ...
|
||||
def tobytes(self) -> bytes: ...
|
||||
tostring = tobytes
|
||||
def getcolor(self, color: tuple[int, int, int], image: Image | None = ...) -> int: ...
|
||||
def getcolor(self, color: tuple[int, int, int], image: Image | None = None) -> int: ...
|
||||
def save(self, fp) -> None: ...
|
||||
|
||||
def raw(rawmode, data): ...
|
||||
def make_linear_lut(black, white): ...
|
||||
def make_gamma_lut(exp): ...
|
||||
def negative(mode: str = ...): ...
|
||||
def random(mode: str = ...): ...
|
||||
def sepia(white: str = ...): ...
|
||||
def wedge(mode: str = ...): ...
|
||||
def negative(mode: str = "RGB"): ...
|
||||
def random(mode: str = "RGB"): ...
|
||||
def sepia(white: str = "#fff0c0"): ...
|
||||
def wedge(mode: str = "RGB"): ...
|
||||
def load(filename): ...
|
||||
|
||||
@@ -13,7 +13,7 @@ qt_versions: Any
|
||||
qt_is_installed: bool
|
||||
qt_version: Any
|
||||
|
||||
def rgb(r: int, g: int, b: int, a: int = ...) -> int: ...
|
||||
def rgb(r: int, g: int, b: int, a: int = 255) -> int: ...
|
||||
def fromqimage(im: ImageQt | _QImage) -> Image: ...
|
||||
def fromqpixmap(im: ImageQt | _QImage) -> Image: ...
|
||||
def align8to32(bytes: bytes, width: int, mode: Literal["1", "L", "P"]) -> bytes: ...
|
||||
|
||||
@@ -9,4 +9,4 @@ class Iterator:
|
||||
def __iter__(self): ...
|
||||
def __next__(self): ...
|
||||
|
||||
def all_frames(im, func: Incomplete | None = ...): ...
|
||||
def all_frames(im, func: Incomplete | None = None): ...
|
||||
|
||||
@@ -2,8 +2,8 @@ from _typeshed import Incomplete
|
||||
from typing import Any
|
||||
from typing_extensions import Literal
|
||||
|
||||
def register(viewer, order: int = ...) -> None: ...
|
||||
def show(image, title: Incomplete | None = ..., **options): ...
|
||||
def register(viewer, order: int = 1) -> None: ...
|
||||
def show(image, title: Incomplete | None = None, **options): ...
|
||||
|
||||
class Viewer:
|
||||
def show(self, image, **options): ...
|
||||
@@ -13,7 +13,7 @@ class Viewer:
|
||||
def get_command(self, file, **options) -> None: ...
|
||||
def save_image(self, image): ...
|
||||
def show_image(self, image, **options): ...
|
||||
def show_file(self, path: Incomplete | None = ..., **options): ...
|
||||
def show_file(self, path: Incomplete | None = None, **options): ...
|
||||
|
||||
class WindowsViewer(Viewer):
|
||||
format: str
|
||||
@@ -24,19 +24,19 @@ class MacViewer(Viewer):
|
||||
format: str
|
||||
options: Any
|
||||
def get_command(self, file, **options): ...
|
||||
def show_file(self, path: Incomplete | None = ..., **options): ...
|
||||
def show_file(self, path: Incomplete | None = None, **options): ...
|
||||
|
||||
class UnixViewer(Viewer):
|
||||
format: str
|
||||
options: Any
|
||||
def get_command(self, file, **options): ...
|
||||
def show_file(self, path: Incomplete | None = ..., **options): ...
|
||||
def show_file(self, path: Incomplete | None = None, **options): ...
|
||||
|
||||
class XDGViewer(UnixViewer):
|
||||
def get_command_ex(self, file, **options) -> tuple[Literal["xdg-open"], Literal["xdg-open"]]: ...
|
||||
|
||||
class DisplayViewer(UnixViewer):
|
||||
def get_command_ex(self, file, title: str | None = ..., **options): ...
|
||||
def get_command_ex(self, file, title: str | None = None, **options): ...
|
||||
|
||||
class GmDisplayViewer(UnixViewer):
|
||||
def get_command_ex(self, file, **options): ...
|
||||
@@ -45,7 +45,7 @@ class EogViewer(UnixViewer):
|
||||
def get_command_ex(self, file, **options): ...
|
||||
|
||||
class XVViewer(UnixViewer):
|
||||
def get_command_ex(self, file, title: Incomplete | None = ..., **options): ...
|
||||
def get_command_ex(self, file, title: Incomplete | None = None, **options): ...
|
||||
|
||||
class IPythonViewer(Viewer):
|
||||
def show_image(self, image, **options): ...
|
||||
|
||||
@@ -4,7 +4,7 @@ from typing import Any
|
||||
class Stat:
|
||||
h: Any
|
||||
bands: Any
|
||||
def __init__(self, image_or_list, mask: Incomplete | None = ...) -> None: ...
|
||||
def __init__(self, image_or_list, mask: Incomplete | None = None) -> None: ...
|
||||
def __getattr__(self, id: str): ...
|
||||
|
||||
Global = Stat
|
||||
|
||||
@@ -27,7 +27,7 @@ class PhotoImage(tkinter._PhotoImageLike):
|
||||
def width(self) -> int: ...
|
||||
def height(self) -> int: ...
|
||||
# box is deprecated and unused
|
||||
def paste(self, im: Image, box: _Box | None = ...) -> None: ...
|
||||
def paste(self, im: Image, box: _Box | None = None) -> None: ...
|
||||
|
||||
class BitmapImage(tkinter._BitmapImageLike):
|
||||
def __init__(
|
||||
|
||||
@@ -15,17 +15,17 @@ class Dib:
|
||||
image: Any
|
||||
mode: Any
|
||||
size: Any
|
||||
def __init__(self, image, size: Incomplete | None = ...) -> None: ...
|
||||
def __init__(self, image, size: Incomplete | None = None) -> None: ...
|
||||
def expose(self, handle): ...
|
||||
def draw(self, handle, dst, src: Incomplete | None = ...): ...
|
||||
def draw(self, handle, dst, src: Incomplete | None = None): ...
|
||||
def query_palette(self, handle): ...
|
||||
def paste(self, im, box: Incomplete | None = ...) -> None: ...
|
||||
def paste(self, im, box: Incomplete | None = None) -> None: ...
|
||||
def frombytes(self, buffer): ...
|
||||
def tobytes(self): ...
|
||||
|
||||
class Window:
|
||||
hwnd: Any
|
||||
def __init__(self, title: str = ..., width: Incomplete | None = ..., height: Incomplete | None = ...) -> None: ...
|
||||
def __init__(self, title: str = "PIL", width: Incomplete | None = None, height: Incomplete | None = None) -> None: ...
|
||||
def ui_handle_clear(self, dc, x0, y0, x1, y1) -> None: ...
|
||||
def ui_handle_damage(self, x0, y0, x1, y1) -> None: ...
|
||||
def ui_handle_destroy(self) -> None: ...
|
||||
@@ -35,5 +35,5 @@ class Window:
|
||||
|
||||
class ImageWindow(Window):
|
||||
image: Any
|
||||
def __init__(self, image, title: str = ...) -> None: ...
|
||||
def __init__(self, image, title: str = "PIL") -> None: ...
|
||||
def ui_handle_repair(self, dc, x0, y0, x1, y1) -> None: ...
|
||||
|
||||
@@ -30,4 +30,4 @@ samplings: Any
|
||||
|
||||
def convert_dict_qtables(qtables): ...
|
||||
def get_sampling(im): ...
|
||||
def jpeg_factory(fp: Incomplete | None = ..., filename: Incomplete | None = ...): ...
|
||||
def jpeg_factory(fp: Incomplete | None = None, filename: Incomplete | None = None): ...
|
||||
|
||||
@@ -13,4 +13,4 @@ class MpoImageFile(JpegImageFile):
|
||||
def seek(self, frame) -> None: ...
|
||||
def tell(self): ...
|
||||
@staticmethod
|
||||
def adopt(jpeg_instance, mpheader: Incomplete | None = ...): ...
|
||||
def adopt(jpeg_instance, mpheader: Incomplete | None = None): ...
|
||||
|
||||
@@ -4,7 +4,7 @@ from .Image import Image
|
||||
|
||||
class PSDraw:
|
||||
fp: SupportsWrite[bytes]
|
||||
def __init__(self, fp: SupportsWrite[bytes] | None = ...) -> None: ...
|
||||
def __init__(self, fp: SupportsWrite[bytes] | None = None) -> None: ...
|
||||
isofont: dict[bytes, int]
|
||||
def begin_document(self, id: Unused = None) -> None: ...
|
||||
def end_document(self) -> None: ...
|
||||
@@ -12,7 +12,7 @@ class PSDraw:
|
||||
def line(self, xy0: tuple[int, int], xy1: tuple[int, int]) -> None: ...
|
||||
def rectangle(self, box: tuple[int, int, int, int]) -> None: ...
|
||||
def text(self, xy: tuple[int, int], text: str) -> None: ...
|
||||
def image(self, box: tuple[int, int, int, int], im: Image, dpi: float | None = ...) -> None: ...
|
||||
def image(self, box: tuple[int, int, int, int], im: Image, dpi: float | None = None) -> None: ...
|
||||
|
||||
EDROFF_PS: bytes
|
||||
VDI_PS: bytes
|
||||
|
||||
@@ -22,4 +22,4 @@ class PcfFontFile(FontFile):
|
||||
toc: Any
|
||||
fp: Any
|
||||
info: Any
|
||||
def __init__(self, fp, charset_encoding: str = ...) -> None: ...
|
||||
def __init__(self, fp, charset_encoding: str = "iso8859-1") -> None: ...
|
||||
|
||||
@@ -90,11 +90,11 @@ class PdfParser:
|
||||
xref_table: Any
|
||||
def __init__(
|
||||
self,
|
||||
filename: Incomplete | None = ...,
|
||||
f: Incomplete | None = ...,
|
||||
buf: Incomplete | None = ...,
|
||||
start_offset: int = ...,
|
||||
mode: str = ...,
|
||||
filename: Incomplete | None = None,
|
||||
f: Incomplete | None = None,
|
||||
buf: Incomplete | None = None,
|
||||
start_offset: int = 0,
|
||||
mode: str = "rb",
|
||||
) -> None: ...
|
||||
def __enter__(self): ...
|
||||
def __exit__(
|
||||
@@ -108,7 +108,7 @@ class PdfParser:
|
||||
def write_comment(self, s) -> None: ...
|
||||
def write_catalog(self): ...
|
||||
def rewrite_pages(self) -> None: ...
|
||||
def write_xref_and_trailer(self, new_root_ref: Incomplete | None = ...) -> None: ...
|
||||
def write_xref_and_trailer(self, new_root_ref: Incomplete | None = None) -> None: ...
|
||||
def write_page(self, ref, *objs, **dict_obj): ...
|
||||
def write_obj(self, ref, *objs, **dict_obj): ...
|
||||
def del_root(self) -> None: ...
|
||||
@@ -116,7 +116,7 @@ class PdfParser:
|
||||
def get_buf_from_file(f): ...
|
||||
file_size_this: Any
|
||||
def read_pdf_info(self) -> None: ...
|
||||
def next_object_id(self, offset: Incomplete | None = ...): ...
|
||||
def next_object_id(self, offset: Incomplete | None = None): ...
|
||||
delimiter: bytes
|
||||
delimiter_or_ws: bytes
|
||||
whitespace: bytes
|
||||
@@ -138,7 +138,7 @@ class PdfParser:
|
||||
def interpret_trailer(cls, trailer_data): ...
|
||||
re_hashes_in_name: Any
|
||||
@classmethod
|
||||
def interpret_name(cls, raw, as_text: bool = ...): ...
|
||||
def interpret_name(cls, raw, as_text: bool = False): ...
|
||||
re_null: Any
|
||||
re_true: Any
|
||||
re_false: Any
|
||||
@@ -155,7 +155,7 @@ class PdfParser:
|
||||
re_stream_start: Any
|
||||
re_stream_end: Any
|
||||
@classmethod
|
||||
def get_value(cls, data, offset, expect_indirect: Incomplete | None = ..., max_nesting: int = ...): ...
|
||||
def get_value(cls, data, offset, expect_indirect: Incomplete | None = None, max_nesting: int = -1): ...
|
||||
re_lit_str_token: Any
|
||||
escaped_chars: Any
|
||||
@classmethod
|
||||
@@ -164,5 +164,5 @@ class PdfParser:
|
||||
re_xref_subsection_start: Any
|
||||
re_xref_entry: Any
|
||||
def read_xref_table(self, xref_section_offset): ...
|
||||
def read_indirect(self, ref, max_nesting: int = ...): ...
|
||||
def linearize_page_tree(self, node: Incomplete | None = ...): ...
|
||||
def read_indirect(self, ref, max_nesting: int = -1): ...
|
||||
def linearize_page_tree(self, node: Incomplete | None = None): ...
|
||||
|
||||
@@ -39,20 +39,20 @@ class ChunkStream:
|
||||
def call(self, cid, pos, length): ...
|
||||
def crc(self, cid, data) -> None: ...
|
||||
def crc_skip(self, cid, data) -> None: ...
|
||||
def verify(self, endchunk: bytes = ...): ...
|
||||
def verify(self, endchunk: bytes = b"IEND"): ...
|
||||
|
||||
class iTXt(str):
|
||||
lang: Any
|
||||
tkey: Any
|
||||
@staticmethod
|
||||
def __new__(cls, text, lang: Incomplete | None = ..., tkey: Incomplete | None = ...): ...
|
||||
def __new__(cls, text, lang: Incomplete | None = None, tkey: Incomplete | None = None): ...
|
||||
|
||||
class PngInfo:
|
||||
chunks: Any
|
||||
def __init__(self) -> None: ...
|
||||
def add(self, cid, data, after_idat: bool = ...) -> None: ...
|
||||
def add_itxt(self, key, value, lang: str = ..., tkey: str = ..., zip: bool = ...) -> None: ...
|
||||
def add_text(self, key, value, zip: bool = ...): ...
|
||||
def add(self, cid, data, after_idat: bool = False) -> None: ...
|
||||
def add_itxt(self, key, value, lang: str = "", tkey: str = "", zip: bool = False) -> None: ...
|
||||
def add_text(self, key, value, zip: bool = False): ...
|
||||
|
||||
class PngStream(ChunkStream):
|
||||
im_info: Any
|
||||
|
||||
@@ -9,7 +9,7 @@ class PyAccess:
|
||||
image8: Any
|
||||
image32: Any
|
||||
image: Any
|
||||
def __init__(self, img, readonly: bool = ...) -> None: ...
|
||||
def __init__(self, img, readonly: bool = False) -> None: ...
|
||||
def __setitem__(self, xy, color) -> None: ...
|
||||
def __getitem__(self, xy): ...
|
||||
putpixel: Any
|
||||
@@ -59,4 +59,4 @@ class _PyAccessF(PyAccess):
|
||||
|
||||
mode_map: Any
|
||||
|
||||
def new(img, readonly: bool = ...): ...
|
||||
def new(img, readonly: bool = False): ...
|
||||
|
||||
@@ -22,8 +22,8 @@ class SpiderImageFile(ImageFile):
|
||||
stkoffset: Any
|
||||
fp: Any
|
||||
def seek(self, frame) -> None: ...
|
||||
def convert2byte(self, depth: int = ...): ...
|
||||
def convert2byte(self, depth: int = 255): ...
|
||||
def tkPhotoImage(self): ...
|
||||
|
||||
def loadImageSeries(filelist: Incomplete | None = ...): ...
|
||||
def loadImageSeries(filelist: Incomplete | None = None): ...
|
||||
def makeSpiderHeader(im): ...
|
||||
|
||||
@@ -55,7 +55,7 @@ OPEN_INFO: Any
|
||||
PREFIXES: Any
|
||||
|
||||
class IFDRational(Rational):
|
||||
def __init__(self, value, denominator: int = ...) -> None: ...
|
||||
def __init__(self, value, denominator: int = 1) -> None: ...
|
||||
@property
|
||||
def numerator(a): ...
|
||||
@property
|
||||
@@ -93,7 +93,9 @@ class IFDRational(Rational):
|
||||
class ImageFileDirectory_v2(MutableMapping[int, Any]):
|
||||
group: int | None
|
||||
tagtype: dict[int, int]
|
||||
def __init__(self, ifh: bytes = ..., prefix: bytes | None = ..., group: int | None = ...) -> None: ...
|
||||
def __init__(
|
||||
self, ifh: bytes = b"II*\x00\x00\x00\x00\x00", prefix: bytes | None = None, group: int | None = None
|
||||
) -> None: ...
|
||||
@property
|
||||
def prefix(self) -> bytes: ...
|
||||
@property
|
||||
@@ -108,18 +110,18 @@ class ImageFileDirectory_v2(MutableMapping[int, Any]):
|
||||
def __setitem__(self, tag, value) -> None: ...
|
||||
def __delitem__(self, tag) -> None: ...
|
||||
def __iter__(self): ...
|
||||
def load_byte(self, data, legacy_api: bool = ...): ...
|
||||
def load_byte(self, data, legacy_api: bool = True): ...
|
||||
def write_byte(self, data): ...
|
||||
def load_string(self, data, legacy_api: bool = ...): ...
|
||||
def load_string(self, data, legacy_api: bool = True): ...
|
||||
def write_string(self, value: int | str | bytes) -> bytes: ...
|
||||
def load_rational(self, data, legacy_api: bool = ...): ...
|
||||
def load_rational(self, data, legacy_api: bool = True): ...
|
||||
def write_rational(self, *values): ...
|
||||
def load_undefined(self, data, legacy_api: bool = ...): ...
|
||||
def load_undefined(self, data, legacy_api: bool = True): ...
|
||||
def write_undefined(self, value): ...
|
||||
def load_signed_rational(self, data, legacy_api: bool = ...): ...
|
||||
def load_signed_rational(self, data, legacy_api: bool = True): ...
|
||||
def write_signed_rational(self, *values): ...
|
||||
def load(self, fp) -> None: ...
|
||||
def tobytes(self, offset: int = ...): ...
|
||||
def tobytes(self, offset: int = 0): ...
|
||||
def save(self, fp): ...
|
||||
|
||||
class ImageFileDirectory_v1(ImageFileDirectory_v2):
|
||||
@@ -145,7 +147,7 @@ class TiffImageFile(ImageFile):
|
||||
format_description: ClassVar[str]
|
||||
tag_v2: Any
|
||||
tag: Any
|
||||
def __init__(self, fp: Incomplete | None = ..., filename: Incomplete | None = ...) -> None: ...
|
||||
def __init__(self, fp: Incomplete | None = None, filename: Incomplete | None = None) -> None: ...
|
||||
@property
|
||||
def n_frames(self): ...
|
||||
im: Any
|
||||
@@ -163,7 +165,7 @@ class AppendingTiffWriter:
|
||||
close_fp: bool
|
||||
name: Any
|
||||
beginning: Any
|
||||
def __init__(self, fn, new: bool = ...) -> None: ...
|
||||
def __init__(self, fn, new: bool = False) -> None: ...
|
||||
whereToWriteNewIFDOffset: Any
|
||||
offsetOfNewPage: int
|
||||
IIMM: Any
|
||||
@@ -176,7 +178,7 @@ class AppendingTiffWriter:
|
||||
self, exc_type: type[BaseException] | None, exc_value: BaseException | None, traceback: TracebackType | None
|
||||
) -> Literal[False]: ...
|
||||
def tell(self): ...
|
||||
def seek(self, offset, whence=...): ...
|
||||
def seek(self, offset, whence=0): ...
|
||||
def goToEnd(self) -> None: ...
|
||||
endian: Any
|
||||
longFmt: Any
|
||||
@@ -194,4 +196,4 @@ class AppendingTiffWriter:
|
||||
def writeLong(self, value) -> None: ...
|
||||
def close(self) -> None: ...
|
||||
def fixIFD(self) -> None: ...
|
||||
def fixOffsets(self, count, isShort: bool = ..., isLong: bool = ...) -> None: ...
|
||||
def fixOffsets(self, count, isShort: bool = False, isLong: bool = False) -> None: ...
|
||||
|
||||
@@ -12,15 +12,15 @@ class _TagInfo(NamedTuple):
|
||||
class TagInfo(_TagInfo):
|
||||
def __new__(
|
||||
cls,
|
||||
value: Incomplete | None = ...,
|
||||
name: str = ...,
|
||||
type: _TagType | None = ...,
|
||||
length: int | None = ...,
|
||||
enum: dict[str, int] | None = ...,
|
||||
value: Incomplete | None = None,
|
||||
name: str = "unknown",
|
||||
type: _TagType | None = None,
|
||||
length: int | None = None,
|
||||
enum: dict[str, int] | None = None,
|
||||
): ...
|
||||
def cvt_enum(self, value): ...
|
||||
|
||||
def lookup(tag: int, group: int | None = ...) -> _TagInfo: ...
|
||||
def lookup(tag: int, group: int | None = None) -> _TagInfo: ...
|
||||
|
||||
BYTE: Literal[1]
|
||||
ASCII: Literal[2]
|
||||
|
||||
@@ -16,4 +16,4 @@ if sys.platform == "win32":
|
||||
class WmfStubImageFile(StubImageFile):
|
||||
format: ClassVar[Literal["WMF"]]
|
||||
format_description: ClassVar[str]
|
||||
def load(self, dpi: Incomplete | None = ...) -> None: ...
|
||||
def load(self, dpi: Incomplete | None = None) -> None: ...
|
||||
|
||||
@@ -1,11 +1,11 @@
|
||||
def i8(c): ...
|
||||
def o8(i): ...
|
||||
def i16le(c, o: int = ...): ...
|
||||
def si16le(c, o: int = ...): ...
|
||||
def i32le(c, o: int = ...): ...
|
||||
def si32le(c, o: int = ...): ...
|
||||
def i16be(c, o: int = ...): ...
|
||||
def i32be(c, o: int = ...): ...
|
||||
def i16le(c, o: int = 0): ...
|
||||
def si16le(c, o: int = 0): ...
|
||||
def i32le(c, o: int = 0): ...
|
||||
def si32le(c, o: int = 0): ...
|
||||
def i16be(c, o: int = 0): ...
|
||||
def i32be(c, o: int = 0): ...
|
||||
def o16le(i): ...
|
||||
def o32le(i): ...
|
||||
def o16be(i): ...
|
||||
|
||||
@@ -21,4 +21,4 @@ def get_supported_features(): ...
|
||||
def check(feature): ...
|
||||
def version(feature): ...
|
||||
def get_supported(): ...
|
||||
def pilinfo(out: Incomplete | None = ..., supported_formats: bool = ...) -> None: ...
|
||||
def pilinfo(out: Incomplete | None = None, supported_formats: bool = True) -> None: ...
|
||||
|
||||
@@ -28,8 +28,8 @@ class MysqlPacket:
|
||||
def read(self, size): ...
|
||||
def read_all(self): ...
|
||||
def advance(self, length): ...
|
||||
def rewind(self, position: int = ...): ...
|
||||
def get_bytes(self, position, length: int = ...): ...
|
||||
def rewind(self, position: int = 0): ...
|
||||
def get_bytes(self, position, length: int = 1): ...
|
||||
def read_string(self) -> bytes: ...
|
||||
def read_uint8(self) -> Any: ...
|
||||
def read_uint16(self) -> Any: ...
|
||||
@@ -81,87 +81,87 @@ class Connection(Generic[_C]):
|
||||
def __init__(
|
||||
self: Connection[Cursor], # different between overloads
|
||||
*,
|
||||
host: str | None = ...,
|
||||
user: Incomplete | None = ...,
|
||||
password: str = ...,
|
||||
database: Incomplete | None = ...,
|
||||
port: int = ...,
|
||||
unix_socket: Incomplete | None = ...,
|
||||
charset: str = ...,
|
||||
sql_mode: Incomplete | None = ...,
|
||||
read_default_file: Incomplete | None = ...,
|
||||
conv=...,
|
||||
use_unicode: bool | None = ...,
|
||||
client_flag: int = ...,
|
||||
cursorclass: None = ..., # different between overloads
|
||||
init_command: Incomplete | None = ...,
|
||||
connect_timeout: int | None = ...,
|
||||
ssl: Mapping[Any, Any] | None = ...,
|
||||
ssl_ca=...,
|
||||
ssl_cert=...,
|
||||
ssl_disabled=...,
|
||||
ssl_key=...,
|
||||
ssl_verify_cert=...,
|
||||
ssl_verify_identity=...,
|
||||
read_default_group: Incomplete | None = ...,
|
||||
compress: Incomplete | None = ...,
|
||||
named_pipe: Incomplete | None = ...,
|
||||
autocommit: bool | None = ...,
|
||||
db: Incomplete | None = ...,
|
||||
passwd: Incomplete | None = ...,
|
||||
local_infile: Incomplete | None = ...,
|
||||
max_allowed_packet: int = ...,
|
||||
defer_connect: bool | None = ...,
|
||||
auth_plugin_map: Mapping[Any, Any] | None = ...,
|
||||
read_timeout: float | None = ...,
|
||||
write_timeout: float | None = ...,
|
||||
bind_address: Incomplete | None = ...,
|
||||
binary_prefix: bool | None = ...,
|
||||
program_name: Incomplete | None = ...,
|
||||
server_public_key: bytes | None = ...,
|
||||
host: str | None = None,
|
||||
user: Incomplete | None = None,
|
||||
password: str = "",
|
||||
database: Incomplete | None = None,
|
||||
port: int = 0,
|
||||
unix_socket: Incomplete | None = None,
|
||||
charset: str = "",
|
||||
sql_mode: Incomplete | None = None,
|
||||
read_default_file: Incomplete | None = None,
|
||||
conv=None,
|
||||
use_unicode: bool | None = True,
|
||||
client_flag: int = 0,
|
||||
cursorclass: None = None, # different between overloads
|
||||
init_command: Incomplete | None = None,
|
||||
connect_timeout: int | None = 10,
|
||||
ssl: Mapping[Any, Any] | None = None,
|
||||
ssl_ca=None,
|
||||
ssl_cert=None,
|
||||
ssl_disabled=None,
|
||||
ssl_key=None,
|
||||
ssl_verify_cert=None,
|
||||
ssl_verify_identity=None,
|
||||
read_default_group: Incomplete | None = None,
|
||||
compress: Incomplete | None = None,
|
||||
named_pipe: Incomplete | None = None,
|
||||
autocommit: bool | None = False,
|
||||
db: Incomplete | None = None,
|
||||
passwd: Incomplete | None = None,
|
||||
local_infile: Incomplete | None = False,
|
||||
max_allowed_packet: int = 16777216,
|
||||
defer_connect: bool | None = False,
|
||||
auth_plugin_map: Mapping[Any, Any] | None = None,
|
||||
read_timeout: float | None = None,
|
||||
write_timeout: float | None = None,
|
||||
bind_address: Incomplete | None = None,
|
||||
binary_prefix: bool | None = False,
|
||||
program_name: Incomplete | None = None,
|
||||
server_public_key: bytes | None = None,
|
||||
): ...
|
||||
@overload
|
||||
def __init__(
|
||||
self: Connection[_C], # different between overloads
|
||||
*,
|
||||
host: str | None = ...,
|
||||
user: Incomplete | None = ...,
|
||||
password: str = ...,
|
||||
database: Incomplete | None = ...,
|
||||
port: int = ...,
|
||||
unix_socket: Incomplete | None = ...,
|
||||
charset: str = ...,
|
||||
sql_mode: Incomplete | None = ...,
|
||||
read_default_file: Incomplete | None = ...,
|
||||
conv=...,
|
||||
use_unicode: bool | None = ...,
|
||||
client_flag: int = ...,
|
||||
host: str | None = None,
|
||||
user: Incomplete | None = None,
|
||||
password: str = "",
|
||||
database: Incomplete | None = None,
|
||||
port: int = 0,
|
||||
unix_socket: Incomplete | None = None,
|
||||
charset: str = "",
|
||||
sql_mode: Incomplete | None = None,
|
||||
read_default_file: Incomplete | None = None,
|
||||
conv=None,
|
||||
use_unicode: bool | None = True,
|
||||
client_flag: int = 0,
|
||||
cursorclass: type[_C] = ..., # different between overloads
|
||||
init_command: Incomplete | None = ...,
|
||||
connect_timeout: int | None = ...,
|
||||
ssl: Mapping[Any, Any] | None = ...,
|
||||
ssl_ca=...,
|
||||
ssl_cert=...,
|
||||
ssl_disabled=...,
|
||||
ssl_key=...,
|
||||
ssl_verify_cert=...,
|
||||
ssl_verify_identity=...,
|
||||
read_default_group: Incomplete | None = ...,
|
||||
compress: Incomplete | None = ...,
|
||||
named_pipe: Incomplete | None = ...,
|
||||
autocommit: bool | None = ...,
|
||||
db: Incomplete | None = ...,
|
||||
passwd: Incomplete | None = ...,
|
||||
local_infile: Incomplete | None = ...,
|
||||
max_allowed_packet: int = ...,
|
||||
defer_connect: bool | None = ...,
|
||||
auth_plugin_map: Mapping[Any, Any] | None = ...,
|
||||
read_timeout: float | None = ...,
|
||||
write_timeout: float | None = ...,
|
||||
bind_address: Incomplete | None = ...,
|
||||
binary_prefix: bool | None = ...,
|
||||
program_name: Incomplete | None = ...,
|
||||
server_public_key: bytes | None = ...,
|
||||
init_command: Incomplete | None = None,
|
||||
connect_timeout: int | None = 10,
|
||||
ssl: Mapping[Any, Any] | None = None,
|
||||
ssl_ca=None,
|
||||
ssl_cert=None,
|
||||
ssl_disabled=None,
|
||||
ssl_key=None,
|
||||
ssl_verify_cert=None,
|
||||
ssl_verify_identity=None,
|
||||
read_default_group: Incomplete | None = None,
|
||||
compress: Incomplete | None = None,
|
||||
named_pipe: Incomplete | None = None,
|
||||
autocommit: bool | None = False,
|
||||
db: Incomplete | None = None,
|
||||
passwd: Incomplete | None = None,
|
||||
local_infile: Incomplete | None = False,
|
||||
max_allowed_packet: int = 16777216,
|
||||
defer_connect: bool | None = False,
|
||||
auth_plugin_map: Mapping[Any, Any] | None = None,
|
||||
read_timeout: float | None = None,
|
||||
write_timeout: float | None = None,
|
||||
bind_address: Incomplete | None = None,
|
||||
binary_prefix: bool | None = False,
|
||||
program_name: Incomplete | None = None,
|
||||
server_public_key: bytes | None = None,
|
||||
): ...
|
||||
socket: Any
|
||||
rfile: Any
|
||||
@@ -175,20 +175,20 @@ class Connection(Generic[_C]):
|
||||
def begin(self) -> None: ...
|
||||
def rollback(self) -> None: ...
|
||||
def select_db(self, db) -> None: ...
|
||||
def escape(self, obj, mapping: Mapping[Any, Any] | None = ...): ...
|
||||
def escape(self, obj, mapping: Mapping[Any, Any] | None = None): ...
|
||||
def literal(self, obj): ...
|
||||
def escape_string(self, s: AnyStr) -> AnyStr: ...
|
||||
@overload
|
||||
def cursor(self, cursor: None = ...) -> _C: ...
|
||||
def cursor(self, cursor: None = None) -> _C: ...
|
||||
@overload
|
||||
def cursor(self, cursor: type[_C2]) -> _C2: ...
|
||||
def query(self, sql, unbuffered: bool = ...) -> int: ...
|
||||
def next_result(self, unbuffered: bool = ...) -> int: ...
|
||||
def query(self, sql, unbuffered: bool = False) -> int: ...
|
||||
def next_result(self, unbuffered: bool = False) -> int: ...
|
||||
def affected_rows(self): ...
|
||||
def kill(self, thread_id): ...
|
||||
def ping(self, reconnect: bool = ...) -> None: ...
|
||||
def ping(self, reconnect: bool = True) -> None: ...
|
||||
def set_charset(self, charset) -> None: ...
|
||||
def connect(self, sock: _socket | None = ...) -> None: ...
|
||||
def connect(self, sock: _socket | None = None) -> None: ...
|
||||
def write_packet(self, payload) -> None: ...
|
||||
def _read_packet(self, packet_type=...): ...
|
||||
def insert_id(self): ...
|
||||
|
||||
@@ -9,23 +9,23 @@ from typing_extensions import TypeAlias
|
||||
_EscaperMapping: TypeAlias = Mapping[type[object], Callable[..., str]] | None
|
||||
_T = TypeVar("_T")
|
||||
|
||||
def escape_item(val: object, charset: object, mapping: _EscaperMapping = ...) -> str: ...
|
||||
def escape_dict(val: Mapping[str, object], charset: object, mapping: _EscaperMapping = ...) -> dict[str, str]: ...
|
||||
def escape_sequence(val: Sequence[object], charset: object, mapping: _EscaperMapping = ...) -> str: ...
|
||||
def escape_set(val: set[object], charset: object, mapping: _EscaperMapping = ...) -> str: ...
|
||||
def escape_bool(value: bool, mapping: _EscaperMapping = ...) -> str: ...
|
||||
def escape_int(value: int, mapping: _EscaperMapping = ...) -> str: ...
|
||||
def escape_float(value: float, mapping: _EscaperMapping = ...) -> str: ...
|
||||
def escape_string(value: str, mapping: _EscaperMapping = ...) -> str: ...
|
||||
def escape_bytes_prefixed(value: bytes, mapping: _EscaperMapping = ...) -> str: ...
|
||||
def escape_bytes(value: bytes, mapping: _EscaperMapping = ...) -> str: ...
|
||||
def escape_str(value: str, mapping: _EscaperMapping = ...) -> str: ...
|
||||
def escape_None(value: None, mapping: _EscaperMapping = ...) -> str: ...
|
||||
def escape_timedelta(obj: datetime.timedelta, mapping: _EscaperMapping = ...) -> str: ...
|
||||
def escape_time(obj: datetime.time, mapping: _EscaperMapping = ...) -> str: ...
|
||||
def escape_datetime(obj: datetime.datetime, mapping: _EscaperMapping = ...) -> str: ...
|
||||
def escape_date(obj: datetime.date, mapping: _EscaperMapping = ...) -> str: ...
|
||||
def escape_struct_time(obj: time.struct_time, mapping: _EscaperMapping = ...) -> str: ...
|
||||
def escape_item(val: object, charset: object, mapping: _EscaperMapping = None) -> str: ...
|
||||
def escape_dict(val: Mapping[str, object], charset: object, mapping: _EscaperMapping = None) -> dict[str, str]: ...
|
||||
def escape_sequence(val: Sequence[object], charset: object, mapping: _EscaperMapping = None) -> str: ...
|
||||
def escape_set(val: set[object], charset: object, mapping: _EscaperMapping = None) -> str: ...
|
||||
def escape_bool(value: bool, mapping: _EscaperMapping = None) -> str: ...
|
||||
def escape_int(value: int, mapping: _EscaperMapping = None) -> str: ...
|
||||
def escape_float(value: float, mapping: _EscaperMapping = None) -> str: ...
|
||||
def escape_string(value: str, mapping: _EscaperMapping = None) -> str: ...
|
||||
def escape_bytes_prefixed(value: bytes, mapping: _EscaperMapping = None) -> str: ...
|
||||
def escape_bytes(value: bytes, mapping: _EscaperMapping = None) -> str: ...
|
||||
def escape_str(value: str, mapping: _EscaperMapping = None) -> str: ...
|
||||
def escape_None(value: None, mapping: _EscaperMapping = None) -> str: ...
|
||||
def escape_timedelta(obj: datetime.timedelta, mapping: _EscaperMapping = None) -> str: ...
|
||||
def escape_time(obj: datetime.time, mapping: _EscaperMapping = None) -> str: ...
|
||||
def escape_datetime(obj: datetime.datetime, mapping: _EscaperMapping = None) -> str: ...
|
||||
def escape_date(obj: datetime.date, mapping: _EscaperMapping = None) -> str: ...
|
||||
def escape_struct_time(obj: time.struct_time, mapping: _EscaperMapping = None) -> str: ...
|
||||
def Decimal2Literal(o: Decimal, d: Unused) -> str: ...
|
||||
def convert_datetime(obj: str | bytes) -> datetime.datetime | str: ...
|
||||
def convert_timedelta(obj: str | bytes) -> datetime.timedelta | str: ...
|
||||
|
||||
@@ -19,16 +19,16 @@ class Cursor:
|
||||
def setinputsizes(self, *args) -> None: ...
|
||||
def setoutputsizes(self, *args) -> None: ...
|
||||
def nextset(self) -> bool | None: ...
|
||||
def mogrify(self, query: str, args: object = ...) -> str: ...
|
||||
def execute(self, query: str, args: object = ...) -> int: ...
|
||||
def mogrify(self, query: str, args: object = None) -> str: ...
|
||||
def execute(self, query: str, args: object = None) -> int: ...
|
||||
def executemany(self, query: str, args: Iterable[object]) -> int | None: ...
|
||||
def callproc(self, procname: str, args: Iterable[Any] = ...) -> Any: ...
|
||||
def scroll(self, value: int, mode: str = ...) -> None: ...
|
||||
def callproc(self, procname: str, args: Iterable[Any] = ()) -> Any: ...
|
||||
def scroll(self, value: int, mode: str = "relative") -> None: ...
|
||||
def __enter__(self) -> Self: ...
|
||||
def __exit__(self, *exc_info: object) -> None: ...
|
||||
# Methods returning result tuples are below.
|
||||
def fetchone(self) -> tuple[Any, ...] | None: ...
|
||||
def fetchmany(self, size: int | None = ...) -> tuple[tuple[Any, ...], ...]: ...
|
||||
def fetchmany(self, size: int | None = None) -> tuple[tuple[Any, ...], ...]: ...
|
||||
def fetchall(self) -> tuple[tuple[Any, ...], ...]: ...
|
||||
def __iter__(self) -> Iterator[tuple[Any, ...]]: ...
|
||||
|
||||
@@ -42,7 +42,7 @@ class DictCursorMixin:
|
||||
class SSCursor(Cursor):
|
||||
def fetchall(self) -> list[tuple[Any, ...]]: ... # type: ignore[override]
|
||||
def fetchall_unbuffered(self) -> Iterator[tuple[Any, ...]]: ...
|
||||
def scroll(self, value: int, mode: str = ...) -> None: ...
|
||||
def scroll(self, value: int, mode: str = "relative") -> None: ...
|
||||
|
||||
class DictCursor(DictCursorMixin, Cursor): ... # type: ignore[misc]
|
||||
|
||||
|
||||
@@ -30,7 +30,7 @@ _Representer = TypeVar("_Representer", bound=BaseRepresenter)
|
||||
__with_libyaml__: bool
|
||||
__version__: str
|
||||
|
||||
def warnings(settings=...): ...
|
||||
def warnings(settings=None): ...
|
||||
def scan(stream, Loader: type[_Loader | _CLoader] = ...): ...
|
||||
def parse(stream, Loader: type[_Loader | _CLoader] = ...): ...
|
||||
def compose(stream, Loader: type[_Loader | _CLoader] = ...): ...
|
||||
@@ -45,45 +45,45 @@ def unsafe_load(stream: _ReadStream) -> Any: ...
|
||||
def unsafe_load_all(stream: _ReadStream) -> Iterator[Any]: ...
|
||||
def emit(
|
||||
events,
|
||||
stream: _WriteStream[Any] | None = ...,
|
||||
stream: _WriteStream[Any] | None = None,
|
||||
Dumper=...,
|
||||
canonical: bool | None = ...,
|
||||
indent: int | None = ...,
|
||||
width: int | _Inf | None = ...,
|
||||
allow_unicode: bool | None = ...,
|
||||
line_break: str | None = ...,
|
||||
canonical: bool | None = None,
|
||||
indent: int | None = None,
|
||||
width: int | _Inf | None = None,
|
||||
allow_unicode: bool | None = None,
|
||||
line_break: str | None = None,
|
||||
): ...
|
||||
@overload
|
||||
def serialize_all(
|
||||
nodes,
|
||||
stream: _WriteStream[Any],
|
||||
Dumper=...,
|
||||
canonical: bool | None = ...,
|
||||
indent: int | None = ...,
|
||||
width: int | _Inf | None = ...,
|
||||
allow_unicode: bool | None = ...,
|
||||
line_break: str | None = ...,
|
||||
encoding: str | None = ...,
|
||||
explicit_start: bool | None = ...,
|
||||
explicit_end: bool | None = ...,
|
||||
version: tuple[int, int] | None = ...,
|
||||
tags: Mapping[str, str] | None = ...,
|
||||
canonical: bool | None = None,
|
||||
indent: int | None = None,
|
||||
width: int | _Inf | None = None,
|
||||
allow_unicode: bool | None = None,
|
||||
line_break: str | None = None,
|
||||
encoding: str | None = None,
|
||||
explicit_start: bool | None = None,
|
||||
explicit_end: bool | None = None,
|
||||
version: tuple[int, int] | None = None,
|
||||
tags: Mapping[str, str] | None = None,
|
||||
) -> None: ...
|
||||
@overload
|
||||
def serialize_all(
|
||||
nodes,
|
||||
stream: None = ...,
|
||||
stream: None = None,
|
||||
Dumper=...,
|
||||
canonical: bool | None = ...,
|
||||
indent: int | None = ...,
|
||||
width: int | _Inf | None = ...,
|
||||
allow_unicode: bool | None = ...,
|
||||
line_break: str | None = ...,
|
||||
encoding: str | None = ...,
|
||||
explicit_start: bool | None = ...,
|
||||
explicit_end: bool | None = ...,
|
||||
version: tuple[int, int] | None = ...,
|
||||
tags: Mapping[str, str] | None = ...,
|
||||
canonical: bool | None = None,
|
||||
indent: int | None = None,
|
||||
width: int | _Inf | None = None,
|
||||
allow_unicode: bool | None = None,
|
||||
line_break: str | None = None,
|
||||
encoding: str | None = None,
|
||||
explicit_start: bool | None = None,
|
||||
explicit_end: bool | None = None,
|
||||
version: tuple[int, int] | None = None,
|
||||
tags: Mapping[str, str] | None = None,
|
||||
) -> _Yaml: ...
|
||||
@overload
|
||||
def serialize(
|
||||
@@ -105,7 +105,7 @@ def serialize(
|
||||
@overload
|
||||
def serialize(
|
||||
node,
|
||||
stream: None = ...,
|
||||
stream: None = None,
|
||||
Dumper=...,
|
||||
*,
|
||||
canonical: bool | None = ...,
|
||||
@@ -124,38 +124,38 @@ def dump_all(
|
||||
documents: Iterable[Any],
|
||||
stream: _WriteStream[Any],
|
||||
Dumper=...,
|
||||
default_style: str | None = ...,
|
||||
default_flow_style: bool | None = ...,
|
||||
canonical: bool | None = ...,
|
||||
indent: int | None = ...,
|
||||
width: int | _Inf | None = ...,
|
||||
allow_unicode: bool | None = ...,
|
||||
line_break: str | None = ...,
|
||||
encoding: str | None = ...,
|
||||
explicit_start: bool | None = ...,
|
||||
explicit_end: bool | None = ...,
|
||||
version: tuple[int, int] | None = ...,
|
||||
tags: Mapping[str, str] | None = ...,
|
||||
sort_keys: bool = ...,
|
||||
default_style: str | None = None,
|
||||
default_flow_style: bool | None = False,
|
||||
canonical: bool | None = None,
|
||||
indent: int | None = None,
|
||||
width: int | _Inf | None = None,
|
||||
allow_unicode: bool | None = None,
|
||||
line_break: str | None = None,
|
||||
encoding: str | None = None,
|
||||
explicit_start: bool | None = None,
|
||||
explicit_end: bool | None = None,
|
||||
version: tuple[int, int] | None = None,
|
||||
tags: Mapping[str, str] | None = None,
|
||||
sort_keys: bool = True,
|
||||
) -> None: ...
|
||||
@overload
|
||||
def dump_all(
|
||||
documents: Iterable[Any],
|
||||
stream: None = ...,
|
||||
stream: None = None,
|
||||
Dumper=...,
|
||||
default_style: str | None = ...,
|
||||
default_flow_style: bool | None = ...,
|
||||
canonical: bool | None = ...,
|
||||
indent: int | None = ...,
|
||||
width: int | _Inf | None = ...,
|
||||
allow_unicode: bool | None = ...,
|
||||
line_break: str | None = ...,
|
||||
encoding: str | None = ...,
|
||||
explicit_start: bool | None = ...,
|
||||
explicit_end: bool | None = ...,
|
||||
version: tuple[int, int] | None = ...,
|
||||
tags: Mapping[str, str] | None = ...,
|
||||
sort_keys: bool = ...,
|
||||
default_style: str | None = None,
|
||||
default_flow_style: bool | None = False,
|
||||
canonical: bool | None = None,
|
||||
indent: int | None = None,
|
||||
width: int | _Inf | None = None,
|
||||
allow_unicode: bool | None = None,
|
||||
line_break: str | None = None,
|
||||
encoding: str | None = None,
|
||||
explicit_start: bool | None = None,
|
||||
explicit_end: bool | None = None,
|
||||
version: tuple[int, int] | None = None,
|
||||
tags: Mapping[str, str] | None = None,
|
||||
sort_keys: bool = True,
|
||||
) -> _Yaml: ...
|
||||
@overload
|
||||
def dump(
|
||||
@@ -180,7 +180,7 @@ def dump(
|
||||
@overload
|
||||
def dump(
|
||||
data: Any,
|
||||
stream: None = ...,
|
||||
stream: None = None,
|
||||
Dumper=...,
|
||||
*,
|
||||
default_style: str | None = ...,
|
||||
@@ -219,7 +219,7 @@ def safe_dump_all(
|
||||
@overload
|
||||
def safe_dump_all(
|
||||
documents: Iterable[Any],
|
||||
stream: None = ...,
|
||||
stream: None = None,
|
||||
*,
|
||||
default_style: str | None = ...,
|
||||
default_flow_style: bool | None = ...,
|
||||
@@ -257,7 +257,7 @@ def safe_dump(
|
||||
@overload
|
||||
def safe_dump(
|
||||
data: Any,
|
||||
stream: None = ...,
|
||||
stream: None = None,
|
||||
*,
|
||||
default_style: str | None = ...,
|
||||
default_flow_style: bool | None = ...,
|
||||
@@ -276,26 +276,26 @@ def safe_dump(
|
||||
def add_implicit_resolver(
|
||||
tag: str,
|
||||
regexp: Pattern[str],
|
||||
first: Iterable[Any] | None = ...,
|
||||
Loader: type[BaseResolver] | None = ...,
|
||||
first: Iterable[Any] | None = None,
|
||||
Loader: type[BaseResolver] | None = None,
|
||||
Dumper: type[BaseResolver] = ...,
|
||||
) -> None: ...
|
||||
def add_path_resolver(
|
||||
tag: str,
|
||||
path: Iterable[Any],
|
||||
kind: type[Any] | None = ...,
|
||||
Loader: type[BaseResolver] | None = ...,
|
||||
kind: type[Any] | None = None,
|
||||
Loader: type[BaseResolver] | None = None,
|
||||
Dumper: type[BaseResolver] = ...,
|
||||
) -> None: ...
|
||||
@overload
|
||||
def add_constructor(
|
||||
tag: str, constructor: Callable[[Loader | FullLoader | UnsafeLoader, Node], Any], Loader: None = ...
|
||||
tag: str, constructor: Callable[[Loader | FullLoader | UnsafeLoader, Node], Any], Loader: None = None
|
||||
) -> None: ...
|
||||
@overload
|
||||
def add_constructor(tag: str, constructor: Callable[[_Constructor, Node], Any], Loader: type[_Constructor]) -> None: ...
|
||||
@overload
|
||||
def add_multi_constructor(
|
||||
tag_prefix: str, multi_constructor: Callable[[Loader | FullLoader | UnsafeLoader, str, Node], Any], Loader: None = ...
|
||||
tag_prefix: str, multi_constructor: Callable[[Loader | FullLoader | UnsafeLoader, str, Node], Any], Loader: None = None
|
||||
) -> None: ...
|
||||
@overload
|
||||
def add_multi_constructor(
|
||||
|
||||
@@ -30,11 +30,11 @@ class BaseConstructor:
|
||||
def get_data(self): ...
|
||||
def get_single_data(self) -> Any: ...
|
||||
def construct_document(self, node): ...
|
||||
def construct_object(self, node, deep=...): ...
|
||||
def construct_object(self, node, deep=False): ...
|
||||
def construct_scalar(self, node: ScalarNode) -> _Scalar: ...
|
||||
def construct_sequence(self, node: SequenceNode, deep: bool = ...) -> list[Any]: ...
|
||||
def construct_mapping(self, node: MappingNode, deep: bool = ...) -> dict[Hashable, Any]: ...
|
||||
def construct_pairs(self, node, deep=...): ...
|
||||
def construct_sequence(self, node: SequenceNode, deep: bool = False) -> list[Any]: ...
|
||||
def construct_mapping(self, node: MappingNode, deep: bool = False) -> dict[Hashable, Any]: ...
|
||||
def construct_pairs(self, node, deep=False): ...
|
||||
@classmethod
|
||||
# Use typevars so we can have covariant behaviour in the parameter types
|
||||
def add_constructor(cls, tag: str, constructor: Callable[[_L, _N], Any]) -> None: ...
|
||||
@@ -44,7 +44,7 @@ class BaseConstructor:
|
||||
class SafeConstructor(BaseConstructor):
|
||||
def construct_scalar(self, node: ScalarNode) -> _Scalar: ...
|
||||
def flatten_mapping(self, node: MappingNode) -> None: ...
|
||||
def construct_mapping(self, node: MappingNode, deep: bool = ...) -> dict[Hashable, Any]: ...
|
||||
def construct_mapping(self, node: MappingNode, deep: bool = False) -> dict[Hashable, Any]: ...
|
||||
def construct_yaml_null(self, node: ScalarNode) -> None: ...
|
||||
bool_values: ClassVar[dict[str, bool]]
|
||||
def construct_yaml_bool(self, node: ScalarNode) -> bool: ...
|
||||
@@ -73,20 +73,20 @@ class FullConstructor(SafeConstructor):
|
||||
def construct_python_long(self, node): ...
|
||||
def construct_python_complex(self, node): ...
|
||||
def construct_python_tuple(self, node): ...
|
||||
def find_python_module(self, name, mark, unsafe=...): ...
|
||||
def find_python_name(self, name, mark, unsafe=...): ...
|
||||
def find_python_module(self, name, mark, unsafe=False): ...
|
||||
def find_python_name(self, name, mark, unsafe=False): ...
|
||||
def construct_python_name(self, suffix, node): ...
|
||||
def construct_python_module(self, suffix, node): ...
|
||||
def make_python_instance(self, suffix, node, args=..., kwds=..., newobj=..., unsafe=...): ...
|
||||
def set_python_instance_state(self, instance, state, unsafe: bool = ...) -> None: ...
|
||||
def make_python_instance(self, suffix, node, args=None, kwds=None, newobj=False, unsafe=False): ...
|
||||
def set_python_instance_state(self, instance, state, unsafe: bool = False) -> None: ...
|
||||
def construct_python_object(self, suffix, node): ...
|
||||
def construct_python_object_apply(self, suffix, node, newobj=...): ...
|
||||
def construct_python_object_apply(self, suffix, node, newobj=False): ...
|
||||
def construct_python_object_new(self, suffix, node): ...
|
||||
|
||||
class UnsafeConstructor(FullConstructor):
|
||||
def find_python_module(self, name, mark): ...
|
||||
def find_python_name(self, name, mark): ...
|
||||
def make_python_instance(self, suffix, node, args=..., kwds=..., newobj=...): ...
|
||||
def make_python_instance(self, suffix, node, args=None, kwds=None, newobj=False): ...
|
||||
def set_python_instance_state(self, instance, state): ...
|
||||
|
||||
class Constructor(SafeConstructor):
|
||||
@@ -99,8 +99,8 @@ class Constructor(SafeConstructor):
|
||||
def find_python_name(self, name, mark): ...
|
||||
def construct_python_name(self, suffix, node): ...
|
||||
def construct_python_module(self, suffix, node): ...
|
||||
def make_python_instance(self, suffix, node, args=..., kwds=..., newobj=...): ...
|
||||
def make_python_instance(self, suffix, node, args=None, kwds=None, newobj=False): ...
|
||||
def set_python_instance_state(self, instance, state): ...
|
||||
def construct_python_object(self, suffix, node): ...
|
||||
def construct_python_object_apply(self, suffix, node, newobj=...): ...
|
||||
def construct_python_object_apply(self, suffix, node, newobj=False): ...
|
||||
def construct_python_object_new(self, suffix, node): ...
|
||||
|
||||
@@ -32,38 +32,38 @@ class CBaseDumper(CEmitter, BaseRepresenter, BaseResolver):
|
||||
def __init__(
|
||||
self,
|
||||
stream: IO[Any],
|
||||
default_style: str | None = ...,
|
||||
default_flow_style: bool | None = ...,
|
||||
canonical: Incomplete | None = ...,
|
||||
indent: int | None = ...,
|
||||
width: int | None = ...,
|
||||
allow_unicode: Incomplete | None = ...,
|
||||
line_break: str | None = ...,
|
||||
encoding: str | None = ...,
|
||||
explicit_start: Incomplete | None = ...,
|
||||
explicit_end: Incomplete | None = ...,
|
||||
version: Sequence[int] | None = ...,
|
||||
tags: Mapping[str, str] | None = ...,
|
||||
sort_keys: bool = ...,
|
||||
default_style: str | None = None,
|
||||
default_flow_style: bool | None = False,
|
||||
canonical: Incomplete | None = None,
|
||||
indent: int | None = None,
|
||||
width: int | None = None,
|
||||
allow_unicode: Incomplete | None = None,
|
||||
line_break: str | None = None,
|
||||
encoding: str | None = None,
|
||||
explicit_start: Incomplete | None = None,
|
||||
explicit_end: Incomplete | None = None,
|
||||
version: Sequence[int] | None = None,
|
||||
tags: Mapping[str, str] | None = None,
|
||||
sort_keys: bool = True,
|
||||
) -> None: ...
|
||||
|
||||
class CDumper(CEmitter, SafeRepresenter, Resolver):
|
||||
def __init__(
|
||||
self,
|
||||
stream: IO[Any],
|
||||
default_style: str | None = ...,
|
||||
default_flow_style: bool = ...,
|
||||
canonical: Incomplete | None = ...,
|
||||
indent: int | None = ...,
|
||||
width: int | None = ...,
|
||||
allow_unicode: Incomplete | None = ...,
|
||||
line_break: str | None = ...,
|
||||
encoding: str | None = ...,
|
||||
explicit_start: Incomplete | None = ...,
|
||||
explicit_end: Incomplete | None = ...,
|
||||
version: Sequence[int] | None = ...,
|
||||
tags: Mapping[str, str] | None = ...,
|
||||
sort_keys: bool = ...,
|
||||
default_style: str | None = None,
|
||||
default_flow_style: bool = False,
|
||||
canonical: Incomplete | None = None,
|
||||
indent: int | None = None,
|
||||
width: int | None = None,
|
||||
allow_unicode: Incomplete | None = None,
|
||||
line_break: str | None = None,
|
||||
encoding: str | None = None,
|
||||
explicit_start: Incomplete | None = None,
|
||||
explicit_end: Incomplete | None = None,
|
||||
version: Sequence[int] | None = None,
|
||||
tags: Mapping[str, str] | None = None,
|
||||
sort_keys: bool = True,
|
||||
) -> None: ...
|
||||
|
||||
CSafeDumper = CDumper
|
||||
|
||||
@@ -17,55 +17,55 @@ class BaseDumper(Emitter, Serializer, BaseRepresenter, BaseResolver):
|
||||
def __init__(
|
||||
self,
|
||||
stream: _WriteStream[Any],
|
||||
default_style: str | None = ...,
|
||||
default_flow_style: bool | None = ...,
|
||||
canonical: bool | None = ...,
|
||||
indent: int | None = ...,
|
||||
width: int | _Inf | None = ...,
|
||||
allow_unicode: bool | None = ...,
|
||||
line_break: str | None = ...,
|
||||
encoding: str | None = ...,
|
||||
explicit_start: bool | None = ...,
|
||||
explicit_end: bool | None = ...,
|
||||
version: tuple[int, int] | None = ...,
|
||||
tags: Mapping[str, str] | None = ...,
|
||||
sort_keys: bool = ...,
|
||||
default_style: str | None = None,
|
||||
default_flow_style: bool | None = False,
|
||||
canonical: bool | None = None,
|
||||
indent: int | None = None,
|
||||
width: int | _Inf | None = None,
|
||||
allow_unicode: bool | None = None,
|
||||
line_break: str | None = None,
|
||||
encoding: str | None = None,
|
||||
explicit_start: bool | None = None,
|
||||
explicit_end: bool | None = None,
|
||||
version: tuple[int, int] | None = None,
|
||||
tags: Mapping[str, str] | None = None,
|
||||
sort_keys: bool = True,
|
||||
) -> None: ...
|
||||
|
||||
class SafeDumper(Emitter, Serializer, SafeRepresenter, Resolver):
|
||||
def __init__(
|
||||
self,
|
||||
stream: _WriteStream[Any],
|
||||
default_style: str | None = ...,
|
||||
default_flow_style: bool | None = ...,
|
||||
canonical: bool | None = ...,
|
||||
indent: int | None = ...,
|
||||
width: int | _Inf | None = ...,
|
||||
allow_unicode: bool | None = ...,
|
||||
line_break: str | None = ...,
|
||||
encoding: str | None = ...,
|
||||
explicit_start: bool | None = ...,
|
||||
explicit_end: bool | None = ...,
|
||||
version: tuple[int, int] | None = ...,
|
||||
tags: Mapping[str, str] | None = ...,
|
||||
sort_keys: bool = ...,
|
||||
default_style: str | None = None,
|
||||
default_flow_style: bool | None = False,
|
||||
canonical: bool | None = None,
|
||||
indent: int | None = None,
|
||||
width: int | _Inf | None = None,
|
||||
allow_unicode: bool | None = None,
|
||||
line_break: str | None = None,
|
||||
encoding: str | None = None,
|
||||
explicit_start: bool | None = None,
|
||||
explicit_end: bool | None = None,
|
||||
version: tuple[int, int] | None = None,
|
||||
tags: Mapping[str, str] | None = None,
|
||||
sort_keys: bool = True,
|
||||
) -> None: ...
|
||||
|
||||
class Dumper(Emitter, Serializer, Representer, Resolver):
|
||||
def __init__(
|
||||
self,
|
||||
stream: _WriteStream[Any],
|
||||
default_style: str | None = ...,
|
||||
default_flow_style: bool | None = ...,
|
||||
canonical: bool | None = ...,
|
||||
indent: int | None = ...,
|
||||
width: int | _Inf | None = ...,
|
||||
allow_unicode: bool | None = ...,
|
||||
line_break: str | None = ...,
|
||||
encoding: str | None = ...,
|
||||
explicit_start: bool | None = ...,
|
||||
explicit_end: bool | None = ...,
|
||||
version: tuple[int, int] | None = ...,
|
||||
tags: Mapping[str, str] | None = ...,
|
||||
sort_keys: bool = ...,
|
||||
default_style: str | None = None,
|
||||
default_flow_style: bool | None = False,
|
||||
canonical: bool | None = None,
|
||||
indent: int | None = None,
|
||||
width: int | _Inf | None = None,
|
||||
allow_unicode: bool | None = None,
|
||||
line_break: str | None = None,
|
||||
encoding: str | None = None,
|
||||
explicit_start: bool | None = None,
|
||||
explicit_end: bool | None = None,
|
||||
version: tuple[int, int] | None = None,
|
||||
tags: Mapping[str, str] | None = None,
|
||||
sort_keys: bool = True,
|
||||
) -> None: ...
|
||||
|
||||
@@ -56,20 +56,20 @@ class Emitter:
|
||||
analysis: Any
|
||||
style: Any
|
||||
def __init__(
|
||||
self, stream: _WriteStream[Any], canonical=..., indent=..., width=..., allow_unicode=..., line_break=...
|
||||
self, stream: _WriteStream[Any], canonical=None, indent=None, width=None, allow_unicode=None, line_break=None
|
||||
) -> None: ...
|
||||
def dispose(self): ...
|
||||
def emit(self, event): ...
|
||||
def need_more_events(self): ...
|
||||
def need_events(self, count): ...
|
||||
def increase_indent(self, flow=..., indentless=...): ...
|
||||
def increase_indent(self, flow=False, indentless=False): ...
|
||||
def expect_stream_start(self): ...
|
||||
def expect_nothing(self): ...
|
||||
def expect_first_document_start(self): ...
|
||||
def expect_document_start(self, first=...): ...
|
||||
def expect_document_start(self, first=False): ...
|
||||
def expect_document_end(self): ...
|
||||
def expect_document_root(self): ...
|
||||
def expect_node(self, root=..., sequence=..., mapping=..., simple_key=...): ...
|
||||
def expect_node(self, root=False, sequence=False, mapping=False, simple_key=False): ...
|
||||
def expect_alias(self): ...
|
||||
def expect_scalar(self): ...
|
||||
def expect_flow_sequence(self): ...
|
||||
@@ -82,10 +82,10 @@ class Emitter:
|
||||
def expect_flow_mapping_value(self): ...
|
||||
def expect_block_sequence(self): ...
|
||||
def expect_first_block_sequence_item(self): ...
|
||||
def expect_block_sequence_item(self, first=...): ...
|
||||
def expect_block_sequence_item(self, first=False): ...
|
||||
def expect_block_mapping(self): ...
|
||||
def expect_first_block_mapping_key(self): ...
|
||||
def expect_block_mapping_key(self, first=...): ...
|
||||
def expect_block_mapping_key(self, first=False): ...
|
||||
def expect_block_mapping_simple_value(self): ...
|
||||
def expect_block_mapping_value(self): ...
|
||||
def check_empty_sequence(self): ...
|
||||
@@ -105,15 +105,15 @@ class Emitter:
|
||||
def flush_stream(self): ...
|
||||
def write_stream_start(self): ...
|
||||
def write_stream_end(self): ...
|
||||
def write_indicator(self, indicator, need_whitespace, whitespace=..., indention=...): ...
|
||||
def write_indicator(self, indicator, need_whitespace, whitespace=False, indention=False): ...
|
||||
def write_indent(self): ...
|
||||
def write_line_break(self, data=...): ...
|
||||
def write_line_break(self, data=None): ...
|
||||
def write_version_directive(self, version_text): ...
|
||||
def write_tag_directive(self, handle_text, prefix_text): ...
|
||||
def write_single_quoted(self, text, split=...): ...
|
||||
def write_single_quoted(self, text, split=True): ...
|
||||
ESCAPE_REPLACEMENTS: Any
|
||||
def write_double_quoted(self, text, split=...): ...
|
||||
def write_double_quoted(self, text, split=True): ...
|
||||
def determine_block_hints(self, text): ...
|
||||
def write_folded(self, text): ...
|
||||
def write_literal(self, text): ...
|
||||
def write_plain(self, text, split=...): ...
|
||||
def write_plain(self, text, split=True): ...
|
||||
|
||||
@@ -6,7 +6,7 @@ class Mark:
|
||||
buffer: str | None
|
||||
pointer: int
|
||||
def __init__(self, name: str, index: int, line: int, column: int, buffer: str | None, pointer: int) -> None: ...
|
||||
def get_snippet(self, indent: int = ..., max_length: int = ...) -> str | None: ...
|
||||
def get_snippet(self, indent: int = 4, max_length: int = 75) -> str | None: ...
|
||||
|
||||
class YAMLError(Exception): ...
|
||||
|
||||
@@ -18,9 +18,9 @@ class MarkedYAMLError(YAMLError):
|
||||
note: str | None
|
||||
def __init__(
|
||||
self,
|
||||
context: str | None = ...,
|
||||
context_mark: Mark | None = ...,
|
||||
problem: str | None = ...,
|
||||
problem_mark: Mark | None = ...,
|
||||
note: str | None = ...,
|
||||
context: str | None = None,
|
||||
context_mark: Mark | None = None,
|
||||
problem: str | None = None,
|
||||
problem_mark: Mark | None = None,
|
||||
note: str | None = None,
|
||||
) -> None: ...
|
||||
|
||||
@@ -3,13 +3,13 @@ from typing import Any
|
||||
class Event:
|
||||
start_mark: Any
|
||||
end_mark: Any
|
||||
def __init__(self, start_mark=..., end_mark=...) -> None: ...
|
||||
def __init__(self, start_mark=None, end_mark=None) -> None: ...
|
||||
|
||||
class NodeEvent(Event):
|
||||
anchor: Any
|
||||
start_mark: Any
|
||||
end_mark: Any
|
||||
def __init__(self, anchor, start_mark=..., end_mark=...) -> None: ...
|
||||
def __init__(self, anchor, start_mark=None, end_mark=None) -> None: ...
|
||||
|
||||
class CollectionStartEvent(NodeEvent):
|
||||
anchor: Any
|
||||
@@ -18,7 +18,7 @@ class CollectionStartEvent(NodeEvent):
|
||||
start_mark: Any
|
||||
end_mark: Any
|
||||
flow_style: Any
|
||||
def __init__(self, anchor, tag, implicit, start_mark=..., end_mark=..., flow_style=...) -> None: ...
|
||||
def __init__(self, anchor, tag, implicit, start_mark=None, end_mark=None, flow_style=None) -> None: ...
|
||||
|
||||
class CollectionEndEvent(Event): ...
|
||||
|
||||
@@ -26,7 +26,7 @@ class StreamStartEvent(Event):
|
||||
start_mark: Any
|
||||
end_mark: Any
|
||||
encoding: Any
|
||||
def __init__(self, start_mark=..., end_mark=..., encoding=...) -> None: ...
|
||||
def __init__(self, start_mark=None, end_mark=None, encoding=None) -> None: ...
|
||||
|
||||
class StreamEndEvent(Event): ...
|
||||
|
||||
@@ -36,13 +36,13 @@ class DocumentStartEvent(Event):
|
||||
explicit: Any
|
||||
version: Any
|
||||
tags: Any
|
||||
def __init__(self, start_mark=..., end_mark=..., explicit=..., version=..., tags=...) -> None: ...
|
||||
def __init__(self, start_mark=None, end_mark=None, explicit=None, version=None, tags=None) -> None: ...
|
||||
|
||||
class DocumentEndEvent(Event):
|
||||
start_mark: Any
|
||||
end_mark: Any
|
||||
explicit: Any
|
||||
def __init__(self, start_mark=..., end_mark=..., explicit=...) -> None: ...
|
||||
def __init__(self, start_mark=None, end_mark=None, explicit=None) -> None: ...
|
||||
|
||||
class AliasEvent(NodeEvent): ...
|
||||
|
||||
@@ -54,7 +54,7 @@ class ScalarEvent(NodeEvent):
|
||||
start_mark: Any
|
||||
end_mark: Any
|
||||
style: Any
|
||||
def __init__(self, anchor, tag, implicit, value, start_mark=..., end_mark=..., style=...) -> None: ...
|
||||
def __init__(self, anchor, tag, implicit, value, start_mark=None, end_mark=None, style=None) -> None: ...
|
||||
|
||||
class SequenceStartEvent(CollectionStartEvent): ...
|
||||
class SequenceEndEvent(CollectionEndEvent): ...
|
||||
|
||||
@@ -16,13 +16,13 @@ class ScalarNode(Node):
|
||||
id: ClassVar[str]
|
||||
style: str | Any
|
||||
def __init__(
|
||||
self, tag: str, value, start_mark: Mark | None = ..., end_mark: Mark | None = ..., style: str | None = ...
|
||||
self, tag: str, value, start_mark: Mark | None = None, end_mark: Mark | None = None, style: str | None = None
|
||||
) -> None: ...
|
||||
|
||||
class CollectionNode(Node):
|
||||
flow_style: bool | Any
|
||||
def __init__(
|
||||
self, tag: str, value, start_mark: Mark | None = ..., end_mark: Mark | None = ..., flow_style: bool | None = ...
|
||||
self, tag: str, value, start_mark: Mark | None = None, end_mark: Mark | None = None, flow_style: bool | None = None
|
||||
) -> None: ...
|
||||
|
||||
class SequenceNode(CollectionNode):
|
||||
|
||||
@@ -26,7 +26,7 @@ class Parser:
|
||||
def parse_block_node(self): ...
|
||||
def parse_flow_node(self): ...
|
||||
def parse_block_node_or_indentless_sequence(self): ...
|
||||
def parse_node(self, block=..., indentless_sequence=...): ...
|
||||
def parse_node(self, block=False, indentless_sequence=False): ...
|
||||
def parse_block_sequence_first_entry(self): ...
|
||||
def parse_block_sequence_entry(self): ...
|
||||
def parse_indentless_sequence_entry(self): ...
|
||||
@@ -34,12 +34,12 @@ class Parser:
|
||||
def parse_block_mapping_key(self): ...
|
||||
def parse_block_mapping_value(self): ...
|
||||
def parse_flow_sequence_first_entry(self): ...
|
||||
def parse_flow_sequence_entry(self, first=...): ...
|
||||
def parse_flow_sequence_entry(self, first=False): ...
|
||||
def parse_flow_sequence_entry_mapping_key(self): ...
|
||||
def parse_flow_sequence_entry_mapping_value(self): ...
|
||||
def parse_flow_sequence_entry_mapping_end(self): ...
|
||||
def parse_flow_mapping_first_key(self): ...
|
||||
def parse_flow_mapping_key(self, first=...): ...
|
||||
def parse_flow_mapping_key(self, first=False): ...
|
||||
def parse_flow_mapping_value(self): ...
|
||||
def parse_flow_mapping_empty_value(self): ...
|
||||
def process_empty_scalar(self, mark): ...
|
||||
|
||||
@@ -28,12 +28,12 @@ class Reader:
|
||||
line: Any
|
||||
column: Any
|
||||
def __init__(self, stream: _ReadStream) -> None: ...
|
||||
def peek(self, index=...): ...
|
||||
def prefix(self, length=...): ...
|
||||
def forward(self, length=...): ...
|
||||
def peek(self, index=0): ...
|
||||
def prefix(self, length=1): ...
|
||||
def forward(self, length=1): ...
|
||||
def get_mark(self): ...
|
||||
def determine_encoding(self): ...
|
||||
NON_PRINTABLE: Any
|
||||
def check_printable(self, data): ...
|
||||
def update(self, length): ...
|
||||
def update_raw(self, size=...): ...
|
||||
def update_raw(self, size=4096): ...
|
||||
|
||||
@@ -21,17 +21,17 @@ class BaseRepresenter:
|
||||
represented_objects: dict[int, Node]
|
||||
object_keeper: list[Any]
|
||||
alias_key: int | Incomplete
|
||||
def __init__(self, default_style: str | None = ..., default_flow_style: bool = ..., sort_keys: bool = ...) -> None: ...
|
||||
def __init__(self, default_style: str | None = None, default_flow_style: bool = False, sort_keys: bool = True) -> None: ...
|
||||
def represent(self, data) -> None: ...
|
||||
def represent_data(self, data) -> Node: ...
|
||||
@classmethod
|
||||
def add_representer(cls: type[_R], data_type: type[_T], representer: Callable[[_R, _T], Node]) -> None: ...
|
||||
@classmethod
|
||||
def add_multi_representer(cls: type[_R], data_type: type[_T], representer: Callable[[_R, _T], Node]) -> None: ...
|
||||
def represent_scalar(self, tag: str, value, style: str | None = ...) -> ScalarNode: ...
|
||||
def represent_sequence(self, tag: str, sequence: Iterable[Any], flow_style: bool | None = ...) -> SequenceNode: ...
|
||||
def represent_scalar(self, tag: str, value, style: str | None = None) -> ScalarNode: ...
|
||||
def represent_sequence(self, tag: str, sequence: Iterable[Any], flow_style: bool | None = None) -> SequenceNode: ...
|
||||
def represent_mapping(
|
||||
self, tag: str, mapping: SupportsItems[Any, Any] | Iterable[tuple[Any, Any]], flow_style: bool | None = ...
|
||||
self, tag: str, mapping: SupportsItems[Any, Any] | Iterable[tuple[Any, Any]], flow_style: bool | None = None
|
||||
) -> MappingNode: ...
|
||||
def ignore_aliases(self, data) -> bool: ...
|
||||
|
||||
@@ -49,7 +49,7 @@ class SafeRepresenter(BaseRepresenter):
|
||||
def represent_set(self, data: Iterable[Any]) -> MappingNode: ...
|
||||
def represent_date(self, data: datetime.date) -> ScalarNode: ...
|
||||
def represent_datetime(self, data: datetime.datetime) -> ScalarNode: ...
|
||||
def represent_yaml_object(self, tag: str, data, cls, flow_style: bool | None = ...) -> MappingNode: ...
|
||||
def represent_yaml_object(self, tag: str, data, cls, flow_style: bool | None = None) -> MappingNode: ...
|
||||
def represent_undefined(self, data) -> NoReturn: ...
|
||||
|
||||
class Representer(SafeRepresenter):
|
||||
|
||||
@@ -16,7 +16,7 @@ class BaseResolver:
|
||||
@classmethod
|
||||
def add_implicit_resolver(cls, tag, regexp, first): ...
|
||||
@classmethod
|
||||
def add_path_resolver(cls, tag, path, kind=...): ...
|
||||
def add_path_resolver(cls, tag, path, kind=None): ...
|
||||
def descend_resolver(self, current_node, current_index): ...
|
||||
def ascend_resolver(self): ...
|
||||
def check_resolver_prefix(self, depth, path, kind, current_node, current_index): ...
|
||||
|
||||
@@ -16,7 +16,7 @@ class Serializer:
|
||||
anchors: Any
|
||||
last_anchor_id: Any
|
||||
closed: Any
|
||||
def __init__(self, encoding=..., explicit_start=..., explicit_end=..., version=..., tags=...) -> None: ...
|
||||
def __init__(self, encoding=None, explicit_start=None, explicit_end=None, version=None, tags=None) -> None: ...
|
||||
def open(self) -> None: ...
|
||||
def close(self) -> None: ...
|
||||
def serialize(self, node: Node) -> None: ...
|
||||
|
||||
@@ -24,7 +24,7 @@ class StreamStartToken(Token):
|
||||
start_mark: Any
|
||||
end_mark: Any
|
||||
encoding: Any
|
||||
def __init__(self, start_mark=..., end_mark=..., encoding=...) -> None: ...
|
||||
def __init__(self, start_mark=None, end_mark=None, encoding=None) -> None: ...
|
||||
|
||||
class StreamEndToken(Token):
|
||||
id: Any
|
||||
@@ -90,4 +90,4 @@ class ScalarToken(Token):
|
||||
start_mark: Any
|
||||
end_mark: Any
|
||||
style: Any
|
||||
def __init__(self, value, plain, start_mark, end_mark, style=...) -> None: ...
|
||||
def __init__(self, value, plain, start_mark, end_mark, style=None) -> None: ...
|
||||
|
||||
@@ -12,8 +12,8 @@ def lex(code, lexer): ...
|
||||
@overload
|
||||
def format(tokens, formatter: Formatter[_T], outfile: SupportsWrite[_T]) -> None: ...
|
||||
@overload
|
||||
def format(tokens, formatter: Formatter[_T], outfile: None = ...) -> _T: ...
|
||||
def format(tokens, formatter: Formatter[_T], outfile: None = None) -> _T: ...
|
||||
@overload
|
||||
def highlight(code, lexer, formatter: Formatter[_T], outfile: SupportsWrite[_T]) -> None: ...
|
||||
@overload
|
||||
def highlight(code, lexer, formatter: Formatter[_T], outfile: None = ...) -> _T: ...
|
||||
def highlight(code, lexer, formatter: Formatter[_T], outfile: None = None) -> _T: ...
|
||||
|
||||
@@ -4,8 +4,6 @@ from _typeshed import Incomplete
|
||||
def main_inner(parser, argns): ...
|
||||
|
||||
class HelpFormatter(argparse.HelpFormatter):
|
||||
def __init__(
|
||||
self, prog, indent_increment: int = ..., max_help_position: int = ..., width: Incomplete | None = ...
|
||||
) -> None: ...
|
||||
def __init__(self, prog, indent_increment: int = 2, max_help_position: int = 16, width: Incomplete | None = None) -> None: ...
|
||||
|
||||
def main(args=...): ...
|
||||
|
||||
@@ -5,7 +5,7 @@ from typing import Any
|
||||
from pygments.lexer import Lexer
|
||||
from pygments.token import _TokenType
|
||||
|
||||
def apply_filters(stream, filters, lexer: Incomplete | None = ...): ...
|
||||
def apply_filters(stream, filters, lexer: Incomplete | None = None): ...
|
||||
def simplefilter(f): ...
|
||||
|
||||
class Filter:
|
||||
|
||||
@@ -13,10 +13,10 @@ class Formatter(Generic[_T]):
|
||||
encoding: Any
|
||||
options: Any
|
||||
@overload
|
||||
def __init__(self: Formatter[str], *, encoding: None = ..., outencoding: None = ..., **options) -> None: ...
|
||||
def __init__(self: Formatter[str], *, encoding: None = None, outencoding: None = None, **options) -> None: ...
|
||||
@overload
|
||||
def __init__(self: Formatter[bytes], *, encoding: str, outencoding: None = ..., **options) -> None: ...
|
||||
def __init__(self: Formatter[bytes], *, encoding: str, outencoding: None = None, **options) -> None: ...
|
||||
@overload
|
||||
def __init__(self: Formatter[bytes], *, encoding: None = ..., outencoding: str, **options) -> None: ...
|
||||
def get_style_defs(self, arg: str = ...): ...
|
||||
def __init__(self: Formatter[bytes], *, encoding: None = None, outencoding: str, **options) -> None: ...
|
||||
def get_style_defs(self, arg: str = ""): ...
|
||||
def format(self, tokensource, outfile): ...
|
||||
|
||||
@@ -21,5 +21,5 @@ from .terminal256 import Terminal256Formatter as Terminal256Formatter, TerminalT
|
||||
|
||||
def get_all_formatters() -> Generator[type[Formatter[Any]], None, None]: ...
|
||||
def get_formatter_by_name(_alias, **options): ...
|
||||
def load_formatter_from_file(filename, formattername: str = ..., **options): ...
|
||||
def load_formatter_from_file(filename, formattername: str = "CustomFormatter", **options): ...
|
||||
def get_formatter_for_filename(fn, **options): ...
|
||||
|
||||
@@ -33,9 +33,9 @@ class HtmlFormatter(Formatter[_T]):
|
||||
linespans: Any
|
||||
anchorlinenos: Any
|
||||
hl_lines: Any
|
||||
def get_style_defs(self, arg: Incomplete | None = ...): ...
|
||||
def get_token_style_defs(self, arg: Incomplete | None = ...): ...
|
||||
def get_background_style_defs(self, arg: Incomplete | None = ...): ...
|
||||
def get_style_defs(self, arg: Incomplete | None = None): ...
|
||||
def get_token_style_defs(self, arg: Incomplete | None = None): ...
|
||||
def get_background_style_defs(self, arg: Incomplete | None = None): ...
|
||||
def get_linenos_style_defs(self): ...
|
||||
def get_css_prefix(self, arg): ...
|
||||
def wrap(self, source): ...
|
||||
|
||||
@@ -12,7 +12,7 @@ class FontManager:
|
||||
font_size: Any
|
||||
fonts: Any
|
||||
encoding: Any
|
||||
def __init__(self, font_name, font_size: int = ...) -> None: ...
|
||||
def __init__(self, font_name, font_size: int = 14) -> None: ...
|
||||
def get_char_size(self): ...
|
||||
def get_text_size(self, text): ...
|
||||
def get_font(self, bold, oblique): ...
|
||||
@@ -44,7 +44,7 @@ class ImageFormatter(Formatter[_T]):
|
||||
hl_lines: Any
|
||||
hl_color: Any
|
||||
drawables: Any
|
||||
def get_style_defs(self, arg: str = ...) -> None: ...
|
||||
def get_style_defs(self, arg: str = "") -> None: ...
|
||||
def format(self, tokensource, outfile) -> None: ...
|
||||
|
||||
class GifImageFormatter(ImageFormatter[_T]):
|
||||
|
||||
@@ -23,7 +23,7 @@ class LatexFormatter(Formatter[_T]):
|
||||
left: Any
|
||||
right: Any
|
||||
envname: Any
|
||||
def get_style_defs(self, arg: str = ...): ...
|
||||
def get_style_defs(self, arg: str = ""): ...
|
||||
def format_unencoded(self, tokensource, outfile) -> None: ...
|
||||
|
||||
class LatexEmbeddedLexer(Lexer):
|
||||
|
||||
@@ -13,11 +13,11 @@ class EscapeSequence:
|
||||
italic: Any
|
||||
def __init__(
|
||||
self,
|
||||
fg: Incomplete | None = ...,
|
||||
bg: Incomplete | None = ...,
|
||||
bold: bool = ...,
|
||||
underline: bool = ...,
|
||||
italic: bool = ...,
|
||||
fg: Incomplete | None = None,
|
||||
bg: Incomplete | None = None,
|
||||
bold: bool = False,
|
||||
underline: bool = False,
|
||||
italic: bool = False,
|
||||
) -> None: ...
|
||||
def escape(self, attrs): ...
|
||||
def color_string(self): ...
|
||||
|
||||
@@ -26,7 +26,7 @@ class Lexer(metaclass=LexerMeta):
|
||||
filters: Any
|
||||
def __init__(self, **options) -> None: ...
|
||||
def add_filter(self, filter_, **options) -> None: ...
|
||||
def get_tokens(self, text: str, unfiltered: bool = ...) -> Iterator[tuple[_TokenType, str]]: ...
|
||||
def get_tokens(self, text: str, unfiltered: bool = False) -> Iterator[tuple[_TokenType, str]]: ...
|
||||
def get_tokens_unprocessed(self, text: str) -> Iterator[tuple[int, _TokenType, str]]: ...
|
||||
|
||||
class DelegatingLexer(Lexer):
|
||||
@@ -47,9 +47,9 @@ class combined(tuple[Any, ...]):
|
||||
|
||||
class _PseudoMatch:
|
||||
def __init__(self, start, text) -> None: ...
|
||||
def start(self, arg: Incomplete | None = ...): ...
|
||||
def end(self, arg: Incomplete | None = ...): ...
|
||||
def group(self, arg: Incomplete | None = ...): ...
|
||||
def start(self, arg: Incomplete | None = None): ...
|
||||
def end(self, arg: Incomplete | None = None): ...
|
||||
def group(self, arg: Incomplete | None = None): ...
|
||||
def groups(self): ...
|
||||
def groupdict(self): ...
|
||||
|
||||
@@ -69,32 +69,32 @@ class words(Future):
|
||||
words: Any
|
||||
prefix: Any
|
||||
suffix: Any
|
||||
def __init__(self, words, prefix: str = ..., suffix: str = ...) -> None: ...
|
||||
def __init__(self, words, prefix: str = "", suffix: str = "") -> None: ...
|
||||
def get(self): ...
|
||||
|
||||
class RegexLexerMeta(LexerMeta):
|
||||
def process_tokendef(cls, name, tokendefs: Incomplete | None = ...): ...
|
||||
def process_tokendef(cls, name, tokendefs: Incomplete | None = None): ...
|
||||
def get_tokendefs(cls): ...
|
||||
def __call__(cls, *args, **kwds): ...
|
||||
|
||||
class RegexLexer(Lexer, metaclass=RegexLexerMeta):
|
||||
flags: Any
|
||||
tokens: Any
|
||||
def get_tokens_unprocessed(self, text: str, stack: Iterable[str] = ...) -> Iterator[tuple[int, _TokenType, str]]: ...
|
||||
def get_tokens_unprocessed(self, text: str, stack: Iterable[str] = ("root",)) -> Iterator[tuple[int, _TokenType, str]]: ...
|
||||
|
||||
class LexerContext:
|
||||
text: Any
|
||||
pos: Any
|
||||
end: Any
|
||||
stack: Any
|
||||
def __init__(self, text, pos, stack: Incomplete | None = ..., end: Incomplete | None = ...) -> None: ...
|
||||
def __init__(self, text, pos, stack: Incomplete | None = None, end: Incomplete | None = None) -> None: ...
|
||||
|
||||
class ExtendedRegexLexer(RegexLexer):
|
||||
def get_tokens_unprocessed( # type: ignore[override]
|
||||
self, text: str | None = ..., context: LexerContext | None = ...
|
||||
self, text: str | None = None, context: LexerContext | None = None
|
||||
) -> Iterator[tuple[int, _TokenType, str]]: ...
|
||||
|
||||
class ProfilingRegexLexerMeta(RegexLexerMeta): ...
|
||||
|
||||
class ProfilingRegexLexer(RegexLexer, metaclass=ProfilingRegexLexerMeta):
|
||||
def get_tokens_unprocessed(self, text: str, stack: Iterable[str] = ...) -> Iterator[tuple[int, _TokenType, str]]: ...
|
||||
def get_tokens_unprocessed(self, text: str, stack: Iterable[str] = ("root",)) -> Iterator[tuple[int, _TokenType, str]]: ...
|
||||
|
||||
@@ -4,13 +4,13 @@ from typing import Any
|
||||
|
||||
from pygments.lexer import Lexer, LexerMeta
|
||||
|
||||
def get_all_lexers(plugins: bool = ...) -> Iterator[tuple[str, tuple[str, ...], tuple[str, ...], tuple[str, ...]]]: ...
|
||||
def get_all_lexers(plugins: bool = True) -> Iterator[tuple[str, tuple[str, ...], tuple[str, ...], tuple[str, ...]]]: ...
|
||||
def find_lexer_class(name: str) -> LexerMeta | None: ...
|
||||
def find_lexer_class_by_name(_alias: str) -> LexerMeta: ...
|
||||
def get_lexer_by_name(_alias: str, **options: Any) -> Lexer: ...
|
||||
def load_lexer_from_file(filename: FileDescriptorOrPath, lexername: str = ..., **options: Any) -> Lexer: ...
|
||||
def find_lexer_class_for_filename(_fn: StrPath, code: str | bytes | None = ...) -> LexerMeta | None: ...
|
||||
def get_lexer_for_filename(_fn: StrPath, code: str | bytes | None = ..., **options: Any) -> Lexer: ...
|
||||
def load_lexer_from_file(filename: FileDescriptorOrPath, lexername: str = "CustomLexer", **options: Any) -> Lexer: ...
|
||||
def find_lexer_class_for_filename(_fn: StrPath, code: str | bytes | None = None) -> LexerMeta | None: ...
|
||||
def get_lexer_for_filename(_fn: StrPath, code: str | bytes | None = None, **options: Any) -> Lexer: ...
|
||||
def get_lexer_for_mimetype(_mime: str, **options: Any) -> Lexer: ...
|
||||
def guess_lexer_for_filename(_fn: StrPath, _text: str, **options: Any) -> LexerMeta: ...
|
||||
def guess_lexer(_text: str | bytes, **options: Any) -> Lexer: ...
|
||||
|
||||
@@ -1 +1 @@
|
||||
def get_filetype_from_buffer(buf, max_lines: int = ...): ...
|
||||
def get_filetype_from_buffer(buf, max_lines: int = 5): ...
|
||||
|
||||
@@ -5,4 +5,4 @@ FIRST_ELEMENT: Any
|
||||
|
||||
def make_charset(letters): ...
|
||||
def regex_opt_inner(strings, open_paren): ...
|
||||
def regex_opt(strings, prefix: str = ..., suffix: str = ...): ...
|
||||
def regex_opt(strings, prefix: str = "", suffix: str = ""): ...
|
||||
|
||||
@@ -10,7 +10,7 @@ class Scanner:
|
||||
flags: Any
|
||||
last: Any
|
||||
match: Any
|
||||
def __init__(self, text, flags: int = ...) -> None: ...
|
||||
def __init__(self, text, flags: int = 0) -> None: ...
|
||||
@property
|
||||
def eos(self): ...
|
||||
def check(self, pattern): ...
|
||||
|
||||
@@ -10,10 +10,10 @@ xml_decl_re: Any
|
||||
class ClassNotFound(ValueError): ...
|
||||
class OptionError(Exception): ...
|
||||
|
||||
def get_choice_opt(options, optname, allowed, default: Incomplete | None = ..., normcase: bool = ...): ...
|
||||
def get_bool_opt(options, optname, default: Incomplete | None = ...): ...
|
||||
def get_int_opt(options, optname, default: Incomplete | None = ...): ...
|
||||
def get_list_opt(options, optname, default: Incomplete | None = ...): ...
|
||||
def get_choice_opt(options, optname, allowed, default: Incomplete | None = None, normcase: bool = False): ...
|
||||
def get_bool_opt(options, optname, default: Incomplete | None = None): ...
|
||||
def get_int_opt(options, optname, default: Incomplete | None = None): ...
|
||||
def get_list_opt(options, optname, default: Incomplete | None = None): ...
|
||||
def docstring_headline(obj): ...
|
||||
def make_analysator(f): ...
|
||||
def shebang_matches(text, regex): ...
|
||||
@@ -21,8 +21,8 @@ def doctype_matches(text, regex): ...
|
||||
def html_doctype_matches(text): ...
|
||||
def looks_like_xml(text): ...
|
||||
def surrogatepair(c): ...
|
||||
def format_lines(var_name, seq, raw: bool = ..., indent_level: int = ...): ...
|
||||
def duplicates_removed(it, already_seen=...): ...
|
||||
def format_lines(var_name, seq, raw: bool = False, indent_level: int = 0): ...
|
||||
def duplicates_removed(it, already_seen=()): ...
|
||||
|
||||
class Future:
|
||||
def get(self) -> None: ...
|
||||
|
||||
@@ -112,7 +112,7 @@ class WebsocketConnectionError(ValueError): ...
|
||||
|
||||
def error_string(mqtt_errno: int) -> str: ...
|
||||
def connack_string(connack_code: int) -> str: ...
|
||||
def base62(num: int, base: str = ..., padding: int = ...) -> str: ...
|
||||
def base62(num: int, base: str = ..., padding: int = 1) -> str: ...
|
||||
def topic_matches_sub(sub: str, topic: str) -> bool: ...
|
||||
|
||||
class MQTTMessageInfo:
|
||||
@@ -123,7 +123,7 @@ class MQTTMessageInfo:
|
||||
def __next__(self) -> int: ...
|
||||
def next(self) -> int: ...
|
||||
def __getitem__(self, index: int) -> int: ...
|
||||
def wait_for_publish(self, timeout: float | None = ...) -> None: ...
|
||||
def wait_for_publish(self, timeout: float | None = None) -> None: ...
|
||||
def is_published(self) -> bool: ...
|
||||
|
||||
class MQTTMessage:
|
||||
@@ -136,7 +136,7 @@ class MQTTMessage:
|
||||
retain: bool
|
||||
info: MQTTMessageInfo
|
||||
properties: Properties | None
|
||||
def __init__(self, mid: int = ..., topic: bytes | bytearray = ...) -> None: ...
|
||||
def __init__(self, mid: int = 0, topic: bytes | bytearray = b"") -> None: ...
|
||||
def __eq__(self, other: object) -> bool: ...
|
||||
def __ne__(self, other: object) -> bool: ...
|
||||
@property
|
||||
@@ -148,79 +148,84 @@ class Client:
|
||||
suppress_exceptions: bool
|
||||
def __init__(
|
||||
self,
|
||||
client_id: str | None = ...,
|
||||
clean_session: bool | None = ...,
|
||||
userdata: _UserData | None = ...,
|
||||
protocol: int = ...,
|
||||
transport: str = ...,
|
||||
reconnect_on_failure: bool = ...,
|
||||
client_id: str | None = "",
|
||||
clean_session: bool | None = None,
|
||||
userdata: _UserData | None = None,
|
||||
protocol: int = 4,
|
||||
transport: str = "tcp",
|
||||
reconnect_on_failure: bool = True,
|
||||
) -> None: ...
|
||||
def __del__(self) -> None: ...
|
||||
def reinitialise(self, client_id: str = ..., clean_session: bool = ..., userdata: _UserData | None = ...) -> None: ...
|
||||
def ws_set_options(self, path: str = ..., headers: _ExtraHeader | None = ...) -> None: ...
|
||||
def tls_set_context(self, context: _ssl.SSLContext | None = ...) -> None: ...
|
||||
def reinitialise(self, client_id: str = "", clean_session: bool = True, userdata: _UserData | None = None) -> None: ...
|
||||
def ws_set_options(self, path: str = "/mqtt", headers: _ExtraHeader | None = None) -> None: ...
|
||||
def tls_set_context(self, context: _ssl.SSLContext | None = None) -> None: ...
|
||||
def tls_set(
|
||||
self,
|
||||
ca_certs: str | None = ...,
|
||||
certfile: str | None = ...,
|
||||
keyfile: str | None = ...,
|
||||
cert_reqs: _ssl.VerifyMode | None = ...,
|
||||
tls_version: _ssl._SSLMethod | None = ...,
|
||||
ciphers: str | None = ...,
|
||||
keyfile_password: _ssl._PasswordType | None = ...,
|
||||
ca_certs: str | None = None,
|
||||
certfile: str | None = None,
|
||||
keyfile: str | None = None,
|
||||
cert_reqs: _ssl.VerifyMode | None = None,
|
||||
tls_version: _ssl._SSLMethod | None = None,
|
||||
ciphers: str | None = None,
|
||||
keyfile_password: _ssl._PasswordType | None = None,
|
||||
) -> None: ...
|
||||
def tls_insecure_set(self, value: bool) -> None: ...
|
||||
def proxy_set(self, **proxy_args: Any) -> None: ...
|
||||
def enable_logger(self, logger: logging.Logger | None = ...) -> None: ...
|
||||
def enable_logger(self, logger: logging.Logger | None = None) -> None: ...
|
||||
def disable_logger(self) -> None: ...
|
||||
def connect(
|
||||
self,
|
||||
host: str,
|
||||
port: int = ...,
|
||||
keepalive: int = ...,
|
||||
bind_address: str = ...,
|
||||
bind_port: int = ...,
|
||||
clean_start: int = ...,
|
||||
properties: Properties | None = ...,
|
||||
port: int = 1883,
|
||||
keepalive: int = 60,
|
||||
bind_address: str = "",
|
||||
bind_port: int = 0,
|
||||
clean_start: int = 3,
|
||||
properties: Properties | None = None,
|
||||
) -> int: ...
|
||||
def connect_srv(
|
||||
self,
|
||||
domain: str | None = ...,
|
||||
keepalive: int = ...,
|
||||
bind_address: str = ...,
|
||||
clean_start: int = ...,
|
||||
properties: Properties | None = ...,
|
||||
domain: str | None = None,
|
||||
keepalive: int = 60,
|
||||
bind_address: str = "",
|
||||
clean_start: int = 3,
|
||||
properties: Properties | None = None,
|
||||
) -> int: ...
|
||||
def connect_async(
|
||||
self,
|
||||
host: str,
|
||||
port: int = ...,
|
||||
keepalive: int = ...,
|
||||
bind_address: str = ...,
|
||||
bind_port: int = ...,
|
||||
clean_start: int = ...,
|
||||
properties: Properties | None = ...,
|
||||
port: int = 1883,
|
||||
keepalive: int = 60,
|
||||
bind_address: str = "",
|
||||
bind_port: int = 0,
|
||||
clean_start: int = 3,
|
||||
properties: Properties | None = None,
|
||||
) -> None: ...
|
||||
def reconnect_delay_set(self, min_delay: int = ..., max_delay: int = ...) -> None: ...
|
||||
def reconnect_delay_set(self, min_delay: int = 1, max_delay: int = 120) -> None: ...
|
||||
def reconnect(self) -> int: ...
|
||||
def loop(self, timeout: float = ..., max_packets: int = ...) -> int: ...
|
||||
def loop(self, timeout: float = 1.0, max_packets: int = 1) -> int: ...
|
||||
def publish(
|
||||
self, topic: str, payload: _Payload | None = ..., qos: int = ..., retain: bool = ..., properties: Properties | None = ...
|
||||
self,
|
||||
topic: str,
|
||||
payload: _Payload | None = None,
|
||||
qos: int = 0,
|
||||
retain: bool = False,
|
||||
properties: Properties | None = None,
|
||||
) -> MQTTMessageInfo: ...
|
||||
def username_pw_set(self, username: str, password: str | bytes | bytearray | None = ...) -> None: ...
|
||||
def username_pw_set(self, username: str, password: str | bytes | bytearray | None = None) -> None: ...
|
||||
def enable_bridge_mode(self) -> None: ...
|
||||
def is_connected(self) -> bool: ...
|
||||
def disconnect(self, reasoncode: ReasonCodes | None = ..., properties: Properties | None = ...) -> int: ...
|
||||
def disconnect(self, reasoncode: ReasonCodes | None = None, properties: Properties | None = None) -> int: ...
|
||||
def subscribe(
|
||||
self,
|
||||
topic: str | tuple[str, SubscribeOptions] | list[tuple[str, SubscribeOptions]] | list[tuple[str, int]],
|
||||
qos: int = ...,
|
||||
options: SubscribeOptions | None = ...,
|
||||
properties: Properties | None = ...,
|
||||
qos: int = 0,
|
||||
options: SubscribeOptions | None = None,
|
||||
properties: Properties | None = None,
|
||||
) -> tuple[int, int]: ...
|
||||
def unsubscribe(self, topic: str | list[str], properties: Properties | None = ...) -> tuple[int, int]: ...
|
||||
def loop_read(self, max_packets: int = ...) -> int: ...
|
||||
def loop_write(self, max_packets: int = ...) -> int: ...
|
||||
def unsubscribe(self, topic: str | list[str], properties: Properties | None = None) -> tuple[int, int]: ...
|
||||
def loop_read(self, max_packets: int = 1) -> int: ...
|
||||
def loop_write(self, max_packets: int = 1) -> int: ...
|
||||
def want_write(self) -> bool: ...
|
||||
def loop_misc(self) -> int: ...
|
||||
def max_inflight_messages_set(self, inflight: int) -> None: ...
|
||||
@@ -228,13 +233,18 @@ class Client:
|
||||
def message_retry_set(self, retry: Unused) -> None: ...
|
||||
def user_data_set(self, userdata: _UserData) -> None: ...
|
||||
def will_set(
|
||||
self, topic: str, payload: _Payload | None = ..., qos: int = ..., retain: bool = ..., properties: Properties | None = ...
|
||||
self,
|
||||
topic: str,
|
||||
payload: _Payload | None = None,
|
||||
qos: int = 0,
|
||||
retain: bool = False,
|
||||
properties: Properties | None = None,
|
||||
) -> None: ...
|
||||
def will_clear(self) -> None: ...
|
||||
def socket(self) -> _Socket | WebsocketWrapper: ...
|
||||
def loop_forever(self, timeout: float = ..., max_packets: int = ..., retry_first_connection: bool = ...) -> int: ...
|
||||
def loop_forever(self, timeout: float = 1.0, max_packets: int = 1, retry_first_connection: bool = False) -> int: ...
|
||||
def loop_start(self) -> int | None: ...
|
||||
def loop_stop(self, force: bool = ...) -> int | None: ...
|
||||
def loop_stop(self, force: bool = False) -> int | None: ...
|
||||
@property
|
||||
def on_log(self) -> _OnLog | None: ...
|
||||
@on_log.setter
|
||||
|
||||
@@ -33,30 +33,30 @@ class _Proxy(TypedDict):
|
||||
|
||||
def multiple(
|
||||
msgs: Iterable[_Msg],
|
||||
hostname: str = ...,
|
||||
port: int = ...,
|
||||
client_id: str = ...,
|
||||
keepalive: int = ...,
|
||||
will: _Msg | None = ...,
|
||||
auth: _Auth | None = ...,
|
||||
tls: _TLS | None = ...,
|
||||
protocol: int = ...,
|
||||
transport: str = ...,
|
||||
proxy_args: _Proxy | None = ...,
|
||||
hostname: str = "localhost",
|
||||
port: int = 1883,
|
||||
client_id: str = "",
|
||||
keepalive: int = 60,
|
||||
will: _Msg | None = None,
|
||||
auth: _Auth | None = None,
|
||||
tls: _TLS | None = None,
|
||||
protocol: int = 4,
|
||||
transport: str = "tcp",
|
||||
proxy_args: _Proxy | None = None,
|
||||
) -> None: ...
|
||||
def single(
|
||||
topic: str,
|
||||
payload: _Payload | None = ...,
|
||||
qos: int | None = ...,
|
||||
retain: bool | None = ...,
|
||||
hostname: str = ...,
|
||||
port: int = ...,
|
||||
client_id: str = ...,
|
||||
keepalive: int = ...,
|
||||
will: _Msg | None = ...,
|
||||
auth: _Auth | None = ...,
|
||||
tls: _TLS | None = ...,
|
||||
protocol: int = ...,
|
||||
transport: str = ...,
|
||||
proxy_args: _Proxy | None = ...,
|
||||
payload: _Payload | None = None,
|
||||
qos: int | None = 0,
|
||||
retain: bool | None = False,
|
||||
hostname: str = "localhost",
|
||||
port: int = 1883,
|
||||
client_id: str = "",
|
||||
keepalive: int = 60,
|
||||
will: _Msg | None = None,
|
||||
auth: _Auth | None = None,
|
||||
tls: _TLS | None = None,
|
||||
protocol: int = 4,
|
||||
transport: str = "tcp",
|
||||
proxy_args: _Proxy | None = None,
|
||||
) -> None: ...
|
||||
|
||||
@@ -2,7 +2,7 @@ class ReasonCodes:
|
||||
packetType: int
|
||||
names: dict[int, dict[str, list[int]]]
|
||||
value: int
|
||||
def __init__(self, packetType: int, aName: str = ..., identifier: int = ...) -> None: ...
|
||||
def __init__(self, packetType: int, aName: str = "Success", identifier: int = -1) -> None: ...
|
||||
def __getName__(self, packetType: int, identifier: int) -> str: ...
|
||||
def getId(self, name: str) -> int: ...
|
||||
def set(self, name: str) -> None: ...
|
||||
|
||||
@@ -6,34 +6,34 @@ from .publish import _TLS, _Auth, _Msg, _Proxy
|
||||
def callback(
|
||||
callback: Callable[[Client, _UserData, MQTTMessage], None],
|
||||
topics: list[str],
|
||||
qos: int = ...,
|
||||
userdata: _UserData | None = ...,
|
||||
hostname: str = ...,
|
||||
port: int = ...,
|
||||
client_id: str = ...,
|
||||
keepalive: int = ...,
|
||||
will: _Msg | None = ...,
|
||||
auth: _Auth | None = ...,
|
||||
tls: _TLS | None = ...,
|
||||
protocol: int = ...,
|
||||
transport: str = ...,
|
||||
clean_session: bool = ...,
|
||||
proxy_args: _Proxy | None = ...,
|
||||
qos: int = 0,
|
||||
userdata: _UserData | None = None,
|
||||
hostname: str = "localhost",
|
||||
port: int = 1883,
|
||||
client_id: str = "",
|
||||
keepalive: int = 60,
|
||||
will: _Msg | None = None,
|
||||
auth: _Auth | None = None,
|
||||
tls: _TLS | None = None,
|
||||
protocol: int = 4,
|
||||
transport: str = "tcp",
|
||||
clean_session: bool = True,
|
||||
proxy_args: _Proxy | None = None,
|
||||
) -> None: ...
|
||||
def simple(
|
||||
topics: str | list[str],
|
||||
qos: int = ...,
|
||||
msg_count: int = ...,
|
||||
retained: bool = ...,
|
||||
hostname: str = ...,
|
||||
port: int = ...,
|
||||
client_id: str = ...,
|
||||
keepalive: int = ...,
|
||||
will: _Msg | None = ...,
|
||||
auth: _Auth | None = ...,
|
||||
tls: _TLS | None = ...,
|
||||
protocol: int = ...,
|
||||
transport: str = ...,
|
||||
clean_session: bool = ...,
|
||||
proxy_args: _Proxy | None = ...,
|
||||
qos: int = 0,
|
||||
msg_count: int = 1,
|
||||
retained: bool = True,
|
||||
hostname: str = "localhost",
|
||||
port: int = 1883,
|
||||
client_id: str = "",
|
||||
keepalive: int = 60,
|
||||
will: _Msg | None = None,
|
||||
auth: _Auth | None = None,
|
||||
tls: _TLS | None = None,
|
||||
protocol: int = 4,
|
||||
transport: str = "tcp",
|
||||
clean_session: bool = True,
|
||||
proxy_args: _Proxy | None = None,
|
||||
) -> list[MQTTMessage] | MQTTMessage: ...
|
||||
|
||||
@@ -18,7 +18,7 @@ class SubscribeOptions:
|
||||
noLocal: bool
|
||||
retainAsPublished: bool
|
||||
retainHandling: int
|
||||
def __init__(self, qos: int = ..., noLocal: bool = ..., retainAsPublished: bool = ..., retainHandling: int = ...) -> None: ...
|
||||
def __init__(self, qos: int = 0, noLocal: bool = False, retainAsPublished: bool = False, retainHandling: int = 0) -> None: ...
|
||||
def __setattr__(self, name: str, value: Any) -> None: ...
|
||||
def pack(self) -> bytes: ...
|
||||
def unpack(self, buffer: bytes | bytearray) -> int: ...
|
||||
|
||||
@@ -1,9 +1,3 @@
|
||||
paramiko.SFTPServer.__init__
|
||||
paramiko.Transport.open_x11_channel
|
||||
paramiko.Transport.send_ignore
|
||||
paramiko.Transport.start_server
|
||||
paramiko.sftp_server.SFTPServer.__init__
|
||||
paramiko.transport.Transport.open_x11_channel
|
||||
paramiko.transport.Transport.send_ignore
|
||||
paramiko.transport.Transport.start_server
|
||||
paramiko.util.SupportsClose
|
||||
|
||||
@@ -10,7 +10,7 @@ if sys.platform == "win32":
|
||||
def format_system_message(errno: int) -> str | None: ...
|
||||
|
||||
class WindowsError(builtins.WindowsError):
|
||||
def __init__(self, value: int | None = ...) -> None: ...
|
||||
def __init__(self, value: int | None = None) -> None: ...
|
||||
@property
|
||||
def message(self) -> str: ...
|
||||
@property
|
||||
@@ -34,7 +34,7 @@ if sys.platform == "win32":
|
||||
pos: int
|
||||
filemap: Any = ...
|
||||
view: Any = ...
|
||||
def __init__(self, name: str, length: int, security_attributes: Incomplete | None = ...) -> None: ...
|
||||
def __init__(self, name: str, length: int, security_attributes: Incomplete | None = None) -> None: ...
|
||||
def __enter__(self) -> Self: ...
|
||||
def seek(self, pos: int) -> None: ...
|
||||
def write(self, msg: bytes) -> None: ...
|
||||
@@ -91,4 +91,4 @@ if sys.platform == "win32":
|
||||
def GetTokenInformation(token: Any, information_class: Any) -> Any: ...
|
||||
def OpenProcessToken(proc_handle: Any, access: Any) -> Any: ...
|
||||
def get_current_user() -> TOKEN_USER: ...
|
||||
def get_security_attributes_for_user(user: TOKEN_USER | None = ...) -> SECURITY_ATTRIBUTES: ...
|
||||
def get_security_attributes_for_user(user: TOKEN_USER | None = None) -> SECURITY_ATTRIBUTES: ...
|
||||
|
||||
@@ -64,4 +64,4 @@ class AgentKey(PKey):
|
||||
def __init__(self, agent: AgentSSH, blob: bytes) -> None: ...
|
||||
def asbytes(self) -> bytes: ...
|
||||
def get_name(self) -> str: ...
|
||||
def sign_ssh_data(self, data: bytes, algorithm: str | None = ...) -> Message: ...
|
||||
def sign_ssh_data(self, data: bytes, algorithm: str | None = None) -> Message: ...
|
||||
|
||||
@@ -29,7 +29,7 @@ class AuthHandler:
|
||||
def auth_none(self, username: str, event: Event) -> None: ...
|
||||
def auth_publickey(self, username: str, key: PKey, event: Event) -> None: ...
|
||||
def auth_password(self, username: str, password: str, event: Event) -> None: ...
|
||||
def auth_interactive(self, username: str, handler: _InteractiveCallback, event: Event, submethods: str = ...) -> None: ...
|
||||
def auth_interactive(self, username: str, handler: _InteractiveCallback, event: Event, submethods: str = "") -> None: ...
|
||||
def auth_gssapi_with_mic(self, username: str, gss_host: str, gss_deleg_creds: bool, event: Event) -> None: ...
|
||||
def auth_gssapi_keyex(self, username: str, event: Event) -> None: ...
|
||||
def abort(self) -> None: ...
|
||||
|
||||
@@ -6,7 +6,7 @@ class BERException(Exception): ...
|
||||
class BER:
|
||||
content: bytes
|
||||
idx: int
|
||||
def __init__(self, content: bytes = ...) -> None: ...
|
||||
def __init__(self, content: bytes = b"") -> None: ...
|
||||
def asbytes(self) -> bytes: ...
|
||||
def decode(self) -> None | int | list[int]: ...
|
||||
def decode_next(self) -> None | int | list[int]: ...
|
||||
|
||||
@@ -8,7 +8,7 @@ class BufferedPipe(Generic[AnyStr]):
|
||||
def set_event(self, event: Event) -> None: ...
|
||||
def feed(self, data: AnyStr) -> None: ...
|
||||
def read_ready(self) -> bool: ...
|
||||
def read(self, nbytes: int, timeout: float | None = ...) -> AnyStr: ...
|
||||
def read(self, nbytes: int, timeout: float | None = None) -> AnyStr: ...
|
||||
def empty(self) -> AnyStr: ...
|
||||
def close(self) -> None: ...
|
||||
def __len__(self) -> int: ...
|
||||
|
||||
@@ -43,12 +43,12 @@ class Channel(ClosingContextManager):
|
||||
def __init__(self, chanid: int) -> None: ...
|
||||
def __del__(self) -> None: ...
|
||||
def get_pty(
|
||||
self, term: str | bytes = ..., width: int = ..., height: int = ..., width_pixels: int = ..., height_pixels: int = ...
|
||||
self, term: str | bytes = "vt100", width: int = 80, height: int = 24, width_pixels: int = 0, height_pixels: int = 0
|
||||
) -> None: ...
|
||||
def invoke_shell(self) -> None: ...
|
||||
def exec_command(self, command: str | bytes) -> None: ...
|
||||
def invoke_subsystem(self, subsystem: str | bytes) -> None: ...
|
||||
def resize_pty(self, width: int = ..., height: int = ..., width_pixels: int = ..., height_pixels: int = ...) -> None: ...
|
||||
def resize_pty(self, width: int = 80, height: int = 24, width_pixels: int = 0, height_pixels: int = 0) -> None: ...
|
||||
def update_environment(self, environment: Mapping[str | bytes, str | bytes]) -> None: ...
|
||||
def set_environment_variable(self, name: str | bytes, value: str | bytes) -> None: ...
|
||||
def exit_status_ready(self) -> bool: ...
|
||||
@@ -56,11 +56,11 @@ class Channel(ClosingContextManager):
|
||||
def send_exit_status(self, status: int) -> None: ...
|
||||
def request_x11(
|
||||
self,
|
||||
screen_number: int = ...,
|
||||
auth_protocol: str | bytes | None = ...,
|
||||
auth_cookie: str | bytes | None = ...,
|
||||
single_connection: bool = ...,
|
||||
handler: Callable[[Channel, tuple[str, int]], object] | None = ...,
|
||||
screen_number: int = 0,
|
||||
auth_protocol: str | bytes | None = None,
|
||||
auth_cookie: str | bytes | None = None,
|
||||
single_connection: bool = False,
|
||||
handler: Callable[[Channel, tuple[str, int]], object] | None = None,
|
||||
) -> bytes: ...
|
||||
def request_forward_agent(self, handler: Callable[[Channel], object]) -> bool: ...
|
||||
def get_transport(self) -> Transport: ...
|
||||
@@ -92,7 +92,7 @@ class Channel(ClosingContextManager):
|
||||
|
||||
class ChannelFile(BufferedFile[Any]):
|
||||
channel: Channel
|
||||
def __init__(self, channel: Channel, mode: str = ..., bufsize: int = ...) -> None: ...
|
||||
def __init__(self, channel: Channel, mode: str = "r", bufsize: int = -1) -> None: ...
|
||||
|
||||
class ChannelStderrFile(ChannelFile): ...
|
||||
|
||||
|
||||
@@ -17,7 +17,7 @@ class _TransportFactory(Protocol):
|
||||
|
||||
class SSHClient(ClosingContextManager):
|
||||
def __init__(self) -> None: ...
|
||||
def load_system_host_keys(self, filename: str | None = ...) -> None: ...
|
||||
def load_system_host_keys(self, filename: str | None = None) -> None: ...
|
||||
def load_host_keys(self, filename: str) -> None: ...
|
||||
def save_host_keys(self, filename: str) -> None: ...
|
||||
def get_host_keys(self) -> HostKeys: ...
|
||||
@@ -26,44 +26,44 @@ class SSHClient(ClosingContextManager):
|
||||
def connect(
|
||||
self,
|
||||
hostname: str,
|
||||
port: int = ...,
|
||||
username: str | None = ...,
|
||||
password: str | None = ...,
|
||||
pkey: PKey | None = ...,
|
||||
key_filename: str | None = ...,
|
||||
timeout: float | None = ...,
|
||||
allow_agent: bool = ...,
|
||||
look_for_keys: bool = ...,
|
||||
compress: bool = ...,
|
||||
sock: _SocketLike | None = ...,
|
||||
gss_auth: bool = ...,
|
||||
gss_kex: bool = ...,
|
||||
gss_deleg_creds: bool = ...,
|
||||
gss_host: str | None = ...,
|
||||
banner_timeout: float | None = ...,
|
||||
auth_timeout: float | None = ...,
|
||||
gss_trust_dns: bool = ...,
|
||||
passphrase: str | None = ...,
|
||||
disabled_algorithms: dict[str, Iterable[str]] | None = ...,
|
||||
transport_factory: _TransportFactory | None = ...,
|
||||
port: int = 22,
|
||||
username: str | None = None,
|
||||
password: str | None = None,
|
||||
pkey: PKey | None = None,
|
||||
key_filename: str | None = None,
|
||||
timeout: float | None = None,
|
||||
allow_agent: bool = True,
|
||||
look_for_keys: bool = True,
|
||||
compress: bool = False,
|
||||
sock: _SocketLike | None = None,
|
||||
gss_auth: bool = False,
|
||||
gss_kex: bool = False,
|
||||
gss_deleg_creds: bool = True,
|
||||
gss_host: str | None = None,
|
||||
banner_timeout: float | None = None,
|
||||
auth_timeout: float | None = None,
|
||||
gss_trust_dns: bool = True,
|
||||
passphrase: str | None = None,
|
||||
disabled_algorithms: dict[str, Iterable[str]] | None = None,
|
||||
transport_factory: _TransportFactory | None = None,
|
||||
) -> None: ...
|
||||
def close(self) -> None: ...
|
||||
def exec_command(
|
||||
self,
|
||||
command: str,
|
||||
bufsize: int = ...,
|
||||
timeout: float | None = ...,
|
||||
get_pty: bool = ...,
|
||||
environment: dict[str, str] | None = ...,
|
||||
bufsize: int = -1,
|
||||
timeout: float | None = None,
|
||||
get_pty: bool = False,
|
||||
environment: dict[str, str] | None = None,
|
||||
) -> tuple[ChannelStdinFile, ChannelFile, ChannelStderrFile]: ...
|
||||
def invoke_shell(
|
||||
self,
|
||||
term: str = ...,
|
||||
width: int = ...,
|
||||
height: int = ...,
|
||||
width_pixels: int = ...,
|
||||
height_pixels: int = ...,
|
||||
environment: Mapping[str, str] | None = ...,
|
||||
term: str = "vt100",
|
||||
width: int = 80,
|
||||
height: int = 24,
|
||||
width_pixels: int = 0,
|
||||
height_pixels: int = 0,
|
||||
environment: Mapping[str, str] | None = None,
|
||||
) -> Channel: ...
|
||||
def open_sftp(self) -> SFTPClient: ...
|
||||
def get_transport(self) -> Transport | None: ...
|
||||
|
||||
@@ -26,7 +26,7 @@ class LazyFqdn:
|
||||
fqdn: str | None
|
||||
config: SSHConfig
|
||||
host: str | None
|
||||
def __init__(self, config: SSHConfigDict, host: str | None = ...) -> None: ...
|
||||
def __init__(self, config: SSHConfigDict, host: str | None = None) -> None: ...
|
||||
|
||||
class SSHConfigDict(dict[str, str]):
|
||||
def as_bool(self, key: str) -> bool: ...
|
||||
|
||||
@@ -14,21 +14,21 @@ class DSSKey(PKey):
|
||||
size: int
|
||||
def __init__(
|
||||
self,
|
||||
msg: Message | None = ...,
|
||||
data: bytes | None = ...,
|
||||
filename: str | None = ...,
|
||||
password: str | None = ...,
|
||||
vals: tuple[int, int, int, int] | None = ...,
|
||||
file_obj: IO[str] | None = ...,
|
||||
msg: Message | None = None,
|
||||
data: bytes | None = None,
|
||||
filename: str | None = None,
|
||||
password: str | None = None,
|
||||
vals: tuple[int, int, int, int] | None = None,
|
||||
file_obj: IO[str] | None = None,
|
||||
) -> None: ...
|
||||
def asbytes(self) -> bytes: ...
|
||||
def __hash__(self) -> int: ...
|
||||
def get_name(self) -> str: ...
|
||||
def get_bits(self) -> int: ...
|
||||
def can_sign(self) -> bool: ...
|
||||
def sign_ssh_data(self, data: bytes, algorithm: str | None = ...) -> Message: ...
|
||||
def sign_ssh_data(self, data: bytes, algorithm: str | None = None) -> Message: ...
|
||||
def verify_ssh_sig(self, data: bytes, msg: Message) -> bool: ...
|
||||
def write_private_key_file(self, filename: str, password: str | None = ...) -> None: ...
|
||||
def write_private_key(self, file_obj: IO[str], password: str | None = ...) -> None: ...
|
||||
def write_private_key_file(self, filename: str, password: str | None = None) -> None: ...
|
||||
def write_private_key(self, file_obj: IO[str], password: str | None = None) -> None: ...
|
||||
@staticmethod
|
||||
def generate(bits: int = ..., progress_func: Callable[..., object] | None = ...) -> DSSKey: ...
|
||||
def generate(bits: int = 1024, progress_func: Callable[..., object] | None = None) -> DSSKey: ...
|
||||
|
||||
@@ -29,13 +29,13 @@ class ECDSAKey(PKey):
|
||||
ecdsa_curve: _ECDSACurve | None
|
||||
def __init__(
|
||||
self,
|
||||
msg: Message | None = ...,
|
||||
data: bytes | None = ...,
|
||||
filename: str | None = ...,
|
||||
password: str | None = ...,
|
||||
vals: tuple[EllipticCurvePrivateKey, EllipticCurvePublicKey] | None = ...,
|
||||
file_obj: IO[str] | None = ...,
|
||||
validate_point: bool = ...,
|
||||
msg: Message | None = None,
|
||||
data: bytes | None = None,
|
||||
filename: str | None = None,
|
||||
password: str | None = None,
|
||||
vals: tuple[EllipticCurvePrivateKey, EllipticCurvePublicKey] | None = None,
|
||||
file_obj: IO[str] | None = None,
|
||||
validate_point: bool = True,
|
||||
) -> None: ...
|
||||
@classmethod
|
||||
def supported_key_format_identifiers(cls: Any) -> list[str]: ...
|
||||
@@ -44,11 +44,11 @@ class ECDSAKey(PKey):
|
||||
def get_name(self) -> str: ...
|
||||
def get_bits(self) -> int: ...
|
||||
def can_sign(self) -> bool: ...
|
||||
def sign_ssh_data(self, data: bytes, algorithm: str | None = ...) -> Message: ...
|
||||
def sign_ssh_data(self, data: bytes, algorithm: str | None = None) -> Message: ...
|
||||
def verify_ssh_sig(self, data: bytes, msg: Message) -> bool: ...
|
||||
def write_private_key_file(self, filename: str, password: str | None = ...) -> None: ...
|
||||
def write_private_key(self, file_obj: IO[str], password: str | None = ...) -> None: ...
|
||||
def write_private_key_file(self, filename: str, password: str | None = None) -> None: ...
|
||||
def write_private_key(self, file_obj: IO[str], password: str | None = None) -> None: ...
|
||||
@classmethod
|
||||
def generate(
|
||||
cls, curve: EllipticCurve = ..., progress_func: Callable[..., object] | None = ..., bits: int | None = ...
|
||||
cls, curve: EllipticCurve = ..., progress_func: Callable[..., object] | None = None, bits: int | None = None
|
||||
) -> ECDSAKey: ...
|
||||
|
||||
@@ -7,16 +7,16 @@ class Ed25519Key(PKey):
|
||||
public_blob: None
|
||||
def __init__(
|
||||
self,
|
||||
msg: Message | None = ...,
|
||||
data: bytes | None = ...,
|
||||
filename: str | None = ...,
|
||||
password: str | None = ...,
|
||||
file_obj: IO[str] | None = ...,
|
||||
msg: Message | None = None,
|
||||
data: bytes | None = None,
|
||||
filename: str | None = None,
|
||||
password: str | None = None,
|
||||
file_obj: IO[str] | None = None,
|
||||
) -> None: ...
|
||||
def asbytes(self) -> bytes: ...
|
||||
def __hash__(self) -> int: ...
|
||||
def get_name(self) -> str: ...
|
||||
def get_bits(self) -> int: ...
|
||||
def can_sign(self) -> bool: ...
|
||||
def sign_ssh_data(self, data: bytes, algorithm: str | None = ...) -> Message: ...
|
||||
def sign_ssh_data(self, data: bytes, algorithm: str | None = None) -> Message: ...
|
||||
def verify_ssh_sig(self, data: bytes, msg: Message) -> bool: ...
|
||||
|
||||
@@ -27,10 +27,10 @@ class BufferedFile(ClosingContextManager, Generic[AnyStr]):
|
||||
def writable(self) -> bool: ...
|
||||
def seekable(self) -> bool: ...
|
||||
def readinto(self, buff: bytearray) -> int: ...
|
||||
def read(self, size: int | None = ...) -> bytes: ...
|
||||
def readline(self, size: int | None = ...) -> AnyStr: ...
|
||||
def readlines(self, sizehint: int | None = ...) -> list[AnyStr]: ...
|
||||
def seek(self, offset: int, whence: int = ...) -> None: ...
|
||||
def read(self, size: int | None = None) -> bytes: ...
|
||||
def readline(self, size: int | None = None) -> AnyStr: ...
|
||||
def readlines(self, sizehint: int | None = None) -> list[AnyStr]: ...
|
||||
def seek(self, offset: int, whence: int = 0) -> None: ...
|
||||
def tell(self) -> int: ...
|
||||
def write(self, data: AnyStr) -> None: ...
|
||||
def writelines(self, sequence: Iterable[AnyStr]) -> None: ...
|
||||
|
||||
@@ -14,7 +14,7 @@ class _SubDict(MutableMapping[str, PKey]):
|
||||
def keys(self) -> list[str]: ... # type: ignore[override]
|
||||
|
||||
class HostKeys(MutableMapping[str, _SubDict]):
|
||||
def __init__(self, filename: str | None = ...) -> None: ...
|
||||
def __init__(self, filename: str | None = None) -> None: ...
|
||||
def add(self, hostname: str, keytype: str, key: PKey) -> None: ...
|
||||
def load(self, filename: str) -> None: ...
|
||||
def save(self, filename: str) -> None: ...
|
||||
@@ -29,7 +29,7 @@ class HostKeys(MutableMapping[str, _SubDict]):
|
||||
def keys(self) -> list[str]: ... # type: ignore[override]
|
||||
def values(self) -> list[_SubDict]: ... # type: ignore[override]
|
||||
@staticmethod
|
||||
def hash_host(hostname: str, salt: str | None = ...) -> str: ...
|
||||
def hash_host(hostname: str, salt: str | None = None) -> str: ...
|
||||
|
||||
class InvalidHostKey(Exception):
|
||||
line: str
|
||||
@@ -40,7 +40,7 @@ class HostKeyEntry:
|
||||
valid: bool
|
||||
hostnames: list[str]
|
||||
key: PKey
|
||||
def __init__(self, hostnames: list[str] | None = ..., key: PKey | None = ...) -> None: ...
|
||||
def __init__(self, hostnames: list[str] | None = None, key: PKey | None = None) -> None: ...
|
||||
@classmethod
|
||||
def from_line(cls, line: str, lineno: int | None = ...) -> Self | None: ...
|
||||
def from_line(cls, line: str, lineno: int | None = None) -> Self | None: ...
|
||||
def to_line(self) -> str | None: ...
|
||||
|
||||
@@ -26,7 +26,7 @@ class KexGex:
|
||||
f: int | None
|
||||
old_style: bool
|
||||
def __init__(self, transport: Transport) -> None: ...
|
||||
def start_kex(self, _test_old_style: bool = ...) -> None: ...
|
||||
def start_kex(self, _test_old_style: bool = False) -> None: ...
|
||||
def parse_next(self, ptype: int, m: Message) -> None: ...
|
||||
|
||||
class KexGexSHA256(KexGex):
|
||||
|
||||
@@ -12,7 +12,7 @@ class Message:
|
||||
big_int: int
|
||||
packet: BytesIO
|
||||
seqno: int # only when packet.Packetizer.read_message() is used
|
||||
def __init__(self, content: bytes | None = ...) -> None: ...
|
||||
def __init__(self, content: bytes | None = None) -> None: ...
|
||||
def __bytes__(self) -> bytes: ...
|
||||
def asbytes(self) -> bytes: ...
|
||||
def rewind(self) -> None: ...
|
||||
|
||||
@@ -31,11 +31,17 @@ class Packetizer:
|
||||
mac_engine: _Hash,
|
||||
mac_size: int,
|
||||
mac_key: bytes,
|
||||
sdctr: bool = ...,
|
||||
etm: bool = ...,
|
||||
sdctr: bool = False,
|
||||
etm: bool = False,
|
||||
) -> None: ...
|
||||
def set_inbound_cipher(
|
||||
self, block_engine: Cipher[Incomplete], block_size: int, mac_engine: _Hash, mac_size: int, mac_key: bytes, etm: bool = ...
|
||||
self,
|
||||
block_engine: Cipher[Incomplete],
|
||||
block_size: int,
|
||||
mac_engine: _Hash,
|
||||
mac_size: int,
|
||||
mac_key: bytes,
|
||||
etm: bool = False,
|
||||
) -> None: ...
|
||||
def set_outbound_compressor(self, compressor: ZlibCompressor) -> None: ...
|
||||
def set_inbound_compressor(self, compressor: ZlibDecompressor) -> None: ...
|
||||
@@ -50,7 +56,7 @@ class Packetizer:
|
||||
def start_handshake(self, timeout: float) -> None: ...
|
||||
def handshake_timed_out(self) -> bool: ...
|
||||
def complete_handshake(self) -> None: ...
|
||||
def read_all(self, n: int, check_rekey: bool = ...) -> bytes: ...
|
||||
def read_all(self, n: int, check_rekey: bool = False) -> bytes: ...
|
||||
def write_all(self, out: bytes) -> None: ...
|
||||
def readline(self, timeout: float) -> str: ...
|
||||
def send_message(self, data: Message) -> None: ...
|
||||
|
||||
@@ -12,7 +12,7 @@ class PKey:
|
||||
public_blob: PublicBlob | None
|
||||
BEGIN_TAG: Pattern[str]
|
||||
END_TAG: Pattern[str]
|
||||
def __init__(self, msg: Message | None = ..., data: str | None = ...) -> None: ...
|
||||
def __init__(self, msg: Message | None = None, data: str | None = None) -> None: ...
|
||||
def asbytes(self) -> bytes: ...
|
||||
def __bytes__(self) -> bytes: ...
|
||||
def __eq__(self, other: object) -> bool: ...
|
||||
@@ -21,21 +21,21 @@ class PKey:
|
||||
def can_sign(self) -> bool: ...
|
||||
def get_fingerprint(self) -> bytes: ...
|
||||
def get_base64(self) -> str: ...
|
||||
def sign_ssh_data(self, data: bytes, algorithm: str | None = ...) -> Message: ...
|
||||
def sign_ssh_data(self, data: bytes, algorithm: str | None = None) -> Message: ...
|
||||
def verify_ssh_sig(self, data: bytes, msg: Message) -> bool: ...
|
||||
@classmethod
|
||||
def from_private_key_file(cls, filename: str, password: str | None = ...) -> Self: ...
|
||||
def from_private_key_file(cls, filename: str, password: str | None = None) -> Self: ...
|
||||
@classmethod
|
||||
def from_private_key(cls, file_obj: IO[str], password: str | None = ...) -> Self: ...
|
||||
def write_private_key_file(self, filename: str, password: str | None = ...) -> None: ...
|
||||
def write_private_key(self, file_obj: IO[str], password: str | None = ...) -> None: ...
|
||||
def from_private_key(cls, file_obj: IO[str], password: str | None = None) -> Self: ...
|
||||
def write_private_key_file(self, filename: str, password: str | None = None) -> None: ...
|
||||
def write_private_key(self, file_obj: IO[str], password: str | None = None) -> None: ...
|
||||
def load_certificate(self, value: Message | str) -> None: ...
|
||||
|
||||
class PublicBlob:
|
||||
key_type: str
|
||||
key_blob: str
|
||||
comment: str
|
||||
def __init__(self, type_: str, blob: bytes, comment: str | None = ...) -> None: ...
|
||||
def __init__(self, type_: str, blob: bytes, comment: str | None = None) -> None: ...
|
||||
@classmethod
|
||||
def from_file(cls, filename: str) -> Self: ...
|
||||
@classmethod
|
||||
|
||||
@@ -10,12 +10,12 @@ class RSAKey(PKey):
|
||||
public_blob: None
|
||||
def __init__(
|
||||
self,
|
||||
msg: Message | None = ...,
|
||||
data: bytes | None = ...,
|
||||
filename: str | None = ...,
|
||||
password: str | None = ...,
|
||||
key: None | RSAPublicKey | RSAPrivateKey = ...,
|
||||
file_obj: IO[str] | None = ...,
|
||||
msg: Message | None = None,
|
||||
data: bytes | None = None,
|
||||
filename: str | None = None,
|
||||
password: str | None = None,
|
||||
key: None | RSAPublicKey | RSAPrivateKey = None,
|
||||
file_obj: IO[str] | None = None,
|
||||
) -> None: ...
|
||||
@property
|
||||
def size(self) -> int: ...
|
||||
@@ -26,9 +26,9 @@ class RSAKey(PKey):
|
||||
def get_name(self) -> str: ...
|
||||
def get_bits(self) -> int: ...
|
||||
def can_sign(self) -> bool: ...
|
||||
def sign_ssh_data(self, data: bytes, algorithm: str = ...) -> Message: ... # type: ignore[override]
|
||||
def sign_ssh_data(self, data: bytes, algorithm: str = "ssh-rsa") -> Message: ... # type: ignore[override]
|
||||
def verify_ssh_sig(self, data: bytes, msg: Message) -> bool: ...
|
||||
def write_private_key_file(self, filename: str, password: str | None = ...) -> None: ...
|
||||
def write_private_key(self, file_obj: IO[str], password: str | None = ...) -> None: ...
|
||||
def write_private_key_file(self, filename: str, password: str | None = None) -> None: ...
|
||||
def write_private_key(self, file_obj: IO[str], password: str | None = None) -> None: ...
|
||||
@staticmethod
|
||||
def generate(bits: int, progress_func: Callable[..., object] | None = ...) -> RSAKey: ...
|
||||
def generate(bits: int, progress_func: Callable[..., object] | None = None) -> RSAKey: ...
|
||||
|
||||
@@ -13,8 +13,8 @@ class ServerInterface:
|
||||
def check_auth_publickey(self, username: str, key: PKey) -> int: ...
|
||||
def check_auth_interactive(self, username: str, submethods: str) -> int | InteractiveQuery: ...
|
||||
def check_auth_interactive_response(self, responses: list[str]) -> int | InteractiveQuery: ...
|
||||
def check_auth_gssapi_with_mic(self, username: str, gss_authenticated: int = ..., cc_file: str | None = ...) -> int: ...
|
||||
def check_auth_gssapi_keyex(self, username: str, gss_authenticated: int = ..., cc_file: str | None = ...) -> int: ...
|
||||
def check_auth_gssapi_with_mic(self, username: str, gss_authenticated: int = 2, cc_file: str | None = None) -> int: ...
|
||||
def check_auth_gssapi_keyex(self, username: str, gss_authenticated: int = 2, cc_file: str | None = None) -> int: ...
|
||||
def enable_auth_gssapi(self) -> bool: ...
|
||||
def check_port_forward_request(self, address: str, port: int) -> int: ...
|
||||
def cancel_port_forward_request(self, address: str, port: int) -> None: ...
|
||||
@@ -40,8 +40,8 @@ class InteractiveQuery:
|
||||
name: str
|
||||
instructions: str
|
||||
prompts: list[tuple[str, bool]]
|
||||
def __init__(self, name: str = ..., instructions: str = ..., *prompts: str | tuple[str, bool]) -> None: ...
|
||||
def add_prompt(self, prompt: str, echo: bool = ...) -> None: ...
|
||||
def __init__(self, name: str = "", instructions: str = "", *prompts: str | tuple[str, bool]) -> None: ...
|
||||
def add_prompt(self, prompt: str, echo: bool = True) -> None: ...
|
||||
|
||||
class SubsystemHandler(threading.Thread):
|
||||
def __init__(self, channel: Channel, name: str, server: ServerInterface) -> None: ...
|
||||
|
||||
@@ -18,5 +18,5 @@ class SFTPAttributes:
|
||||
attr: dict[str, str]
|
||||
def __init__(self) -> None: ...
|
||||
@classmethod
|
||||
def from_stat(cls, obj: stat_result, filename: str | None = ...) -> Self: ...
|
||||
def from_stat(cls, obj: stat_result, filename: str | None = None) -> Self: ...
|
||||
def asbytes(self) -> bytes: ...
|
||||
|
||||
@@ -21,19 +21,19 @@ class SFTPClient(BaseSFTP, ClosingContextManager):
|
||||
logger: Logger
|
||||
def __init__(self, sock: Channel) -> None: ...
|
||||
@classmethod
|
||||
def from_transport(cls, t: Transport, window_size: int | None = ..., max_packet_size: int | None = ...) -> Self | None: ...
|
||||
def from_transport(cls, t: Transport, window_size: int | None = None, max_packet_size: int | None = None) -> Self | None: ...
|
||||
def close(self) -> None: ...
|
||||
def get_channel(self) -> Channel | None: ...
|
||||
def listdir(self, path: str = ...) -> list[str]: ...
|
||||
def listdir_attr(self, path: str = ...) -> list[SFTPAttributes]: ...
|
||||
def listdir_iter(self, path: bytes | str = ..., read_aheads: int = ...) -> Iterator[SFTPAttributes]: ...
|
||||
def open(self, filename: bytes | str, mode: str = ..., bufsize: int = ...) -> SFTPFile: ...
|
||||
def listdir(self, path: str = ".") -> list[str]: ...
|
||||
def listdir_attr(self, path: str = ".") -> list[SFTPAttributes]: ...
|
||||
def listdir_iter(self, path: bytes | str = ".", read_aheads: int = 50) -> Iterator[SFTPAttributes]: ...
|
||||
def open(self, filename: bytes | str, mode: str = "r", bufsize: int = -1) -> SFTPFile: ...
|
||||
file = open
|
||||
def remove(self, path: bytes | str) -> None: ...
|
||||
unlink = remove
|
||||
def rename(self, oldpath: bytes | str, newpath: bytes | str) -> None: ...
|
||||
def posix_rename(self, oldpath: bytes | str, newpath: bytes | str) -> None: ...
|
||||
def mkdir(self, path: bytes | str, mode: int = ...) -> None: ...
|
||||
def mkdir(self, path: bytes | str, mode: int = 511) -> None: ...
|
||||
def rmdir(self, path: bytes | str) -> None: ...
|
||||
def stat(self, path: bytes | str) -> SFTPAttributes: ...
|
||||
def lstat(self, path: bytes | str) -> SFTPAttributes: ...
|
||||
@@ -44,17 +44,17 @@ class SFTPClient(BaseSFTP, ClosingContextManager):
|
||||
def truncate(self, path: bytes | str, size: int) -> None: ...
|
||||
def readlink(self, path: bytes | str) -> str | None: ...
|
||||
def normalize(self, path: bytes | str) -> str: ...
|
||||
def chdir(self, path: None | bytes | str = ...) -> None: ...
|
||||
def chdir(self, path: None | bytes | str = None) -> None: ...
|
||||
def getcwd(self) -> str | None: ...
|
||||
def putfo(
|
||||
self, fl: IO[bytes], remotepath: bytes | str, file_size: int = ..., callback: _Callback | None = ..., confirm: bool = ...
|
||||
self, fl: IO[bytes], remotepath: bytes | str, file_size: int = 0, callback: _Callback | None = None, confirm: bool = True
|
||||
) -> SFTPAttributes: ...
|
||||
def put(
|
||||
self, localpath: bytes | str, remotepath: bytes | str, callback: _Callback | None = ..., confirm: bool = ...
|
||||
self, localpath: bytes | str, remotepath: bytes | str, callback: _Callback | None = None, confirm: bool = True
|
||||
) -> SFTPAttributes: ...
|
||||
def getfo(self, remotepath: bytes | str, fl: IO[bytes], callback: _Callback | None = ..., prefetch: bool = ...) -> int: ...
|
||||
def getfo(self, remotepath: bytes | str, fl: IO[bytes], callback: _Callback | None = None, prefetch: bool = True) -> int: ...
|
||||
def get(
|
||||
self, remotepath: bytes | str, localpath: bytes | str, callback: _Callback | None = ..., prefetch: bool = ...
|
||||
self, remotepath: bytes | str, localpath: bytes | str, callback: _Callback | None = None, prefetch: bool = True
|
||||
) -> None: ...
|
||||
|
||||
class SFTP(SFTPClient): ...
|
||||
|
||||
@@ -11,20 +11,20 @@ class SFTPFile(BufferedFile[Any]):
|
||||
sftp: SFTPClient
|
||||
handle: SFTPHandle
|
||||
pipelined: bool
|
||||
def __init__(self, sftp: SFTPClient, handle: bytes, mode: str = ..., bufsize: int = ...) -> None: ...
|
||||
def __init__(self, sftp: SFTPClient, handle: bytes, mode: str = "r", bufsize: int = -1) -> None: ...
|
||||
def __del__(self) -> None: ...
|
||||
def close(self) -> None: ...
|
||||
def settimeout(self, timeout: float) -> None: ...
|
||||
def gettimeout(self) -> float: ...
|
||||
def setblocking(self, blocking: bool) -> None: ...
|
||||
def seekable(self) -> bool: ...
|
||||
def seek(self, offset: int, whence: int = ...) -> None: ...
|
||||
def seek(self, offset: int, whence: int = 0) -> None: ...
|
||||
def stat(self) -> SFTPAttributes: ...
|
||||
def chmod(self, mode: int) -> None: ...
|
||||
def chown(self, uid: int, gid: int) -> None: ...
|
||||
def utime(self, times: tuple[float, float] | None) -> None: ...
|
||||
def truncate(self, size: int) -> None: ...
|
||||
def check(self, hash_algorithm: str, offset: int = ..., length: int = ..., block_size: int = ...) -> bytes: ...
|
||||
def set_pipelined(self, pipelined: bool = ...) -> None: ...
|
||||
def prefetch(self, file_size: int | None = ...) -> None: ...
|
||||
def check(self, hash_algorithm: str, offset: int = 0, length: int = 0, block_size: int = 0) -> bytes: ...
|
||||
def set_pipelined(self, pipelined: bool = True) -> None: ...
|
||||
def prefetch(self, file_size: int | None = None) -> None: ...
|
||||
def readv(self, chunks: Sequence[tuple[int, int]]) -> Iterator[bytes]: ...
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user