Add defaults for third-party stubs A-D (#9952)

This commit is contained in:
Alex Waygood
2023-03-27 16:49:58 +01:00
committed by GitHub
parent ce5f02fcdc
commit b9fedd20ce
186 changed files with 1829 additions and 1760 deletions

View File

@@ -26,7 +26,7 @@ class DAVResponse:
def validate_status(self, status: str) -> None: ...
def find_objects_and_props(self) -> None: ...
def expand_simple_props(
self, props: Iterable[Incomplete] = ..., multi_value_props: Iterable[Incomplete] = ..., xpath: str | None = ...
self, props: Iterable[Incomplete] = [], multi_value_props: Iterable[Incomplete] = [], xpath: str | None = None
) -> dict[str, dict[str, str]]: ...
class DAVClient:
@@ -49,7 +49,7 @@ class DAVClient:
timeout: _Timeout | None = None,
ssl_verify_cert: bool | str = True,
ssl_cert: str | tuple[str, str] | None = None,
headers: dict[str, str] = ...,
headers: dict[str, str] = {},
) -> None: ...
def __enter__(self) -> Self: ...
def __exit__(
@@ -68,13 +68,13 @@ class DAVClient:
def check_dav_support(self) -> str | None: ...
def check_cdav_support(self) -> bool: ...
def check_scheduling_support(self) -> bool: ...
def propfind(self, url: str | None = ..., props: str = ..., depth: int = ...) -> DAVResponse: ...
def proppatch(self, url: str, body: str, dummy: None = ...) -> DAVResponse: ...
def report(self, url: str, query: str = ..., depth: int = ...) -> DAVResponse: ...
def mkcol(self, url: str, body: str, dummy: None = ...) -> DAVResponse: ...
def mkcalendar(self, url: str, body: str = ..., dummy: None = ...) -> DAVResponse: ...
def put(self, url: str, body: str, headers: Mapping[str, str] = ...) -> DAVResponse: ...
def post(self, url: str, body: str, headers: Mapping[str, str] = ...) -> DAVResponse: ...
def propfind(self, url: str | None = None, props: str = "", depth: int = 0) -> DAVResponse: ...
def proppatch(self, url: str, body: str, dummy: None = None) -> DAVResponse: ...
def report(self, url: str, query: str = "", depth: int = 0) -> DAVResponse: ...
def mkcol(self, url: str, body: str, dummy: None = None) -> DAVResponse: ...
def mkcalendar(self, url: str, body: str = "", dummy: None = None) -> DAVResponse: ...
def put(self, url: str, body: str, headers: Mapping[str, str] = {}) -> DAVResponse: ...
def post(self, url: str, body: str, headers: Mapping[str, str] = {}) -> DAVResponse: ...
def delete(self, url: str) -> DAVResponse: ...
def options(self, url: str) -> DAVResponse: ...
def request(self, url: str, method: str = ..., body: str = ..., headers: Mapping[str, str] = ...) -> DAVResponse: ...
def request(self, url: str, method: str = "GET", body: str = "", headers: Mapping[str, str] = {}) -> DAVResponse: ...

View File

@@ -11,14 +11,14 @@ class BaseElement:
value: str | None
attributes: Incomplete | None
caldav_class: Incomplete | None
def __init__(self, name: str | None = ..., value: str | bytes | None = ...) -> None: ...
def __init__(self, name: str | None = None, value: str | bytes | None = None) -> None: ...
def __add__(self, other: BaseElement) -> Self: ...
def xmlelement(self) -> _Element: ...
def xmlchildren(self, root: _Element) -> None: ...
def append(self, element: BaseElement | Iterable[BaseElement]) -> Self: ...
class NamedBaseElement(BaseElement):
def __init__(self, name: str | None = ...) -> None: ...
def __init__(self, name: str | None = None) -> None: ...
class ValuedBaseElement(BaseElement):
def __init__(self, value: str | bytes | None = ...) -> None: ...
def __init__(self, value: str | bytes | None = None) -> None: ...

View File

@@ -35,11 +35,11 @@ class ParamFilter(NamedBaseElement):
class TextMatch(ValuedBaseElement):
tag: ClassVar[str]
def __init__(self, value, collation: str = ..., negate: bool = ...) -> None: ...
def __init__(self, value, collation: str = "i;octet", negate: bool = False) -> None: ...
class TimeRange(BaseElement):
tag: ClassVar[str]
def __init__(self, start: datetime.datetime | None = ..., end: datetime.datetime | None = ...) -> None: ...
def __init__(self, start: datetime.datetime | None = None, end: datetime.datetime | None = None) -> None: ...
class NotDefined(BaseElement):
tag: ClassVar[str]
@@ -49,7 +49,7 @@ class CalendarData(BaseElement):
class Expand(BaseElement):
tag: ClassVar[str]
def __init__(self, start: datetime.datetime | None, end: datetime.datetime | None = ...) -> None: ...
def __init__(self, start: datetime.datetime | None, end: datetime.datetime | None = None) -> None: ...
class Comp(NamedBaseElement):
tag: ClassVar[str]

View File

@@ -5,7 +5,7 @@ ERR_FRAGMENT: str
class DAVError(Exception):
url: str | None
reason: str
def __init__(self, url: str | None = ..., reason: str | None = ...) -> None: ...
def __init__(self, url: str | None = None, reason: str | None = None) -> None: ...
class AuthorizationError(DAVError): ...
class PropsetError(DAVError): ...

View File

@@ -1,4 +1,4 @@
nsmap: dict[str, str]
nsmap2: dict[str, str]
def ns(prefix: str, tag: str | None = ...) -> str: ...
def ns(prefix: str, tag: str | None = None) -> str: ...

View File

@@ -26,37 +26,37 @@ class DAVObject:
extra_init_options: dict[str, Incomplete]
def __init__(
self,
client: DAVClient | None = ...,
url: str | ParseResult | SplitResult | URL | None = ...,
parent: DAVObject | None = ...,
name: str | None = ...,
id: str | None = ...,
props: Mapping[Incomplete, Incomplete] | None = ...,
client: DAVClient | None = None,
url: str | ParseResult | SplitResult | URL | None = None,
parent: DAVObject | None = None,
name: str | None = None,
id: str | None = None,
props: Mapping[Incomplete, Incomplete] | None = None,
**extra: Incomplete,
) -> None: ...
@property
def canonical_url(self) -> str: ...
def children(self, type: str | None = ...) -> list[tuple[URL, Incomplete, Incomplete]]: ...
def get_property(self, prop, use_cached: bool = ..., **passthrough) -> Incomplete | None: ...
def children(self, type: str | None = None) -> list[tuple[URL, Incomplete, Incomplete]]: ...
def get_property(self, prop, use_cached: bool = False, **passthrough) -> Incomplete | None: ...
def get_properties(
self, props: Incomplete | None = ..., depth: int = ..., parse_response_xml: bool = ..., parse_props: bool = ...
self, props: Incomplete | None = None, depth: int = 0, parse_response_xml: bool = True, parse_props: bool = True
): ...
def set_properties(self, props: Incomplete | None = ...) -> Self: ...
def set_properties(self, props: Incomplete | None = None) -> Self: ...
def save(self) -> Self: ...
def delete(self) -> None: ...
class CalendarSet(DAVObject):
def calendars(self) -> list[Calendar]: ...
def make_calendar(
self, name: str | None = ..., cal_id: str | None = ..., supported_calendar_component_set: Incomplete | None = ...
self, name: str | None = None, cal_id: str | None = None, supported_calendar_component_set: Incomplete | None = None
) -> Calendar: ...
def calendar(self, name: str | None = ..., cal_id: str | None = ...) -> Calendar: ...
def calendar(self, name: str | None = None, cal_id: str | None = None) -> Calendar: ...
class Principal(DAVObject):
def __init__(self, client: DAVClient | None = ..., url: str | ParseResult | SplitResult | URL | None = ...) -> None: ...
def __init__(self, client: DAVClient | None = None, url: str | ParseResult | SplitResult | URL | None = None) -> None: ...
def calendars(self) -> list[Calendar]: ...
def make_calendar(
self, name: str | None = ..., cal_id: str | None = ..., supported_calendar_component_set: Incomplete | None = ...
self, name: str | None = None, cal_id: str | None = None, supported_calendar_component_set: Incomplete | None = None
) -> Calendar: ...
def calendar(self, name: str | None = None, cal_id: str | None = None, cal_url: str | None = None) -> Calendar: ...
def get_vcal_address(self) -> _VCalAddress: ...
@@ -70,13 +70,13 @@ class Calendar(DAVObject):
def get_supported_components(self) -> list[Incomplete]: ...
def save_with_invites(self, ical: str, attendees, **attendeeoptions) -> None: ...
def save_event(
self, ical: str | None = ..., no_overwrite: bool = ..., no_create: bool = ..., **ical_data: Incomplete
self, ical: str | None = None, no_overwrite: bool = False, no_create: bool = False, **ical_data: Incomplete
) -> Event: ...
def save_todo(
self, ical: str | None = ..., no_overwrite: bool = ..., no_create: bool = ..., **ical_data: Incomplete
self, ical: str | None = None, no_overwrite: bool = False, no_create: bool = False, **ical_data: Incomplete
) -> Todo: ...
def save_journal(
self, ical: str | None = ..., no_overwrite: bool = ..., no_create: bool = ..., **ical_data: Incomplete
self, ical: str | None = None, no_overwrite: bool = False, no_create: bool = False, **ical_data: Incomplete
) -> Journal: ...
add_event = save_event
add_todo = save_todo
@@ -85,22 +85,27 @@ class Calendar(DAVObject):
def build_date_search_query(
self,
start,
end: datetime.datetime | None = ...,
compfilter: Literal["VEVENT"] | None = ...,
expand: bool | Literal["maybe"] = ...,
end: datetime.datetime | None = None,
compfilter: Literal["VEVENT"] | None = "VEVENT",
expand: bool | Literal["maybe"] = "maybe",
): ...
@overload
def date_search(
self,
start: datetime.datetime,
end: datetime.datetime | None = ...,
compfilter: Literal["VEVENT"] = ...,
expand: bool | Literal["maybe"] = ...,
verify_expand: bool = ...,
end: datetime.datetime | None = None,
compfilter: Literal["VEVENT"] = "VEVENT",
expand: bool | Literal["maybe"] = "maybe",
verify_expand: bool = False,
) -> list[Event]: ...
@overload
def date_search(
self, start: datetime.datetime, *, compfilter: None, expand: bool | Literal["maybe"] = ..., verify_expand: bool = ...
self,
start: datetime.datetime,
*,
compfilter: None,
expand: bool | Literal["maybe"] = "maybe",
verify_expand: bool = False,
) -> list[CalendarObjectResource]: ...
@overload
def date_search(
@@ -108,18 +113,18 @@ class Calendar(DAVObject):
start: datetime.datetime,
end: datetime.datetime | None,
compfilter: None,
expand: bool | Literal["maybe"] = ...,
verify_expand: bool = ...,
expand: bool | Literal["maybe"] = "maybe",
verify_expand: bool = False,
) -> list[CalendarObjectResource]: ...
@overload
def search(
self,
xml: None = ...,
comp_class: None = ...,
todo: bool | None = ...,
include_completed: bool = ...,
sort_keys: Sequence[str] = ...,
split_expanded: bool = ...,
xml: None = None,
comp_class: None = None,
todo: bool | None = None,
include_completed: bool = False,
sort_keys: Sequence[str] = (),
split_expanded: bool = True,
**kwargs,
) -> list[CalendarObjectResource]: ...
@overload
@@ -127,10 +132,10 @@ class Calendar(DAVObject):
self,
xml,
comp_class: type[_CC],
todo: bool | None = ...,
include_completed: bool = ...,
sort_keys: Sequence[str] = ...,
split_expanded: bool = ...,
todo: bool | None = None,
include_completed: bool = False,
sort_keys: Sequence[str] = (),
split_expanded: bool = True,
**kwargs,
) -> list[_CC]: ...
@overload
@@ -138,24 +143,24 @@ class Calendar(DAVObject):
self,
*,
comp_class: type[_CC],
todo: bool | None = ...,
include_completed: bool = ...,
sort_keys: Sequence[str] = ...,
split_expanded: bool = ...,
todo: bool | None = None,
include_completed: bool = False,
sort_keys: Sequence[str] = (),
split_expanded: bool = True,
**kwargs,
) -> list[_CC]: ...
def build_search_xml_query(
self,
comp_class: _CompClass | None = ...,
todo: bool | None = ...,
ignore_completed1: bool | None = ...,
ignore_completed2: bool | None = ...,
ignore_completed3: bool | None = ...,
event: bool | None = ...,
filters: list[Incomplete] | None = ...,
expand: bool | None = ...,
start: datetime.datetime | None = ...,
end: datetime.datetime | None = ...,
comp_class: _CompClass | None = None,
todo: bool | None = None,
ignore_completed1: bool | None = None,
ignore_completed2: bool | None = None,
ignore_completed3: bool | None = None,
event: bool | None = None,
filters: list[Incomplete] | None = None,
expand: bool | None = None,
start: datetime.datetime | None = None,
end: datetime.datetime | None = None,
*,
uid=...,
summary=...,
@@ -165,16 +170,18 @@ class Calendar(DAVObject):
status=...,
) -> tuple[CalendarQuery, _CompClass]: ...
def freebusy_request(self, start: datetime.datetime, end: datetime.datetime) -> FreeBusy: ...
def todos(self, sort_keys: Iterable[str] = ..., include_completed: bool = ..., sort_key: str | None = ...) -> list[Todo]: ...
def event_by_url(self, href, data: Incomplete | None = ...) -> Event: ...
def object_by_uid(self, uid: str, comp_filter: CompFilter | None = ..., comp_class: _CompClass | None = ...) -> Event: ...
def todos(
self, sort_keys: Iterable[str] = ("due", "priority"), include_completed: bool = False, sort_key: str | None = None
) -> list[Todo]: ...
def event_by_url(self, href, data: Incomplete | None = None) -> Event: ...
def object_by_uid(self, uid: str, comp_filter: CompFilter | None = None, comp_class: _CompClass | None = None) -> Event: ...
def todo_by_uid(self, uid: str) -> CalendarObjectResource: ...
def event_by_uid(self, uid: str) -> CalendarObjectResource: ...
def journal_by_uid(self, uid: str) -> CalendarObjectResource: ...
event = event_by_uid
def events(self) -> list[Event]: ...
def objects_by_sync_token(
self, sync_token: Incomplete | None = ..., load_objects: bool = ...
self, sync_token: Incomplete | None = None, load_objects: bool = False
) -> SynchronizableCalendarObjectCollection: ...
objects = objects_by_sync_token
def journals(self) -> list[Journal]: ...
@@ -182,9 +189,9 @@ class Calendar(DAVObject):
class ScheduleMailbox(Calendar):
def __init__(
self,
client: DAVClient | None = ...,
principal: Principal | None = ...,
url: str | ParseResult | SplitResult | URL | None = ...,
client: DAVClient | None = None,
principal: Principal | None = None,
url: str | ParseResult | SplitResult | URL | None = None,
) -> None: ...
def get_items(self): ...
@@ -204,31 +211,31 @@ class SynchronizableCalendarObjectCollection:
class CalendarObjectResource(DAVObject):
def __init__(
self,
client: DAVClient | None = ...,
url: str | ParseResult | SplitResult | URL | None = ...,
data: Incomplete | None = ...,
parent: Incomplete | None = ...,
id: Incomplete | None = ...,
props: Incomplete | None = ...,
client: DAVClient | None = None,
url: str | ParseResult | SplitResult | URL | None = None,
data: Incomplete | None = None,
parent: Incomplete | None = None,
id: Incomplete | None = None,
props: Incomplete | None = None,
) -> None: ...
def add_organizer(self) -> None: ...
def split_expanded(self) -> list[Self]: ...
def expand_rrule(self, start: datetime.datetime, end: datetime.datetime) -> None: ...
def add_attendee(self, attendee, no_default_parameters: bool = ..., **parameters) -> None: ...
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: ...
def decline_invite(self, calendar: Incomplete | None = ...) -> None: ...
def tentatively_accept_invite(self, calendar: Incomplete | None = ...) -> None: ...
def copy(self, keep_uid: bool = ..., new_parent: Incomplete | None = ...) -> Self: ...
def accept_invite(self, calendar: Incomplete | None = None) -> None: ...
def decline_invite(self, calendar: Incomplete | None = None) -> None: ...
def tentatively_accept_invite(self, calendar: Incomplete | None = None) -> None: ...
def copy(self, keep_uid: bool = False, new_parent: Incomplete | None = None) -> Self: ...
def load(self, only_if_unloaded: bool = False) -> Self: ...
def change_attendee_status(self, attendee: Incomplete | None = ..., **kwargs) -> None: ...
def change_attendee_status(self, attendee: Incomplete | None = None, **kwargs) -> None: ...
def save(
self,
no_overwrite: bool = ...,
no_create: bool = ...,
obj_type: str | None = ...,
increase_seqno: bool = ...,
if_schedule_tag_match: bool = ...,
no_overwrite: bool = False,
no_create: bool = False,
obj_type: str | None = None,
increase_seqno: bool = True,
if_schedule_tag_match: bool = False,
) -> Self: ...
def get_duration(self) -> datetime.timedelta: ...
data: Incomplete
@@ -241,13 +248,13 @@ class Journal(CalendarObjectResource): ...
class FreeBusy(CalendarObjectResource):
def __init__(
self, parent, data, url: str | ParseResult | SplitResult | URL | None = ..., id: Incomplete | None = ...
self, parent, data, url: str | ParseResult | SplitResult | URL | None = None, id: Incomplete | None = None
) -> None: ...
class Todo(CalendarObjectResource):
def complete(
self,
completion_timestamp: datetime.datetime | None = ...,
handle_rrule: bool = ...,
rrule_mode: Literal["safe", "this_and_future"] = ...,
completion_timestamp: datetime.datetime | None = None,
handle_rrule: bool = False,
rrule_mode: Literal["safe", "this_and_future"] = "safe",
) -> None: ...