diff --git a/stubs/Pillow/METADATA.toml b/stubs/Pillow/METADATA.toml index da80f0078..549fe9f6e 100644 --- a/stubs/Pillow/METADATA.toml +++ b/stubs/Pillow/METADATA.toml @@ -1 +1 @@ -version = "8.3.*" +version = "9.0.*" diff --git a/stubs/Pillow/PIL/BlpImagePlugin.pyi b/stubs/Pillow/PIL/BlpImagePlugin.pyi index 3e004d9df..be0f72154 100644 --- a/stubs/Pillow/PIL/BlpImagePlugin.pyi +++ b/stubs/Pillow/PIL/BlpImagePlugin.pyi @@ -1,4 +1,5 @@ -from typing import Any +from typing import Any, ClassVar +from typing_extensions import Literal from .ImageFile import ImageFile, PyDecoder @@ -18,8 +19,8 @@ def decode_dxt5(data): ... class BLPFormatError(NotImplementedError): ... class BlpImageFile(ImageFile): - format: str - format_description: str + format: ClassVar[Literal["BLP"]] + format_description: ClassVar[str] class _BLPBaseDecoder(PyDecoder): magic: Any diff --git a/stubs/Pillow/PIL/BmpImagePlugin.pyi b/stubs/Pillow/PIL/BmpImagePlugin.pyi index c1712429e..3ebe58175 100644 --- a/stubs/Pillow/PIL/BmpImagePlugin.pyi +++ b/stubs/Pillow/PIL/BmpImagePlugin.pyi @@ -1,16 +1,16 @@ -from typing import Any +from typing import Any, ClassVar +from typing_extensions import Literal from .ImageFile import ImageFile BIT2MODE: Any class BmpImageFile(ImageFile): - format_description: str - format: str + format_description: ClassVar[str] + format: ClassVar[Literal["BMP", "DIB", "CUR"]] COMPRESSIONS: Any class DibImageFile(BmpImageFile): - format: str - format_description: str + format: ClassVar[Literal["DIB"]] SAVE: Any diff --git a/stubs/Pillow/PIL/BufrStubImagePlugin.pyi b/stubs/Pillow/PIL/BufrStubImagePlugin.pyi index 1fd49e1ba..812b4e6ff 100644 --- a/stubs/Pillow/PIL/BufrStubImagePlugin.pyi +++ b/stubs/Pillow/PIL/BufrStubImagePlugin.pyi @@ -1,7 +1,10 @@ +from typing import ClassVar +from typing_extensions import Literal + from .ImageFile import StubImageFile def register_handler(handler) -> None: ... class BufrStubImageFile(StubImageFile): - format: str - format_description: str + format: ClassVar[Literal["BUFR"]] + format_description: ClassVar[str] diff --git a/stubs/Pillow/PIL/CurImagePlugin.pyi b/stubs/Pillow/PIL/CurImagePlugin.pyi index a6085cb8b..09d50204f 100644 --- a/stubs/Pillow/PIL/CurImagePlugin.pyi +++ b/stubs/Pillow/PIL/CurImagePlugin.pyi @@ -1,5 +1,7 @@ +from typing import ClassVar +from typing_extensions import Literal + from .BmpImagePlugin import BmpImageFile class CurImageFile(BmpImageFile): - format: str - format_description: str + format: ClassVar[Literal["CUR"]] diff --git a/stubs/Pillow/PIL/DcxImagePlugin.pyi b/stubs/Pillow/PIL/DcxImagePlugin.pyi index 4b0389aae..f8f64a9fd 100644 --- a/stubs/Pillow/PIL/DcxImagePlugin.pyi +++ b/stubs/Pillow/PIL/DcxImagePlugin.pyi @@ -1,12 +1,12 @@ -from typing import Any +from typing import Any, ClassVar +from typing_extensions import Literal from .PcxImagePlugin import PcxImageFile MAGIC: int class DcxImageFile(PcxImageFile): - format: str - format_description: str + format: ClassVar[Literal["DCX"]] frame: Any fp: Any def seek(self, frame) -> None: ... diff --git a/stubs/Pillow/PIL/DdsImagePlugin.pyi b/stubs/Pillow/PIL/DdsImagePlugin.pyi index 10974403b..19893d9b6 100644 --- a/stubs/Pillow/PIL/DdsImagePlugin.pyi +++ b/stubs/Pillow/PIL/DdsImagePlugin.pyi @@ -1,3 +1,4 @@ +from typing import ClassVar from typing_extensions import Literal from .ImageFile import ImageFile @@ -65,6 +66,6 @@ DXGI_FORMAT_BC7_UNORM: int DXGI_FORMAT_BC7_UNORM_SRGB: int class DdsImageFile(ImageFile): - format: str - format_description: str + format: ClassVar[Literal["DDS"]] + format_description: ClassVar[str] def load_seek(self, pos) -> None: ... diff --git a/stubs/Pillow/PIL/EpsImagePlugin.pyi b/stubs/Pillow/PIL/EpsImagePlugin.pyi index 741f03ec8..7e76e8681 100644 --- a/stubs/Pillow/PIL/EpsImagePlugin.pyi +++ b/stubs/Pillow/PIL/EpsImagePlugin.pyi @@ -1,4 +1,5 @@ -from typing import Any +from typing import Any, ClassVar +from typing_extensions import Literal from .ImageFile import ImageFile @@ -7,7 +8,7 @@ field: Any gs_windows_binary: Any def has_ghostscript(): ... -def Ghostscript(tile, size, fp, scale: int = ...): ... +def Ghostscript(tile, size, fp, scale: int = ..., transparency: bool = ...): ... class PSFile: fp: Any @@ -17,11 +18,11 @@ class PSFile: def readline(self): ... class EpsImageFile(ImageFile): - format: str - format_description: str + format: ClassVar[Literal["EPS"]] + format_description: ClassVar[str] mode_map: Any im: Any mode: Any tile: Any - def load(self, scale: int = ...) -> None: ... + def load(self, scale: int = ..., transparency: bool = ...) -> None: ... def load_seek(self, *args, **kwargs) -> None: ... diff --git a/stubs/Pillow/PIL/FitsStubImagePlugin.pyi b/stubs/Pillow/PIL/FitsStubImagePlugin.pyi index ec94b35e3..cdd63750d 100644 --- a/stubs/Pillow/PIL/FitsStubImagePlugin.pyi +++ b/stubs/Pillow/PIL/FitsStubImagePlugin.pyi @@ -1,7 +1,10 @@ +from typing import ClassVar +from typing_extensions import Literal + from .ImageFile import StubImageFile def register_handler(handler) -> None: ... class FITSStubImageFile(StubImageFile): - format: str - format_description: str + format: ClassVar[Literal["FITS"]] + format_description: ClassVar[str] diff --git a/stubs/Pillow/PIL/FliImagePlugin.pyi b/stubs/Pillow/PIL/FliImagePlugin.pyi index 11f57d49d..9859378fb 100644 --- a/stubs/Pillow/PIL/FliImagePlugin.pyi +++ b/stubs/Pillow/PIL/FliImagePlugin.pyi @@ -1,7 +1,10 @@ +from typing import ClassVar +from typing_extensions import Literal + from .ImageFile import ImageFile class FliImageFile(ImageFile): - format: str - format_description: str + format: ClassVar[Literal["FLI"]] + format_description: ClassVar[str] def seek(self, frame) -> None: ... def tell(self): ... diff --git a/stubs/Pillow/PIL/FpxImagePlugin.pyi b/stubs/Pillow/PIL/FpxImagePlugin.pyi index 0f88b6639..069cb6b20 100644 --- a/stubs/Pillow/PIL/FpxImagePlugin.pyi +++ b/stubs/Pillow/PIL/FpxImagePlugin.pyi @@ -1,11 +1,12 @@ -from typing import Any +from typing import Any, ClassVar +from typing_extensions import Literal from .ImageFile import ImageFile MODES: Any class FpxImageFile(ImageFile): - format: str - format_description: str + format: ClassVar[Literal["FPX"]] + format_description: ClassVar[str] fp: Any def load(self): ... diff --git a/stubs/Pillow/PIL/FtexImagePlugin.pyi b/stubs/Pillow/PIL/FtexImagePlugin.pyi index b123ffe2c..3205880ef 100644 --- a/stubs/Pillow/PIL/FtexImagePlugin.pyi +++ b/stubs/Pillow/PIL/FtexImagePlugin.pyi @@ -1,3 +1,6 @@ +from typing import ClassVar +from typing_extensions import Literal + from .ImageFile import ImageFile MAGIC: bytes @@ -5,6 +8,6 @@ FORMAT_DXT1: int FORMAT_UNCOMPRESSED: int class FtexImageFile(ImageFile): - format: str - format_description: str + format: ClassVar[Literal["FTEX"]] + format_description: ClassVar[str] def load_seek(self, pos) -> None: ... diff --git a/stubs/Pillow/PIL/GbrImagePlugin.pyi b/stubs/Pillow/PIL/GbrImagePlugin.pyi index 070d87d68..b5ede10c8 100644 --- a/stubs/Pillow/PIL/GbrImagePlugin.pyi +++ b/stubs/Pillow/PIL/GbrImagePlugin.pyi @@ -1,9 +1,10 @@ -from typing import Any +from typing import Any, ClassVar +from typing_extensions import Literal from .ImageFile import ImageFile class GbrImageFile(ImageFile): - format: str - format_description: str + format: ClassVar[Literal["GBR"]] + format_description: ClassVar[str] im: Any def load(self) -> None: ... diff --git a/stubs/Pillow/PIL/GdImageFile.pyi b/stubs/Pillow/PIL/GdImageFile.pyi index 185d27b5d..a50f3f3c3 100644 --- a/stubs/Pillow/PIL/GdImageFile.pyi +++ b/stubs/Pillow/PIL/GdImageFile.pyi @@ -1,7 +1,10 @@ +from typing import ClassVar +from typing_extensions import Literal + from .ImageFile import ImageFile class GdImageFile(ImageFile): - format: str - format_description: str + format: ClassVar[Literal["GD"]] + format_description: ClassVar[str] def open(fp, mode: str = ...): ... diff --git a/stubs/Pillow/PIL/GifImagePlugin.pyi b/stubs/Pillow/PIL/GifImagePlugin.pyi index 47827071f..ff064cc50 100644 --- a/stubs/Pillow/PIL/GifImagePlugin.pyi +++ b/stubs/Pillow/PIL/GifImagePlugin.pyi @@ -1,10 +1,11 @@ -from typing import Any +from typing import Any, ClassVar +from typing_extensions import Literal from .ImageFile import ImageFile class GifImageFile(ImageFile): - format: str - format_description: str + format: ClassVar[Literal["GIF"]] + format_description: ClassVar[str] global_palette: Any def data(self): ... @property diff --git a/stubs/Pillow/PIL/GribStubImagePlugin.pyi b/stubs/Pillow/PIL/GribStubImagePlugin.pyi index 34c773a25..70ebaadc0 100644 --- a/stubs/Pillow/PIL/GribStubImagePlugin.pyi +++ b/stubs/Pillow/PIL/GribStubImagePlugin.pyi @@ -1,7 +1,10 @@ +from typing import ClassVar +from typing_extensions import Literal + from .ImageFile import StubImageFile def register_handler(handler) -> None: ... class GribStubImageFile(StubImageFile): - format: str - format_description: str + format: ClassVar[Literal["GRIB"]] + format_description: ClassVar[str] diff --git a/stubs/Pillow/PIL/Hdf5StubImagePlugin.pyi b/stubs/Pillow/PIL/Hdf5StubImagePlugin.pyi index b036a17ab..62760e41c 100644 --- a/stubs/Pillow/PIL/Hdf5StubImagePlugin.pyi +++ b/stubs/Pillow/PIL/Hdf5StubImagePlugin.pyi @@ -1,7 +1,10 @@ +from typing import ClassVar +from typing_extensions import Literal + from .ImageFile import StubImageFile def register_handler(handler) -> None: ... class HDF5StubImageFile(StubImageFile): - format: str - format_description: str + format: ClassVar[Literal["HDF5"]] + format_description: ClassVar[str] diff --git a/stubs/Pillow/PIL/IcnsImagePlugin.pyi b/stubs/Pillow/PIL/IcnsImagePlugin.pyi index 8606fcf13..42714148c 100644 --- a/stubs/Pillow/PIL/IcnsImagePlugin.pyi +++ b/stubs/Pillow/PIL/IcnsImagePlugin.pyi @@ -1,4 +1,5 @@ -from typing import Any +from typing import Any, ClassVar +from typing_extensions import Literal from .ImageFile import ImageFile @@ -22,8 +23,8 @@ class IcnsFile: def getimage(self, size: Any | None = ...): ... class IcnsImageFile(ImageFile): - format: str - format_description: str + format: ClassVar[Literal["ICNS"]] + format_description: ClassVar[str] @property def size(self): ... @size.setter diff --git a/stubs/Pillow/PIL/IcoImagePlugin.pyi b/stubs/Pillow/PIL/IcoImagePlugin.pyi index 536de0ade..f84ed76d5 100644 --- a/stubs/Pillow/PIL/IcoImagePlugin.pyi +++ b/stubs/Pillow/PIL/IcoImagePlugin.pyi @@ -1,4 +1,5 @@ -from typing import Any +from typing import Any, ClassVar +from typing_extensions import Literal from .ImageFile import ImageFile @@ -13,8 +14,8 @@ class IcoFile: def frame(self, idx): ... class IcoImageFile(ImageFile): - format: str - format_description: str + format: ClassVar[Literal["ICO"]] + format_description: ClassVar[str] @property def size(self): ... @size.setter diff --git a/stubs/Pillow/PIL/ImImagePlugin.pyi b/stubs/Pillow/PIL/ImImagePlugin.pyi index b6c3d84b6..09fd68419 100644 --- a/stubs/Pillow/PIL/ImImagePlugin.pyi +++ b/stubs/Pillow/PIL/ImImagePlugin.pyi @@ -1,4 +1,5 @@ -from typing import Any +from typing import Any, ClassVar +from typing_extensions import Literal from .ImageFile import ImageFile @@ -18,8 +19,8 @@ split: Any def number(s): ... class ImImageFile(ImageFile): - format: str - format_description: str + format: ClassVar[Literal["IM"]] + format_description: ClassVar[str] @property def n_frames(self): ... @property diff --git a/stubs/Pillow/PIL/Image.pyi b/stubs/Pillow/PIL/Image.pyi index ca3fb6ff0..6367237fd 100644 --- a/stubs/Pillow/PIL/Image.pyi +++ b/stubs/Pillow/PIL/Image.pyi @@ -1,7 +1,7 @@ from _typeshed import SupportsRead, SupportsWrite from collections.abc import Iterable, Iterator, MutableMapping from pathlib import Path -from typing import Any, Callable, Protocol, Sequence, SupportsBytes, Union +from typing import Any, Callable, ClassVar, Protocol, Sequence, SupportsBytes, Union from typing_extensions import Literal from ._imaging import ( @@ -102,8 +102,8 @@ class _E: _ImageState = tuple[dict[str, Any], str, tuple[int, int], Any, bytes] class Image: - format: Any - format_description: Any + format: ClassVar[str | None] + format_description: ClassVar[str | None] im: Any mode: str palette: Any @@ -196,7 +196,7 @@ class Image: **params: Any, ) -> None: ... def seek(self, frame: int) -> None: ... - def show(self, title: str | None = ..., command: str | None = ...) -> None: ... + def show(self, title: str | None = ...) -> None: ... def split(self) -> tuple[Image, ...]: ... def getchannel(self, channel: int | str) -> Image: ... def tell(self) -> int: ... diff --git a/stubs/Pillow/PIL/ImageDraw.pyi b/stubs/Pillow/PIL/ImageDraw.pyi index 15c71b99a..a5424aa82 100644 --- a/stubs/Pillow/PIL/ImageDraw.pyi +++ b/stubs/Pillow/PIL/ImageDraw.pyi @@ -30,7 +30,7 @@ class ImageDraw: width: float = ..., ) -> None: ... def point(self, xy: _XY, fill: _Ink | None = ...) -> None: ... - def polygon(self, xy: _XY, fill: _Ink | None = ..., outline: _Ink | None = ...) -> None: ... + def polygon(self, xy: _XY, fill: _Ink | None = ..., outline: _Ink | None = ..., width: float = ...) -> None: ... def regular_polygon( self, bounding_circle: tuple[float, float] | tuple[float, float, float] | list[int], diff --git a/stubs/Pillow/PIL/ImageFile.pyi b/stubs/Pillow/PIL/ImageFile.pyi index 745509b49..21bfde2e1 100644 --- a/stubs/Pillow/PIL/ImageFile.pyi +++ b/stubs/Pillow/PIL/ImageFile.pyi @@ -10,7 +10,6 @@ LOAD_TRUNCATED_IMAGES: bool ERRORS: Any def raise_oserror(error) -> NoReturn: ... -def raise_ioerror(error) -> NoReturn: ... class ImageFile(Image): custom_mimetype: Any diff --git a/stubs/Pillow/PIL/ImageShow.pyi b/stubs/Pillow/PIL/ImageShow.pyi index 27daf3fb4..917de83d7 100644 --- a/stubs/Pillow/PIL/ImageShow.pyi +++ b/stubs/Pillow/PIL/ImageShow.pyi @@ -1,4 +1,5 @@ from typing import Any +from typing_extensions import Literal def register(viewer, order: int = ...) -> None: ... def show(image, title: Any | None = ..., **options): ... @@ -30,8 +31,11 @@ class UnixViewer(Viewer): def get_command(self, file, **options): ... def show_file(self, file, **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, **options): ... + def get_command_ex(self, file, title: str | None = ..., **options): ... class GmDisplayViewer(UnixViewer): def get_command_ex(self, file, **options): ... diff --git a/stubs/Pillow/PIL/ImtImagePlugin.pyi b/stubs/Pillow/PIL/ImtImagePlugin.pyi index 567cbe42e..eadbef84f 100644 --- a/stubs/Pillow/PIL/ImtImagePlugin.pyi +++ b/stubs/Pillow/PIL/ImtImagePlugin.pyi @@ -1,9 +1,10 @@ -from typing import Any +from typing import Any, ClassVar +from typing_extensions import Literal from .ImageFile import ImageFile field: Any class ImtImageFile(ImageFile): - format: str - format_description: str + format: ClassVar[Literal["IMT"]] + format_description: ClassVar[str] diff --git a/stubs/Pillow/PIL/IptcImagePlugin.pyi b/stubs/Pillow/PIL/IptcImagePlugin.pyi index dac96b3b5..738caa991 100644 --- a/stubs/Pillow/PIL/IptcImagePlugin.pyi +++ b/stubs/Pillow/PIL/IptcImagePlugin.pyi @@ -1,4 +1,5 @@ -from typing import Any +from typing import Any, ClassVar +from typing_extensions import Literal from .ImageFile import ImageFile @@ -9,8 +10,8 @@ def i(c): ... def dump(c) -> None: ... class IptcImageFile(ImageFile): - format: str - format_description: str + format: ClassVar[Literal["IPTC"]] + format_description: ClassVar[str] def getint(self, key): ... def field(self): ... im: Any diff --git a/stubs/Pillow/PIL/Jpeg2KImagePlugin.pyi b/stubs/Pillow/PIL/Jpeg2KImagePlugin.pyi index 729078134..a37d618f9 100644 --- a/stubs/Pillow/PIL/Jpeg2KImagePlugin.pyi +++ b/stubs/Pillow/PIL/Jpeg2KImagePlugin.pyi @@ -1,10 +1,11 @@ -from typing import Any +from typing import Any, ClassVar +from typing_extensions import Literal from .ImageFile import ImageFile class Jpeg2KImageFile(ImageFile): - format: str - format_description: str + format: ClassVar[Literal["JPEG2000"]] + format_description: ClassVar[str] reduce: Any tile: Any def load(self): ... diff --git a/stubs/Pillow/PIL/JpegImagePlugin.pyi b/stubs/Pillow/PIL/JpegImagePlugin.pyi index 094110692..3e2fefd0a 100644 --- a/stubs/Pillow/PIL/JpegImagePlugin.pyi +++ b/stubs/Pillow/PIL/JpegImagePlugin.pyi @@ -1,4 +1,5 @@ -from typing import Any +from typing import Any, ClassVar +from typing_extensions import Literal from .ImageFile import ImageFile @@ -11,8 +12,8 @@ def DQT(self, marker) -> None: ... MARKER: Any class JpegImageFile(ImageFile): - format: str - format_description: str + format: ClassVar[Literal["JPEG", "MPO"]] + format_description: ClassVar[str] def load_read(self, read_bytes): ... mode: Any tile: Any diff --git a/stubs/Pillow/PIL/McIdasImagePlugin.pyi b/stubs/Pillow/PIL/McIdasImagePlugin.pyi index c492fe2ac..6e7be9913 100644 --- a/stubs/Pillow/PIL/McIdasImagePlugin.pyi +++ b/stubs/Pillow/PIL/McIdasImagePlugin.pyi @@ -1,5 +1,8 @@ +from typing import ClassVar +from typing_extensions import Literal + from .ImageFile import ImageFile class McIdasImageFile(ImageFile): - format: str - format_description: str + format: ClassVar[Literal["MCIDAS"]] + format_description: ClassVar[str] diff --git a/stubs/Pillow/PIL/MicImagePlugin.pyi b/stubs/Pillow/PIL/MicImagePlugin.pyi index 48fe3c750..b4fdc9d05 100644 --- a/stubs/Pillow/PIL/MicImagePlugin.pyi +++ b/stubs/Pillow/PIL/MicImagePlugin.pyi @@ -1,10 +1,10 @@ -from typing import Any +from typing import Any, ClassVar +from typing_extensions import Literal from .TiffImagePlugin import TiffImageFile class MicImageFile(TiffImageFile): - format: str - format_description: str + format: ClassVar[Literal["MIC"]] fp: Any frame: Any def seek(self, frame) -> None: ... diff --git a/stubs/Pillow/PIL/MpegImagePlugin.pyi b/stubs/Pillow/PIL/MpegImagePlugin.pyi index 4cadacb07..0f01f2b7b 100644 --- a/stubs/Pillow/PIL/MpegImagePlugin.pyi +++ b/stubs/Pillow/PIL/MpegImagePlugin.pyi @@ -1,4 +1,5 @@ -from typing import Any +from typing import Any, ClassVar +from typing_extensions import Literal from .ImageFile import ImageFile @@ -13,5 +14,5 @@ class BitStream: def read(self, bits): ... class MpegImageFile(ImageFile): - format: str - format_description: str + format: ClassVar[Literal["MPEG"]] + format_description: ClassVar[str] diff --git a/stubs/Pillow/PIL/MpoImagePlugin.pyi b/stubs/Pillow/PIL/MpoImagePlugin.pyi index b89dfa2e7..2096c466c 100644 --- a/stubs/Pillow/PIL/MpoImagePlugin.pyi +++ b/stubs/Pillow/PIL/MpoImagePlugin.pyi @@ -1,10 +1,10 @@ -from typing import Any +from typing import Any, ClassVar +from typing_extensions import Literal from .JpegImagePlugin import JpegImageFile class MpoImageFile(JpegImageFile): - format: str - format_description: str + format: ClassVar[Literal["MPO"]] def load_seek(self, pos) -> None: ... fp: Any offset: Any diff --git a/stubs/Pillow/PIL/MspImagePlugin.pyi b/stubs/Pillow/PIL/MspImagePlugin.pyi index 2f34b0559..bc3f25db4 100644 --- a/stubs/Pillow/PIL/MspImagePlugin.pyi +++ b/stubs/Pillow/PIL/MspImagePlugin.pyi @@ -1,8 +1,11 @@ +from typing import ClassVar +from typing_extensions import Literal + from .ImageFile import ImageFile, PyDecoder class MspImageFile(ImageFile): - format: str - format_description: str + format: ClassVar[Literal["MSP"]] + format_description: ClassVar[str] class MspDecoder(PyDecoder): def decode(self, buffer): ... diff --git a/stubs/Pillow/PIL/PcdImagePlugin.pyi b/stubs/Pillow/PIL/PcdImagePlugin.pyi index 0c147ca5e..a5ea3dd00 100644 --- a/stubs/Pillow/PIL/PcdImagePlugin.pyi +++ b/stubs/Pillow/PIL/PcdImagePlugin.pyi @@ -1,9 +1,10 @@ -from typing import Any +from typing import Any, ClassVar +from typing_extensions import Literal from .ImageFile import ImageFile class PcdImageFile(ImageFile): - format: str - format_description: str + format: ClassVar[Literal["PCD"]] + format_description: ClassVar[str] im: Any def load_end(self) -> None: ... diff --git a/stubs/Pillow/PIL/PcxImagePlugin.pyi b/stubs/Pillow/PIL/PcxImagePlugin.pyi index 8a47f72a8..b8916662a 100644 --- a/stubs/Pillow/PIL/PcxImagePlugin.pyi +++ b/stubs/Pillow/PIL/PcxImagePlugin.pyi @@ -1,11 +1,12 @@ -from typing import Any +from typing import Any, ClassVar +from typing_extensions import Literal from .ImageFile import ImageFile logger: Any class PcxImageFile(ImageFile): - format: str - format_description: str + format: ClassVar[Literal["PCX", "DCX"]] + format_description: ClassVar[str] SAVE: Any diff --git a/stubs/Pillow/PIL/PixarImagePlugin.pyi b/stubs/Pillow/PIL/PixarImagePlugin.pyi index 31890c45d..8c9bcaf2f 100644 --- a/stubs/Pillow/PIL/PixarImagePlugin.pyi +++ b/stubs/Pillow/PIL/PixarImagePlugin.pyi @@ -1,5 +1,8 @@ +from typing import ClassVar +from typing_extensions import Literal + from .ImageFile import ImageFile class PixarImageFile(ImageFile): - format: str - format_description: str + format: ClassVar[Literal["PIXAR"]] + format_description: ClassVar[str] diff --git a/stubs/Pillow/PIL/PngImagePlugin.pyi b/stubs/Pillow/PIL/PngImagePlugin.pyi index 3126f6b23..b2033e678 100644 --- a/stubs/Pillow/PIL/PngImagePlugin.pyi +++ b/stubs/Pillow/PIL/PngImagePlugin.pyi @@ -1,4 +1,5 @@ -from typing import Any +from typing import Any, ClassVar +from typing_extensions import Literal from ._binary import o8 as o8 from .ImageFile import ImageFile @@ -75,8 +76,8 @@ class PngStream(ChunkStream): def chunk_fdAT(self, pos, length): ... class PngImageFile(ImageFile): - format: str - format_description: str + format: ClassVar[Literal["PNG"]] + format_description: ClassVar[str] @property def text(self): ... fp: Any diff --git a/stubs/Pillow/PIL/PpmImagePlugin.pyi b/stubs/Pillow/PIL/PpmImagePlugin.pyi index 2adee46f2..797bbd79b 100644 --- a/stubs/Pillow/PIL/PpmImagePlugin.pyi +++ b/stubs/Pillow/PIL/PpmImagePlugin.pyi @@ -1,4 +1,5 @@ -from typing import Any +from typing import Any, ClassVar +from typing_extensions import Literal from .ImageFile import ImageFile @@ -6,5 +7,5 @@ b_whitespace: bytes MODES: Any class PpmImageFile(ImageFile): - format: str - format_description: str + format: ClassVar[Literal["PPM"]] + format_description: ClassVar[str] diff --git a/stubs/Pillow/PIL/PsdImagePlugin.pyi b/stubs/Pillow/PIL/PsdImagePlugin.pyi index 5a3d381fe..0d3835011 100644 --- a/stubs/Pillow/PIL/PsdImagePlugin.pyi +++ b/stubs/Pillow/PIL/PsdImagePlugin.pyi @@ -1,12 +1,13 @@ -from typing import Any +from typing import Any, ClassVar +from typing_extensions import Literal from .ImageFile import ImageFile MODES: Any class PsdImageFile(ImageFile): - format: str - format_description: str + format: ClassVar[Literal["PSD"]] + format_description: ClassVar[str] mode: Any tile: Any frame: Any diff --git a/stubs/Pillow/PIL/SgiImagePlugin.pyi b/stubs/Pillow/PIL/SgiImagePlugin.pyi index 2d498dbd2..e7f4ff96e 100644 --- a/stubs/Pillow/PIL/SgiImagePlugin.pyi +++ b/stubs/Pillow/PIL/SgiImagePlugin.pyi @@ -1,12 +1,13 @@ -from typing import Any +from typing import Any, ClassVar +from typing_extensions import Literal from .ImageFile import ImageFile, PyDecoder MODES: Any class SgiImageFile(ImageFile): - format: str - format_description: str + format: ClassVar[Literal["SGI"]] + format_description: ClassVar[str] class SGI16Decoder(PyDecoder): def decode(self, buffer): ... diff --git a/stubs/Pillow/PIL/SpiderImagePlugin.pyi b/stubs/Pillow/PIL/SpiderImagePlugin.pyi index 8a3e213c0..17f5e6d3a 100644 --- a/stubs/Pillow/PIL/SpiderImagePlugin.pyi +++ b/stubs/Pillow/PIL/SpiderImagePlugin.pyi @@ -1,4 +1,4 @@ -from typing import Any +from typing import Any, ClassVar from typing_extensions import Literal from .ImageFile import ImageFile @@ -11,8 +11,8 @@ def isSpiderHeader(t): ... def isSpiderImage(filename): ... class SpiderImageFile(ImageFile): - format: str - format_description: str + format: ClassVar[Literal["SPIDER"]] + format_description: ClassVar[str] @property def n_frames(self): ... @property diff --git a/stubs/Pillow/PIL/SunImagePlugin.pyi b/stubs/Pillow/PIL/SunImagePlugin.pyi index 731c78846..27ac28a58 100644 --- a/stubs/Pillow/PIL/SunImagePlugin.pyi +++ b/stubs/Pillow/PIL/SunImagePlugin.pyi @@ -1,5 +1,8 @@ +from typing import ClassVar +from typing_extensions import Literal + from .ImageFile import ImageFile class SunImageFile(ImageFile): - format: str - format_description: str + format: ClassVar[Literal["SUN"]] + format_description: ClassVar[str] diff --git a/stubs/Pillow/PIL/TgaImagePlugin.pyi b/stubs/Pillow/PIL/TgaImagePlugin.pyi index 3072da301..5022107b6 100644 --- a/stubs/Pillow/PIL/TgaImagePlugin.pyi +++ b/stubs/Pillow/PIL/TgaImagePlugin.pyi @@ -1,11 +1,12 @@ -from typing import Any +from typing import Any, ClassVar +from typing_extensions import Literal from .ImageFile import ImageFile MODES: Any class TgaImageFile(ImageFile): - format: str - format_description: str + format: ClassVar[Literal["TGA"]] + format_description: ClassVar[str] SAVE: Any diff --git a/stubs/Pillow/PIL/TiffImagePlugin.pyi b/stubs/Pillow/PIL/TiffImagePlugin.pyi index 5eaaa7b6f..7fb5cb47f 100644 --- a/stubs/Pillow/PIL/TiffImagePlugin.pyi +++ b/stubs/Pillow/PIL/TiffImagePlugin.pyi @@ -1,6 +1,7 @@ from collections.abc import MutableMapping from numbers import Rational -from typing import Any +from typing import Any, ClassVar +from typing_extensions import Literal from .ImageFile import ImageFile @@ -136,8 +137,8 @@ class ImageFileDirectory_v1(ImageFileDirectory_v2): ImageFileDirectory = ImageFileDirectory_v1 class TiffImageFile(ImageFile): - format: str - format_description: str + format: ClassVar[Literal["TIFF", "MIC"]] + format_description: ClassVar[str] tag_v2: Any tag: Any def __init__(self, fp: Any | None = ..., filename: Any | None = ...) -> None: ... diff --git a/stubs/Pillow/PIL/WalImageFile.pyi b/stubs/Pillow/PIL/WalImageFile.pyi index 6355032c8..24d1cb5cc 100644 --- a/stubs/Pillow/PIL/WalImageFile.pyi +++ b/stubs/Pillow/PIL/WalImageFile.pyi @@ -1,3 +1,13 @@ +from typing import ClassVar +from typing_extensions import Literal + +from . import ImageFile + +class WalImageFile(ImageFile.ImageFile): + format: ClassVar[Literal["WAL"]] + format_description: ClassVar[str] + def load(self) -> None: ... + def open(filename): ... quake2palette: bytes diff --git a/stubs/Pillow/PIL/WebPImagePlugin.pyi b/stubs/Pillow/PIL/WebPImagePlugin.pyi index 97614e6d0..f7b7e6c5d 100644 --- a/stubs/Pillow/PIL/WebPImagePlugin.pyi +++ b/stubs/Pillow/PIL/WebPImagePlugin.pyi @@ -1,12 +1,13 @@ -from typing import Any +from typing import Any, ClassVar +from typing_extensions import Literal from .ImageFile import ImageFile SUPPORTED: bool class WebPImageFile(ImageFile): - format: str - format_description: str + format: ClassVar[Literal["WEBP"]] + format_description: ClassVar[str] def seek(self, frame) -> None: ... fp: Any tile: Any diff --git a/stubs/Pillow/PIL/WmfImagePlugin.pyi b/stubs/Pillow/PIL/WmfImagePlugin.pyi index b7244948f..5f7c4d4ec 100644 --- a/stubs/Pillow/PIL/WmfImagePlugin.pyi +++ b/stubs/Pillow/PIL/WmfImagePlugin.pyi @@ -1,4 +1,5 @@ -from typing import Any +from typing import Any, ClassVar +from typing_extensions import Literal from .ImageFile import StubImageFile @@ -10,6 +11,6 @@ class WmfHandler: def load(self, im): ... class WmfStubImageFile(StubImageFile): - format: str - format_description: str + format: ClassVar[Literal["WMF"]] + format_description: ClassVar[str] def load(self, dpi: Any | None = ...) -> None: ... diff --git a/stubs/Pillow/PIL/XVThumbImagePlugin.pyi b/stubs/Pillow/PIL/XVThumbImagePlugin.pyi index 3d098da18..ebfc7d98d 100644 --- a/stubs/Pillow/PIL/XVThumbImagePlugin.pyi +++ b/stubs/Pillow/PIL/XVThumbImagePlugin.pyi @@ -1,7 +1,10 @@ +from typing import ClassVar +from typing_extensions import Literal + from .ImageFile import ImageFile PALETTE: bytes class XVThumbImageFile(ImageFile): - format: str - format_description: str + format: ClassVar[Literal["XVThumb"]] + format_description: ClassVar[str] diff --git a/stubs/Pillow/PIL/XbmImagePlugin.pyi b/stubs/Pillow/PIL/XbmImagePlugin.pyi index f8305c04a..588aaac2d 100644 --- a/stubs/Pillow/PIL/XbmImagePlugin.pyi +++ b/stubs/Pillow/PIL/XbmImagePlugin.pyi @@ -1,9 +1,10 @@ -from typing import Any +from typing import Any, ClassVar +from typing_extensions import Literal from .ImageFile import ImageFile xbm_head: Any class XbmImageFile(ImageFile): - format: str - format_description: str + format: ClassVar[Literal["XBM"]] + format_description: ClassVar[str] diff --git a/stubs/Pillow/PIL/XpmImagePlugin.pyi b/stubs/Pillow/PIL/XpmImagePlugin.pyi index 600a9e0cd..d0df39a6e 100644 --- a/stubs/Pillow/PIL/XpmImagePlugin.pyi +++ b/stubs/Pillow/PIL/XpmImagePlugin.pyi @@ -1,10 +1,11 @@ -from typing import Any +from typing import Any, ClassVar +from typing_extensions import Literal from .ImageFile import ImageFile xpm_head: Any class XpmImageFile(ImageFile): - format: str - format_description: str + format: ClassVar[Literal["XPM"]] + format_description: ClassVar[str] def load_read(self, bytes): ...