Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update caldav to 1.3.* #10485

Merged
merged 7 commits into from
Jul 20, 2023
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion stubs/caldav/METADATA.toml
Original file line number Diff line number Diff line change
@@ -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
Expand Down
5 changes: 4 additions & 1 deletion stubs/caldav/caldav/davclient.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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: ...
Expand All @@ -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,
Expand All @@ -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__(
Expand Down
17 changes: 15 additions & 2 deletions stubs/caldav/caldav/objects.pyi
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
import datetime
from _typeshed import Incomplete
from collections.abc import Iterable, Iterator, Mapping, Sequence
from collections import defaultdict
from collections.abc import Callable, Container, Iterable, Iterator, Mapping, Sequence
from typing import 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)
Expand Down Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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(
Expand All @@ -161,13 +165,15 @@ class Calendar(DAVObject):
expand: bool | None = None,
start: datetime.datetime | None = None,
end: datetime.datetime | None = None,
props: list[CalendarData] | None = None,
*,
uid=...,
summary=...,
comment=...,
description=...,
location=...,
status=...,
**kwargs: str,
) -> tuple[CalendarQuery, _CompClass]: ...
def freebusy_request(self, start: datetime.datetime, end: datetime.datetime) -> FreeBusy: ...
def todos(
Expand Down Expand Up @@ -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: ...
Expand Down