From 3a9b0c5790a0bc7e8626bcfc859738ac2c162cbd Mon Sep 17 00:00:00 2001 From: Nikita Sobolev Date: Thu, 20 Jul 2023 17:14:32 +0300 Subject: [PATCH] Update `caldav` to `1.3.*` (#10485) Co-authored-by: Alex Waygood --- stubs/caldav/METADATA.toml | 2 +- stubs/caldav/caldav/davclient.pyi | 5 ++++- stubs/caldav/caldav/objects.pyi | 19 ++++++++++++++++--- 3 files changed, 21 insertions(+), 5 deletions(-) diff --git a/stubs/caldav/METADATA.toml b/stubs/caldav/METADATA.toml index 047218cc5..8cc21a470 100644 --- a/stubs/caldav/METADATA.toml +++ b/stubs/caldav/METADATA.toml @@ -1,4 +1,4 @@ -version = "1.2.*" +version = "1.3.*" # also types-lxml and types-icalendar when those stubs are added requires = ["types-requests", "types-vobject"] partial_stub = true diff --git a/stubs/caldav/caldav/davclient.pyi b/stubs/caldav/caldav/davclient.pyi index 8cc3c5bc2..23d392319 100644 --- a/stubs/caldav/caldav/davclient.pyi +++ b/stubs/caldav/caldav/davclient.pyi @@ -20,7 +20,8 @@ class DAVResponse: status: int headers: CaseInsensitiveDict[str] objects: dict[str, dict[str, str]] # only defined after call to find_objects_and_props() - def __init__(self, response: Response) -> None: ... + huge_tree: bool + def __init__(self, response: Response, davclient: DAVClient | None = None) -> None: ... @property def raw(self) -> str: ... def validate_status(self, status: str) -> None: ... @@ -39,6 +40,7 @@ class DAVClient: timeout: _Timeout | None ssl_verify_cert: bool | str ssl_cert: str | tuple[str, str] | None + huge_tree: bool def __init__( self, url: str, @@ -50,6 +52,7 @@ class DAVClient: ssl_verify_cert: bool | str = True, ssl_cert: str | tuple[str, str] | None = None, headers: dict[str, str] = {}, + huge_tree: bool = False, ) -> None: ... def __enter__(self) -> Self: ... def __exit__( diff --git a/stubs/caldav/caldav/objects.pyi b/stubs/caldav/caldav/objects.pyi index 524fec9f9..a00de57f1 100644 --- a/stubs/caldav/caldav/objects.pyi +++ b/stubs/caldav/caldav/objects.pyi @@ -1,14 +1,15 @@ import datetime from _typeshed import Incomplete -from collections.abc import Iterable, Iterator, Mapping, Sequence -from typing import TypeVar, overload +from collections import defaultdict +from collections.abc import Callable, Container, Iterable, Iterator, Mapping, Sequence +from typing import Any, TypeVar, overload from typing_extensions import Literal, Self, TypeAlias from urllib.parse import ParseResult, SplitResult from vobject.base import VBase from .davclient import DAVClient -from .elements.cdav import CalendarQuery, CompFilter, ScheduleInboxURL, ScheduleOutboxURL +from .elements.cdav import CalendarData, CalendarQuery, CompFilter, ScheduleInboxURL, ScheduleOutboxURL from .lib.url import URL _CC = TypeVar("_CC", bound=CalendarObjectResource) @@ -125,6 +126,7 @@ class Calendar(DAVObject): include_completed: bool = False, sort_keys: Sequence[str] = (), split_expanded: bool = True, + props: list[CalendarData] | None = None, **kwargs, ) -> list[CalendarObjectResource]: ... @overload @@ -136,6 +138,7 @@ class Calendar(DAVObject): include_completed: bool = False, sort_keys: Sequence[str] = (), split_expanded: bool = True, + props: list[CalendarData] | None = None, **kwargs, ) -> list[_CC]: ... @overload @@ -147,6 +150,7 @@ class Calendar(DAVObject): include_completed: bool = False, sort_keys: Sequence[str] = (), split_expanded: bool = True, + props: list[CalendarData] | None = None, **kwargs, ) -> list[_CC]: ... def build_search_xml_query( @@ -161,6 +165,7 @@ class Calendar(DAVObject): expand: bool | None = None, start: datetime.datetime | None = None, end: datetime.datetime | None = None, + props: list[CalendarData] | None = None, *, uid=..., summary=..., @@ -168,6 +173,7 @@ class Calendar(DAVObject): description=..., location=..., status=..., + **kwargs: str, ) -> tuple[CalendarQuery, _CompClass]: ... def freebusy_request(self, start: datetime.datetime, end: datetime.datetime) -> FreeBusy: ... def todos( @@ -221,6 +227,13 @@ class CalendarObjectResource(DAVObject): def add_organizer(self) -> None: ... def split_expanded(self) -> list[Self]: ... def expand_rrule(self, start: datetime.datetime, end: datetime.datetime) -> None: ... + def get_relatives( + self, + reltypes: Container[str] | None = None, + relfilter: Callable[[Any], bool] | None = None, + fetch_objects: bool = True, + ignore_missing: bool = True, + ) -> defaultdict[str, set[str]]: ... def add_attendee(self, attendee, no_default_parameters: bool = False, **parameters) -> None: ... def is_invite_request(self) -> bool: ... def accept_invite(self, calendar: Incomplete | None = None) -> None: ...