[Pillow] Replace Any with Incomplete (#10409)

This commit is contained in:
Sebastian Rittau
2023-07-06 15:48:50 +02:00
committed by GitHub
parent 1e6b8a9b88
commit edff8874da
55 changed files with 331 additions and 322 deletions

View File

@@ -1,9 +1,9 @@
from typing import Any
from _typeshed import Incomplete
from .FontFile import FontFile
bdf_slant: Any
bdf_spacing: Any
bdf_slant: Incomplete
bdf_spacing: Incomplete
def bdf_char(f): ...

View File

@@ -1,5 +1,6 @@
from _typeshed import Incomplete
from enum import IntEnum
from typing import Any, ClassVar
from typing import ClassVar
from typing_extensions import Literal
from .ImageFile import ImageFile, PyDecoder, PyEncoder
@@ -39,7 +40,7 @@ class BlpImageFile(ImageFile):
format_description: ClassVar[str]
class _BLPBaseDecoder(PyDecoder):
magic: Any
magic: Incomplete
def decode(self, buffer): ...
class BLP1Decoder(_BLPBaseDecoder): ...

View File

@@ -1,9 +1,10 @@
from typing import Any, ClassVar
from _typeshed import Incomplete
from typing import ClassVar
from typing_extensions import Final, Literal
from .ImageFile import ImageFile, PyDecoder
BIT2MODE: Any
BIT2MODE: Incomplete
class BmpImageFile(ImageFile):
RAW: Final = 0
@@ -14,7 +15,7 @@ class BmpImageFile(ImageFile):
PNG: Final = 5
format_description: ClassVar[str]
format: ClassVar[Literal["BMP", "DIB", "CUR"]]
COMPRESSIONS: Any
COMPRESSIONS: Incomplete
class BmpRleDecoder(PyDecoder):
def decode(self, buffer): ...
@@ -22,4 +23,4 @@ class BmpRleDecoder(PyDecoder):
class DibImageFile(BmpImageFile):
format: ClassVar[Literal["DIB"]]
SAVE: Any
SAVE: Incomplete

View File

@@ -1,10 +1,10 @@
from typing import Any
from _typeshed import Incomplete
class ContainerIO:
fh: Any
fh: Incomplete
pos: int
offset: Any
length: Any
offset: Incomplete
length: Incomplete
def __init__(self, file, offset, length) -> None: ...
def isatty(self): ...
def seek(self, offset, mode=0) -> None: ...

View File

@@ -1,4 +1,5 @@
from typing import Any, ClassVar
from _typeshed import Incomplete
from typing import ClassVar
from typing_extensions import Literal
from .PcxImagePlugin import PcxImageFile
@@ -7,7 +8,7 @@ MAGIC: int
class DcxImageFile(PcxImageFile):
format: ClassVar[Literal["DCX"]]
frame: Any
fp: Any
frame: Incomplete
fp: Incomplete
def seek(self, frame) -> None: ...
def tell(self): ...

View File

@@ -1,12 +1,13 @@
import sys
from typing import Any, ClassVar
from _typeshed import Incomplete
from typing import ClassVar
from typing_extensions import Literal
from ._imaging import _PixelAccessor
from .ImageFile import ImageFile
split: Any
field: Any
split: Incomplete
field: Incomplete
if sys.platform == "win32":
gs_windows_binary: Literal["gswin32c", "gswin64c", "gs", False]
else:
@@ -16,8 +17,8 @@ def has_ghostscript(): ...
def Ghostscript(tile, size, fp, scale: int = 1, transparency: bool = False): ...
class PSFile:
fp: Any
char: Any
fp: Incomplete
char: Incomplete
def __init__(self, fp) -> None: ...
def seek(self, offset, whence=0) -> None: ...
def readline(self): ...
@@ -25,9 +26,9 @@ class PSFile:
class EpsImageFile(ImageFile):
format: ClassVar[Literal["EPS"]]
format_description: ClassVar[str]
mode_map: Any
im: Any
mode: Any
tile: Any
mode_map: Incomplete
im: Incomplete
mode: Incomplete
tile: Incomplete
def load(self, scale: int = 1, transparency: bool = False) -> _PixelAccessor: ...
def load_seek(self, *args, **kwargs) -> None: ...

View File

@@ -1,16 +1,16 @@
from typing import Any
from _typeshed import Incomplete
WIDTH: int
def puti16(fp, values) -> None: ...
class FontFile:
bitmap: Any
info: Any
glyph: Any
bitmap: Incomplete
info: Incomplete
glyph: Incomplete
def __init__(self) -> None: ...
def __getitem__(self, ix): ...
ysize: Any
metrics: Any
ysize: Incomplete
metrics: Incomplete
def compile(self): ...
def save(self, filename) -> None: ...

View File

@@ -1,4 +1,5 @@
from typing import Any, ClassVar
from _typeshed import Incomplete
from typing import ClassVar
from typing_extensions import Literal
from ._imaging import _PixelAccessor
@@ -7,5 +8,5 @@ from .ImageFile import ImageFile
class GbrImageFile(ImageFile):
format: ClassVar[Literal["GBR"]]
format_description: ClassVar[str]
im: Any
im: Incomplete
def load(self) -> _PixelAccessor: ...

View File

@@ -1,6 +1,6 @@
from _typeshed import Incomplete
from enum import IntEnum
from typing import Any, ClassVar
from typing import ClassVar
from typing_extensions import Literal
from .ImageFile import ImageFile
@@ -15,17 +15,17 @@ LOADING_STRATEGY: LoadingStrategy
class GifImageFile(ImageFile):
format: ClassVar[Literal["GIF"]]
format_description: ClassVar[str]
global_palette: Any
global_palette: Incomplete
def data(self): ...
@property
def n_frames(self): ...
@property
def is_animated(self): ...
im: Any
im: Incomplete
def seek(self, frame) -> None: ...
def tell(self): ...
RAWMODE: Any
RAWMODE: Incomplete
def get_interlace(im): ...
def getheader(im, palette: Incomplete | None = None, info: Incomplete | None = None): ...

View File

@@ -1,4 +1,4 @@
from typing import Any
from _typeshed import Incomplete
EPSILON: float
@@ -8,12 +8,12 @@ def sine(middle, pos): ...
def sphere_increasing(middle, pos): ...
def sphere_decreasing(middle, pos): ...
SEGMENTS: Any
SEGMENTS: Incomplete
class GradientFile:
gradient: Any
gradient: Incomplete
def getpalette(self, entries: int = 256): ...
class GimpGradientFile(GradientFile):
gradient: Any
gradient: Incomplete
def __init__(self, fp) -> None: ...

View File

@@ -1,7 +1,7 @@
from typing import Any
from _typeshed import Incomplete
class GimpPaletteFile:
rawmode: str
palette: Any
palette: Incomplete
def __init__(self, fp) -> None: ...
def getpalette(self): ...

View File

@@ -1,11 +1,11 @@
from _typeshed import Incomplete
from typing import Any, ClassVar
from typing import ClassVar
from typing_extensions import Final, Literal
from ._imaging import _PixelAccessor
from .ImageFile import ImageFile
enable_jpeg2k: Any
enable_jpeg2k: Incomplete
MAGIC: Final = b"icns"
HEADERSIZE: Final = 8
@@ -16,9 +16,9 @@ def read_mk(fobj, start_length, size): ...
def read_png_or_jpeg2000(fobj, start_length, size): ...
class IcnsFile:
SIZES: Any
dct: Any
fobj: Any
SIZES: Incomplete
dct: Incomplete
fobj: Incomplete
def __init__(self, fobj) -> None: ...
def itersizes(self): ...
def bestsize(self): ...
@@ -32,7 +32,7 @@ class IcnsImageFile(ImageFile):
def size(self): ...
@size.setter
def size(self, value) -> None: ...
best_size: Any
im: Any
mode: Any
best_size: Incomplete
im: Incomplete
mode: Incomplete
def load(self) -> _PixelAccessor: ...

View File

@@ -1,13 +1,14 @@
from typing import Any, ClassVar
from _typeshed import Incomplete
from typing import ClassVar
from typing_extensions import Literal
from ._imaging import _PixelAccessor
from .ImageFile import ImageFile
class IcoFile:
buf: Any
entry: Any
nb_items: Any
buf: Incomplete
entry: Incomplete
nb_items: Incomplete
def __init__(self, buf): ...
def sizes(self): ...
def getentryindex(self, size, bpp: bool = False): ...
@@ -21,7 +22,7 @@ class IcoImageFile(ImageFile):
def size(self): ...
@size.setter
def size(self, value) -> None: ...
im: Any
mode: Any
im: Incomplete
mode: Incomplete
def load(self) -> _PixelAccessor: ...
def load_seek(self) -> None: ...

View File

@@ -1,4 +1,5 @@
from typing import Any, ClassVar
from _typeshed import Incomplete
from typing import ClassVar
from typing_extensions import Literal
from .ImageFile import ImageFile
@@ -12,9 +13,9 @@ NAME: str
SCALE: str
SIZE: str
MODE: str
TAGS: Any
OPEN: Any
split: Any
TAGS: Incomplete
OPEN: Incomplete
split: Incomplete
def number(s): ...
@@ -25,10 +26,10 @@ class ImImageFile(ImageFile):
def n_frames(self): ...
@property
def is_animated(self): ...
frame: Any
fp: Any
tile: Any
frame: Incomplete
fp: Incomplete
tile: Incomplete
def seek(self, frame) -> None: ...
def tell(self): ...
SAVE: Any
SAVE: Incomplete

View File

@@ -169,10 +169,10 @@ _ImageState: TypeAlias = tuple[dict[str, Any], str, tuple[int, int], Any, bytes]
class Image:
format: ClassVar[str | None]
format_description: ClassVar[str | None]
im: Any
im: Incomplete
mode: _Mode
palette: Any
info: dict[Any, Any]
palette: Incomplete
info: dict[Incomplete, Incomplete]
readonly: int
pyaccess: PyAccess | None
is_animated: bool # not present on all Image objects

View File

@@ -1,14 +1,13 @@
import sys
from _typeshed import Incomplete, Unused
from enum import IntEnum
from typing import Any
from typing_extensions import Literal
from .Image import ImagePointHandler
DESCRIPTION: str
VERSION: str
core: Any
core: Incomplete
class Intent(IntEnum):
PERCEPTUAL: int
@@ -30,17 +29,17 @@ DIRECTION_INPUT: Literal[Direction.INPUT]
DIRECTION_OUTPUT: Literal[Direction.OUTPUT]
DIRECTION_PROOF: Literal[Direction.PROOF]
FLAGS: Any
FLAGS: Incomplete
class ImageCmsProfile:
def __init__(self, profile) -> None: ...
def tobytes(self): ...
class ImageCmsTransform(ImagePointHandler):
transform: Any
input_mode: Any
output_mode: Any
output_profile: Any
transform: Incomplete
input_mode: Incomplete
output_mode: Incomplete
output_profile: Incomplete
def __init__(
self,
input,

View File

@@ -1,24 +1,23 @@
from _typeshed import Incomplete
from typing import Any
class Pen:
color: Any
width: Any
color: Incomplete
width: Incomplete
def __init__(self, color, width: int = 1, opacity: int = 255) -> None: ...
class Brush:
color: Any
color: Incomplete
def __init__(self, color, opacity: int = 255) -> None: ...
class Font:
color: Any
font: Any
color: Incomplete
font: Incomplete
def __init__(self, color, file, size: int = 12) -> None: ...
class Draw:
draw: Any
image: Any
transform: Any
draw: Incomplete
image: Incomplete
transform: Incomplete
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) -> None: ...

View File

@@ -1,30 +1,30 @@
from _typeshed import Incomplete, Unused
from typing import Any, NoReturn
from typing import NoReturn
from typing_extensions import Self
from ._imaging import _PixelAccessor
from .Image import Image
MAXBLOCK: int
SAFEBLOCK: Any
SAFEBLOCK: Incomplete
LOAD_TRUNCATED_IMAGES: bool
ERRORS: Any
ERRORS: Incomplete
def raise_oserror(error) -> NoReturn: ...
class ImageFile(Image):
custom_mimetype: Any
custom_mimetype: Incomplete
tile: list[Incomplete] | None
readonly: int
decoderconfig: Any
decodermaxblock: Any
fp: Any
filename: Any
decoderconfig: Incomplete
decodermaxblock: Incomplete
fp: Incomplete
filename: Incomplete
def __init__(self, fp: Incomplete | None = None, filename: Incomplete | None = None) -> None: ...
def get_format_mimetype(self): ...
def verify(self) -> None: ...
map: Any
im: Any
map: Incomplete
im: Incomplete
def load(self) -> _PixelAccessor: ...
def load_prepare(self) -> None: ...
def load_end(self) -> None: ...
@@ -40,7 +40,7 @@ class Parser:
offset: int
finished: bool
def reset(self) -> None: ...
decode: Any
decode: Incomplete
def feed(self, data) -> None: ...
def __enter__(self) -> Self: ...
def __exit__(self, *args: Unused) -> None: ...
@@ -66,12 +66,12 @@ class PyCodec:
def setimage(self, im, extents: Incomplete | None = None) -> None: ...
class PyDecoder:
im: Any
state: Any
fd: Any
mode: Any
im: Incomplete
state: Incomplete
fd: Incomplete
mode: Incomplete
def __init__(self, mode, *args) -> None: ...
args: Any
args: Incomplete
def init(self, args) -> None: ...
@property
def pulls_fd(self): ...

View File

@@ -1,6 +1,5 @@
from _typeshed import Incomplete
from collections.abc import Callable, Iterable, Sequence
from typing import Any
from typing_extensions import Literal, Self, TypeAlias
from .Image import Image
@@ -116,7 +115,7 @@ class Color3DLUT(MultibandFilter):
size: list[int]
channels: int
mode: str | None
table: Any
table: Incomplete
def __init__(self, size: int | Iterable[int], table, channels: int = 3, target_mode: str | None = None, **kwargs) -> None: ...
@classmethod
def generate(

View File

@@ -1,8 +1,7 @@
from _typeshed import Incomplete
from typing import Any
class _Operand:
im: Any
im: Incomplete
def __init__(self, im) -> None: ...
def apply(self, op, im1, im2: Incomplete | None = None, mode: Incomplete | None = None): ...
def __bool__(self) -> bool: ...
@@ -45,6 +44,6 @@ def imagemath_min(self, other): ...
def imagemath_max(self, other): ...
def imagemath_convert(self, mode): ...
ops: Any
ops: Incomplete
def eval(expression, _dict={}, **kw): ...

View File

@@ -1,10 +1,10 @@
from typing import Any
from _typeshed import Incomplete
class ModeDescriptor:
mode: Any
bands: Any
basemode: Any
basetype: Any
mode: Incomplete
bands: Incomplete
basemode: Incomplete
basetype: Incomplete
def __init__(self, mode, bands, basemode, basetype, typestr) -> None: ...
def getmode(mode): ...

View File

@@ -1,14 +1,13 @@
from _typeshed import Incomplete
from typing import Any
from .Image import Image
class ImagePalette:
mode: Any
rawmode: Any
palette: Any
colors: Any
dirty: Any
mode: Incomplete
rawmode: Incomplete
palette: Incomplete
colors: Incomplete
dirty: Incomplete
def __init__(self, mode: str = "RGB", palette: Incomplete | None = None, size: int = 0) -> None: ...
def copy(self) -> ImagePalette: ...
def getdata(self): ...

View File

@@ -1,3 +1,4 @@
from _typeshed import Incomplete
from typing import Any
from typing_extensions import Literal, TypeAlias
@@ -9,9 +10,9 @@ from .Image import Image
_QImage: TypeAlias = Any
_QPixmap: TypeAlias = Any
qt_versions: Any
qt_versions: Incomplete
qt_is_installed: bool
qt_version: Any
qt_version: Incomplete
def rgb(r: int, g: int, b: int, a: int = 255) -> int: ...
def fromqimage(im: ImageQt | _QImage) -> Image: ...

View File

@@ -1,9 +1,8 @@
from _typeshed import Incomplete
from typing import Any
class Iterator:
im: Any
position: Any
im: Incomplete
position: Incomplete
def __init__(self, im) -> None: ...
def __getitem__(self, ix): ...
def __iter__(self): ...

View File

@@ -1,5 +1,4 @@
from _typeshed import Incomplete
from typing import Any
from typing_extensions import Literal
def register(viewer, order: int = 1) -> None: ...
@@ -7,8 +6,8 @@ def show(image, title: Incomplete | None = None, **options): ...
class Viewer:
def show(self, image, **options): ...
format: Any
options: Any
format: Incomplete
options: Incomplete
def get_format(self, image): ...
def get_command(self, file, **options) -> None: ...
def save_image(self, image): ...
@@ -17,18 +16,18 @@ class Viewer:
class WindowsViewer(Viewer):
format: str
options: Any
options: Incomplete
def get_command(self, file, **options): ...
class MacViewer(Viewer):
format: str
options: Any
options: Incomplete
def get_command(self, file, **options): ...
def show_file(self, path: Incomplete | None = None, **options): ...
class UnixViewer(Viewer):
format: str
options: Any
options: Incomplete
def get_command(self, file, **options): ...
def show_file(self, path: Incomplete | None = None, **options): ...

View File

@@ -1,9 +1,8 @@
from _typeshed import Incomplete
from typing import Any
class Stat:
h: Any
bands: Any
h: Incomplete
bands: Incomplete
def __init__(self, image_or_list, mask: Incomplete | None = None) -> None: ...
def __getattr__(self, id: str): ...

View File

@@ -1,21 +1,21 @@
from typing import Any
from _typeshed import Incomplete
from .Image import ImageTransformHandler
class Transform(ImageTransformHandler):
data: Any
data: Incomplete
def __init__(self, data) -> None: ...
def getdata(self): ...
def transform(self, size, image, **options): ...
class AffineTransform(Transform):
method: Any
method: Incomplete
class ExtentTransform(Transform):
method: Any
method: Incomplete
class QuadTransform(Transform):
method: Any
method: Incomplete
class MeshTransform(Transform):
method: Any
method: Incomplete

View File

@@ -1,20 +1,19 @@
from _typeshed import Incomplete
from typing import Any
class HDC:
dc: Any
dc: Incomplete
def __init__(self, dc) -> None: ...
def __int__(self) -> int: ...
class HWND:
wnd: Any
wnd: Incomplete
def __init__(self, wnd) -> None: ...
def __int__(self) -> int: ...
class Dib:
image: Any
mode: Any
size: Any
image: Incomplete
mode: Incomplete
size: Incomplete
def __init__(self, image, size: Incomplete | None = None) -> None: ...
def expose(self, handle): ...
def draw(self, handle, dst, src: Incomplete | None = None): ...
@@ -24,7 +23,7 @@ class Dib:
def tobytes(self): ...
class Window:
hwnd: Any
hwnd: Incomplete
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: ...
@@ -34,6 +33,6 @@ class Window:
def mainloop(self) -> None: ...
class ImageWindow(Window):
image: Any
image: Incomplete
def __init__(self, image, title: str = "PIL") -> None: ...
def ui_handle_repair(self, dc, x0, y0, x1, y1) -> None: ...

View File

@@ -1,9 +1,10 @@
from typing import Any, ClassVar
from _typeshed import Incomplete
from typing import ClassVar
from typing_extensions import Literal
from .ImageFile import ImageFile
field: Any
field: Incomplete
class ImtImageFile(ImageFile):
format: ClassVar[Literal["IMT"]]

View File

@@ -1,11 +1,12 @@
from typing import Any, ClassVar
from _typeshed import Incomplete
from typing import ClassVar
from typing_extensions import Literal
from ._imaging import _PixelAccessor
from .ImageFile import ImageFile
COMPRESSION: Any
PAD: Any
COMPRESSION: Incomplete
PAD: Incomplete
def i(c): ...
def dump(c) -> None: ...
@@ -15,7 +16,7 @@ class IptcImageFile(ImageFile):
format_description: ClassVar[str]
def getint(self, key): ...
def field(self): ...
im: Any
im: Incomplete
def load(self) -> _PixelAccessor: ...
def getiptcinfo(im): ...

View File

@@ -1,5 +1,5 @@
from _typeshed import Incomplete
from typing import Any, ClassVar
from typing import ClassVar
from typing_extensions import Literal
from ._imaging import _PixelAccessor
@@ -19,6 +19,6 @@ class BoxReader:
class Jpeg2KImageFile(ImageFile):
format: ClassVar[Literal["JPEG2000"]]
format_description: ClassVar[str]
reduce: Any
tile: Any
reduce: Incomplete
tile: Incomplete
def load(self) -> _PixelAccessor: ...

View File

@@ -1,5 +1,5 @@
from _typeshed import Incomplete
from typing import Any, ClassVar
from typing import ClassVar
from typing_extensions import Literal
from .ImageFile import ImageFile
@@ -10,23 +10,23 @@ def COM(self, marker) -> None: ...
def SOF(self, marker) -> None: ...
def DQT(self, marker) -> None: ...
MARKER: Any
MARKER: Incomplete
class JpegImageFile(ImageFile):
format: ClassVar[Literal["JPEG", "MPO"]]
format_description: ClassVar[str]
def load_read(self, read_bytes): ...
mode: Any
tile: Any
decoderconfig: Any
mode: Incomplete
tile: Incomplete
decoderconfig: Incomplete
def draft(self, mode, size): ...
im: Any
im: Incomplete
def load_djpeg(self) -> None: ...
def getxmp(self): ...
RAWMODE: Any
zigzag_index: Any
samplings: Any
RAWMODE: Incomplete
zigzag_index: Incomplete
samplings: Incomplete
def convert_dict_qtables(qtables): ...
def get_sampling(im): ...

View File

@@ -1,3 +1,3 @@
from typing import Any
from _typeshed import Incomplete
presets: Any
presets: Incomplete

View File

@@ -1,10 +1,11 @@
from typing import Any, ClassVar
from _typeshed import Incomplete
from typing import ClassVar
from typing_extensions import Literal
from .ImageFile import ImageFile
class BitStream:
fp: Any
fp: Incomplete
bits: int
bitbuffer: int
def __init__(self, fp) -> None: ...

View File

@@ -1,5 +1,5 @@
from _typeshed import Incomplete
from typing import Any, ClassVar
from typing import ClassVar
from typing_extensions import Literal
from .JpegImagePlugin import JpegImageFile
@@ -7,9 +7,9 @@ from .JpegImagePlugin import JpegImageFile
class MpoImageFile(JpegImageFile):
format: ClassVar[Literal["MPO"]]
def load_seek(self, pos) -> None: ...
fp: Any
offset: Any
tile: Any
fp: Incomplete
offset: Incomplete
tile: Incomplete
def seek(self, frame) -> None: ...
def tell(self): ...
@staticmethod

View File

@@ -1,7 +1,7 @@
from typing import Any
from _typeshed import Incomplete
class PaletteFile:
rawmode: str
palette: Any
palette: Incomplete
def __init__(self, fp) -> None: ...
def getpalette(self): ...

View File

@@ -1,5 +1,5 @@
from typing import Any
from _typeshed import Incomplete
def build_prototype_image(): ...
Palm8BitColormapImage: Any
Palm8BitColormapImage: Incomplete

View File

@@ -1,4 +1,5 @@
from typing import Any, ClassVar
from _typeshed import Incomplete
from typing import ClassVar
from typing_extensions import Literal
from .ImageFile import ImageFile
@@ -6,5 +7,5 @@ from .ImageFile import ImageFile
class PcdImageFile(ImageFile):
format: ClassVar[Literal["PCD"]]
format_description: ClassVar[str]
im: Any
im: Incomplete
def load_end(self) -> None: ...

View File

@@ -1,25 +1,25 @@
from typing import Any
from _typeshed import Incomplete
from .FontFile import FontFile
PCF_MAGIC: int
PCF_PROPERTIES: Any
PCF_ACCELERATORS: Any
PCF_METRICS: Any
PCF_BITMAPS: Any
PCF_INK_METRICS: Any
PCF_BDF_ENCODINGS: Any
PCF_SWIDTHS: Any
PCF_GLYPH_NAMES: Any
PCF_BDF_ACCELERATORS: Any
BYTES_PER_ROW: Any
PCF_PROPERTIES: Incomplete
PCF_ACCELERATORS: Incomplete
PCF_METRICS: Incomplete
PCF_BITMAPS: Incomplete
PCF_INK_METRICS: Incomplete
PCF_BDF_ENCODINGS: Incomplete
PCF_SWIDTHS: Incomplete
PCF_GLYPH_NAMES: Incomplete
PCF_BDF_ACCELERATORS: Incomplete
BYTES_PER_ROW: Incomplete
def sz(s, o): ...
class PcfFontFile(FontFile):
name: str
charset_encoding: Any
toc: Any
fp: Any
info: Any
charset_encoding: Incomplete
toc: Incomplete
fp: Incomplete
info: Incomplete
def __init__(self, fp, charset_encoding: str = "iso8859-1") -> None: ...

View File

@@ -1,4 +1,5 @@
from typing import Any, ClassVar
from _typeshed import Incomplete
from typing import ClassVar
from typing_extensions import Literal
from .ImageFile import ImageFile
@@ -7,4 +8,4 @@ class PcxImageFile(ImageFile):
format: ClassVar[Literal["PCX", "DCX"]]
format_description: ClassVar[str]
SAVE: Any
SAVE: Incomplete

View File

@@ -23,9 +23,9 @@ class IndirectReference:
class IndirectObjectDef(IndirectReference): ...
class XrefTable:
existing_entries: Any
new_entries: Any
deleted_entries: Any
existing_entries: Incomplete
new_entries: Incomplete
deleted_entries: Incomplete
reading_finished: bool
def __init__(self) -> None: ...
def __setitem__(self, key, value) -> None: ...
@@ -37,14 +37,14 @@ class XrefTable:
def write(self, f): ...
class PdfName:
name: Any
name: Incomplete
def __init__(self, name) -> None: ...
def name_as_str(self): ...
def __eq__(self, other): ...
def __hash__(self) -> int: ...
@classmethod
def from_pdf_stream(cls, data): ...
allowed_chars: Any
allowed_chars: Incomplete
def __bytes__(self) -> bytes: ...
class PdfArray(list[Any]):
@@ -56,38 +56,38 @@ class PdfDict(collections.UserDict[bytes, Any]):
def __bytes__(self) -> bytes: ...
class PdfBinary:
data: Any
data: Incomplete
def __init__(self, data) -> None: ...
def __bytes__(self) -> bytes: ...
class PdfStream:
dictionary: Any
buf: Any
dictionary: Incomplete
buf: Incomplete
def __init__(self, dictionary, buf) -> None: ...
def decode(self): ...
def pdf_repr(x: Any) -> bytes: ...
def pdf_repr(x: Incomplete) -> bytes: ...
class PdfParser:
filename: Any
buf: Any
f: Any
start_offset: Any
filename: Incomplete
buf: Incomplete
f: Incomplete
start_offset: Incomplete
should_close_buf: bool
should_close_file: bool
cached_objects: Any
cached_objects: Incomplete
file_size_total: int
root: Any
root_ref: Any
info: Any
info_ref: Any
page_tree_root: Any
pages: Any
orig_pages: Any
pages_ref: Any
last_xref_section_offset: Any
trailer_dict: Any
xref_table: Any
root: Incomplete
root_ref: Incomplete
info: Incomplete
info_ref: Incomplete
page_tree_root: Incomplete
pages: Incomplete
orig_pages: Incomplete
pages_ref: Incomplete
last_xref_section_offset: Incomplete
trailer_dict: Incomplete
xref_table: Incomplete
def __init__(
self,
filename: Incomplete | None = None,
@@ -114,55 +114,55 @@ class PdfParser:
def del_root(self) -> None: ...
@staticmethod
def get_buf_from_file(f): ...
file_size_this: Any
file_size_this: Incomplete
def read_pdf_info(self) -> None: ...
def next_object_id(self, offset: Incomplete | None = None): ...
delimiter: bytes
delimiter_or_ws: bytes
whitespace: bytes
whitespace_or_hex: bytes
whitespace_optional: Any
whitespace_mandatory: Any
whitespace_optional: Incomplete
whitespace_mandatory: Incomplete
whitespace_optional_no_nl: bytes
newline_only: bytes
newline: Any
re_trailer_end: Any
re_trailer_prev: Any
newline: Incomplete
re_trailer_end: Incomplete
re_trailer_prev: Incomplete
def read_trailer(self) -> None: ...
def read_prev_trailer(self, xref_section_offset) -> None: ...
re_whitespace_optional: Any
re_name: Any
re_dict_start: Any
re_dict_end: Any
re_whitespace_optional: Incomplete
re_name: Incomplete
re_dict_start: Incomplete
re_dict_end: Incomplete
@classmethod
def interpret_trailer(cls, trailer_data): ...
re_hashes_in_name: Any
re_hashes_in_name: Incomplete
@classmethod
def interpret_name(cls, raw, as_text: bool = False): ...
re_null: Any
re_true: Any
re_false: Any
re_int: Any
re_real: Any
re_array_start: Any
re_array_end: Any
re_string_hex: Any
re_string_lit: Any
re_indirect_reference: Any
re_indirect_def_start: Any
re_indirect_def_end: Any
re_comment: Any
re_stream_start: Any
re_stream_end: Any
re_null: Incomplete
re_true: Incomplete
re_false: Incomplete
re_int: Incomplete
re_real: Incomplete
re_array_start: Incomplete
re_array_end: Incomplete
re_string_hex: Incomplete
re_string_lit: Incomplete
re_indirect_reference: Incomplete
re_indirect_def_start: Incomplete
re_indirect_def_end: Incomplete
re_comment: Incomplete
re_stream_start: Incomplete
re_stream_end: Incomplete
@classmethod
def get_value(cls, data, offset, expect_indirect: Incomplete | None = None, max_nesting: int = -1): ...
re_lit_str_token: Any
escaped_chars: Any
re_lit_str_token: Incomplete
escaped_chars: Incomplete
@classmethod
def get_literal_string(cls, data, offset): ...
re_xref_section_start: Any
re_xref_subsection_start: Any
re_xref_entry: Any
re_xref_section_start: Incomplete
re_xref_subsection_start: Incomplete
re_xref_entry: Incomplete
def read_xref_table(self, xref_section_offset): ...
def read_indirect(self, ref, max_nesting: int = -1): ...
def linearize_page_tree(self, node: Incomplete | None = None): ...

View File

@@ -1,14 +1,14 @@
from _typeshed import Incomplete, Unused
from enum import IntEnum
from typing import Any, ClassVar
from typing import ClassVar
from typing_extensions import Literal
from ._binary import o8 as o8
from .ImageFile import ImageFile
is_cid: Any
MAX_TEXT_CHUNK: Any
MAX_TEXT_MEMORY: Any
is_cid: Incomplete
MAX_TEXT_CHUNK: Incomplete
MAX_TEXT_MEMORY: Incomplete
class Disposal(IntEnum):
OP_NONE: int
@@ -27,8 +27,8 @@ APNG_BLEND_OP_SOURCE: Literal[Blend.OP_SOURCE]
APNG_BLEND_OP_OVER: Literal[Blend.OP_OVER]
class ChunkStream:
fp: Any
queue: Any
fp: Incomplete
queue: Incomplete
def __init__(self, fp) -> None: ...
def read(self): ...
def __enter__(self): ...
@@ -41,28 +41,28 @@ class ChunkStream:
def verify(self, endchunk: bytes = b"IEND"): ...
class iTXt(str):
lang: Any
tkey: Any
lang: Incomplete
tkey: Incomplete
@staticmethod
def __new__(cls, text, lang: Incomplete | None = None, tkey: Incomplete | None = None): ...
class PngInfo:
chunks: Any
chunks: Incomplete
def __init__(self) -> None: ...
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
im_text: Any
im_size: Any
im_mode: Any
im_tile: Any
im_palette: Any
im_custom_mimetype: Any
im_n_frames: Any
rewind_state: Any
im_info: Incomplete
im_text: Incomplete
im_size: Incomplete
im_mode: Incomplete
im_tile: Incomplete
im_palette: Incomplete
im_custom_mimetype: Incomplete
im_n_frames: Incomplete
rewind_state: Incomplete
text_memory: int
def __init__(self, fp) -> None: ...
def check_text_memory(self, chunklen) -> None: ...
@@ -70,7 +70,7 @@ class PngStream(ChunkStream):
def rewind(self) -> None: ...
def chunk_iCCP(self, pos, length): ...
def chunk_IHDR(self, pos, length): ...
im_idat: Any
im_idat: Incomplete
def chunk_IDAT(self, pos, length) -> None: ...
def chunk_IEND(self, pos, length) -> None: ...
def chunk_PLTE(self, pos, length): ...
@@ -92,15 +92,15 @@ class PngImageFile(ImageFile):
format_description: ClassVar[str]
@property
def text(self): ...
fp: Any
fp: Incomplete
def verify(self) -> None: ...
def seek(self, frame) -> None: ...
def tell(self): ...
decoderconfig: Any
decoderconfig: Incomplete
def load_prepare(self) -> None: ...
def load_read(self, read_bytes): ...
png: Any
im: Any
png: Incomplete
im: Incomplete
def load_end(self) -> None: ...
def getexif(self): ...
def getxmp(self): ...
@@ -108,15 +108,15 @@ class PngImageFile(ImageFile):
def putchunk(fp, cid, *data) -> None: ...
class _idat:
fp: Any
chunk: Any
fp: Incomplete
chunk: Incomplete
def __init__(self, fp, chunk) -> None: ...
def write(self, data) -> None: ...
class _fdat:
fp: Any
chunk: Any
seq_num: Any
fp: Incomplete
chunk: Incomplete
seq_num: Incomplete
def __init__(self, fp, chunk, seq_num) -> None: ...
def write(self, data) -> None: ...

View File

@@ -1,10 +1,11 @@
from typing import Any, ClassVar
from _typeshed import Incomplete
from typing import ClassVar
from typing_extensions import Literal
from .ImageFile import ImageFile, PyDecoder
b_whitespace: bytes
MODES: Any
MODES: Incomplete
class PpmImageFile(ImageFile):
format: ClassVar[Literal["PPM"]]

View File

@@ -1,18 +1,19 @@
from typing import Any, ClassVar
from _typeshed import Incomplete
from typing import ClassVar
from typing_extensions import Literal
from .ImageFile import ImageFile
MODES: Any
MODES: Incomplete
class PsdImageFile(ImageFile):
format: ClassVar[Literal["PSD"]]
format_description: ClassVar[str]
mode: Any
tile: Any
frame: Any
fp: Any
mode: Incomplete
tile: Incomplete
frame: Incomplete
fp: Incomplete
def seek(self, layer): ...
def tell(self): ...
im: Any
im: Incomplete
def load_prepare(self) -> None: ...

View File

@@ -1,19 +1,19 @@
from typing import Any
from _typeshed import Incomplete
from PIL._imaging import _PixelAccessor
ffi: Any
ffi: Incomplete
class PyAccess(_PixelAccessor):
readonly: Any
image8: Any
image32: Any
image: Any
readonly: Incomplete
image8: Incomplete
image32: Incomplete
image: Incomplete
def __init__(self, img, readonly: bool = False) -> None: ...
def __setitem__(self, xy: tuple[int, int], color) -> None: ...
def __getitem__(self, xy: tuple[int, int]) -> Any: ...
def __getitem__(self, xy: tuple[int, int]) -> Incomplete: ...
def putpixel(self, xy: tuple[int, int], color) -> None: ...
def getpixel(self, xy: tuple[int, int]) -> Any: ...
def getpixel(self, xy: tuple[int, int]) -> Incomplete: ...
def check_xy(self, xy: tuple[int, int]): ...
class _PyAccess32_2(PyAccess):
@@ -57,6 +57,6 @@ class _PyAccessF(PyAccess):
def get_pixel(self, x, y): ...
def set_pixel(self, x, y, color) -> None: ...
mode_map: Any
mode_map: Incomplete
def new(img, readonly: bool = False): ...

View File

@@ -1,9 +1,10 @@
from typing import Any, ClassVar
from _typeshed import Incomplete
from typing import ClassVar
from typing_extensions import Literal
from .ImageFile import ImageFile, PyDecoder
MODES: Any
MODES: Incomplete
class SgiImageFile(ImageFile):
format: ClassVar[Literal["SGI"]]

View File

@@ -1,12 +1,12 @@
from _typeshed import Incomplete
from typing import Any, ClassVar
from typing import ClassVar
from typing_extensions import Literal
from .ImageFile import ImageFile
def isInt(f: object) -> Literal[0, 1]: ...
iforms: Any
iforms: Incomplete
def isSpiderHeader(t): ...
def isSpiderImage(filename): ...
@@ -19,8 +19,8 @@ class SpiderImageFile(ImageFile):
@property
def is_animated(self): ...
def tell(self): ...
stkoffset: Any
fp: Any
stkoffset: Incomplete
fp: Incomplete
def seek(self, frame) -> None: ...
def convert2byte(self, depth: int = 255): ...
def tkPhotoImage(self): ...

View File

@@ -1,10 +1,9 @@
from _typeshed import Unused
from typing import Any
from _typeshed import Incomplete, Unused
from .ContainerIO import ContainerIO
class TarIO(ContainerIO):
fh: Any
fh: Incomplete
def __init__(self, tarfile, file) -> None: ...
def __enter__(self): ...
def __exit__(self, *args: Unused) -> None: ...

View File

@@ -1,12 +1,13 @@
from typing import Any, ClassVar
from _typeshed import Incomplete
from typing import ClassVar
from typing_extensions import Literal
from .ImageFile import ImageFile
MODES: Any
MODES: Incomplete
class TgaImageFile(ImageFile):
format: ClassVar[Literal["TGA"]]
format_description: ClassVar[str]
SAVE: Any
SAVE: Incomplete

View File

@@ -1,12 +1,12 @@
from _typeshed import Incomplete
from typing import Any, NamedTuple
from typing import NamedTuple
from typing_extensions import Final, Literal, TypeAlias
_TagType: TypeAlias = Literal[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 16]
_TagTuple: TypeAlias = tuple[str, _TagType, int] | tuple[str, _TagInfo, int, dict[str, int]]
class _TagInfo(NamedTuple):
value: Any
value: Incomplete
name: str
type: _TagType
length: int

View File

@@ -1,4 +1,5 @@
from typing import Any, ClassVar
from _typeshed import Incomplete
from typing import ClassVar
from typing_extensions import Literal, TypeAlias
from ._imaging import _PixelAccessor
@@ -12,7 +13,7 @@ class WebPImageFile(ImageFile):
format_description: ClassVar[str]
def getxmp(self) -> _XMP_Tags: ...
def seek(self, frame) -> None: ...
fp: Any
tile: Any
fp: Incomplete
tile: Incomplete
def load(self) -> _PixelAccessor: ...
def tell(self): ...

View File

@@ -1,6 +1,6 @@
import sys
from _typeshed import Incomplete
from typing import Any, ClassVar
from typing import ClassVar
from typing_extensions import Literal
from ._imaging import _PixelAccessor
@@ -10,7 +10,7 @@ def register_handler(handler) -> None: ...
if sys.platform == "win32":
class WmfHandler:
bbox: Any
bbox: Incomplete
def open(self, im) -> None: ...
def load(self, im): ...

View File

@@ -1,9 +1,10 @@
from typing import Any, ClassVar
from _typeshed import Incomplete
from typing import ClassVar
from typing_extensions import Literal
from .ImageFile import ImageFile
xbm_head: Any
xbm_head: Incomplete
class XbmImageFile(ImageFile):
format: ClassVar[Literal["XBM"]]

View File

@@ -1,9 +1,10 @@
from typing import Any, ClassVar
from _typeshed import Incomplete
from typing import ClassVar
from typing_extensions import Literal
from .ImageFile import ImageFile
xpm_head: Any
xpm_head: Incomplete
class XpmImageFile(ImageFile):
format: ClassVar[Literal["XPM"]]

View File

@@ -1,19 +1,18 @@
from _typeshed import Incomplete
from typing import Any
modules: Any
modules: Incomplete
def check_module(feature): ...
def version_module(feature): ...
def get_supported_modules(): ...
codecs: Any
codecs: Incomplete
def check_codec(feature): ...
def version_codec(feature): ...
def get_supported_codecs(): ...
features: Any
features: Incomplete
def check_feature(feature): ...
def version_feature(feature): ...