Depend on Pillow instead of types-Pillow (#11720)

This commit is contained in:
Sebastian Rittau
2024-04-05 13:30:27 +02:00
committed by GitHub
parent 130a04905c
commit c0a44be33f
10 changed files with 35 additions and 24 deletions

View File

@@ -1,3 +1,2 @@
version = "0.33.*"
upstream_repository = "https://github.com/python-xlib/python-xlib"
requires = ["types-Pillow"]

View File

@@ -1,12 +1,14 @@
from collections.abc import Iterable, Sequence
from typing import Any
from typing_extensions import TypeAlias
from PIL import Image
from Xlib._typing import ErrorHandler
from Xlib.protocol import request, rq
from Xlib.protocol.structs import _Arc6IntSequence, _Rectangle4IntSequence, _RGB3IntIterable, _Segment4IntSequence
from Xlib.xobject import colormap, cursor, fontable, resource
_Image: TypeAlias = Any # PIL.Image.Image
class Drawable(resource.Resource):
__drawable__ = resource.Resource.__resource__
def get_geometry(self) -> request.GetGeometry: ...
@@ -100,7 +102,7 @@ class Drawable(resource.Resource):
data: bytes | bytearray,
onerror: ErrorHandler[object] | None = None,
) -> None: ...
def put_pil_image(self, gc: int, x: int, y: int, image: Image.Image, onerror: ErrorHandler[object] | None = None) -> None: ...
def put_pil_image(self, gc: int, x: int, y: int, image: _Image, onerror: ErrorHandler[object] | None = None) -> None: ...
def get_image(self, x: int, y: int, width: int, height: int, format: int, plane_mask: int) -> request.GetImage: ...
def draw_text(
self, gc: int, x: int, y: int, text: dict[str, str | int], onerror: ErrorHandler[object] | None = None