mirror of
https://github.com/davidhalter/typeshed.git
synced 2026-05-09 06:46:18 +08:00
Bump icalendar to 6.2.* (#13963)
This commit is contained in:
@@ -12,6 +12,7 @@ icalendar.cal.Component.set_inline
|
||||
|
||||
# Stubtest gets confused by multiple inheritance.
|
||||
icalendar.prop.vSkip.__new__
|
||||
icalendar.vSkip.__new__
|
||||
|
||||
# Stubtest incorrectly reports that stub argument "cls" should be
|
||||
# positional or keyword.
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
version = "6.1.3"
|
||||
version = "6.2.*"
|
||||
upstream_repository = "https://github.com/collective/icalendar"
|
||||
requires = ["types-python-dateutil", "types-pytz"]
|
||||
|
||||
|
||||
@@ -1,12 +1,5 @@
|
||||
from . import version as version_mod
|
||||
from .alarms import (
|
||||
Alarms as Alarms,
|
||||
AlarmTime as AlarmTime,
|
||||
ComponentEndMissing as ComponentEndMissing,
|
||||
ComponentStartMissing as ComponentStartMissing,
|
||||
IncompleteAlarmInformation as IncompleteAlarmInformation,
|
||||
LocalTimezoneMissing as LocalTimezoneMissing,
|
||||
)
|
||||
from .alarms import Alarms as Alarms, AlarmTime as AlarmTime
|
||||
from .cal import (
|
||||
Alarm as Alarm,
|
||||
Calendar as Calendar,
|
||||
@@ -14,14 +7,29 @@ from .cal import (
|
||||
ComponentFactory as ComponentFactory,
|
||||
Event as Event,
|
||||
FreeBusy as FreeBusy,
|
||||
IncompleteComponent as IncompleteComponent,
|
||||
InvalidCalendar as InvalidCalendar,
|
||||
Journal as Journal,
|
||||
Timezone as Timezone,
|
||||
TimezoneDaylight as TimezoneDaylight,
|
||||
TimezoneStandard as TimezoneStandard,
|
||||
Todo as Todo,
|
||||
)
|
||||
from .enums import (
|
||||
CUTYPE as CUTYPE,
|
||||
FBTYPE as FBTYPE,
|
||||
PARTSTAT as PARTSTAT,
|
||||
RANGE as RANGE,
|
||||
RELATED as RELATED,
|
||||
RELTYPE as RELTYPE,
|
||||
ROLE as ROLE,
|
||||
)
|
||||
from .error import (
|
||||
ComponentEndMissing as ComponentEndMissing,
|
||||
ComponentStartMissing as ComponentStartMissing,
|
||||
IncompleteAlarmInformation as IncompleteAlarmInformation,
|
||||
IncompleteComponent as IncompleteComponent,
|
||||
InvalidCalendar as InvalidCalendar,
|
||||
LocalTimezoneMissing as LocalTimezoneMissing,
|
||||
)
|
||||
from .parser import Parameters as Parameters, q_join as q_join, q_split as q_split
|
||||
from .prop import (
|
||||
TypesFactory as TypesFactory,
|
||||
@@ -39,6 +47,7 @@ from .prop import (
|
||||
vMonth as vMonth,
|
||||
vPeriod as vPeriod,
|
||||
vRecur as vRecur,
|
||||
vSkip as vSkip,
|
||||
vText as vText,
|
||||
vTime as vTime,
|
||||
vUri as vUri,
|
||||
@@ -96,6 +105,15 @@ __all__ = [
|
||||
"ComponentStartMissing",
|
||||
"IncompleteAlarmInformation",
|
||||
"LocalTimezoneMissing",
|
||||
"CUTYPE",
|
||||
"FBTYPE",
|
||||
"PARTSTAT",
|
||||
"RANGE",
|
||||
"vSkip",
|
||||
"RELATED",
|
||||
"vSkip",
|
||||
"RELTYPE",
|
||||
"ROLE",
|
||||
]
|
||||
|
||||
__version__ = version_mod.__version__
|
||||
|
||||
@@ -2,23 +2,17 @@ import datetime
|
||||
from typing_extensions import TypeAlias
|
||||
|
||||
from .cal import Alarm, Event, Todo
|
||||
from .error import (
|
||||
ComponentEndMissing as ComponentEndMissing,
|
||||
ComponentStartMissing as ComponentStartMissing,
|
||||
IncompleteAlarmInformation as IncompleteAlarmInformation,
|
||||
LocalTimezoneMissing as LocalTimezoneMissing,
|
||||
)
|
||||
|
||||
__all__ = [
|
||||
"Alarms",
|
||||
"AlarmTime",
|
||||
"IncompleteAlarmInformation",
|
||||
"ComponentEndMissing",
|
||||
"ComponentStartMissing",
|
||||
"LocalTimezoneMissing",
|
||||
]
|
||||
__all__ = ["Alarms", "AlarmTime", "IncompleteAlarmInformation", "ComponentEndMissing", "ComponentStartMissing"]
|
||||
|
||||
Parent: TypeAlias = Event | Todo
|
||||
|
||||
class IncompleteAlarmInformation(ValueError): ...
|
||||
class ComponentStartMissing(IncompleteAlarmInformation): ...
|
||||
class ComponentEndMissing(IncompleteAlarmInformation): ...
|
||||
class LocalTimezoneMissing(IncompleteAlarmInformation): ...
|
||||
|
||||
class AlarmTime:
|
||||
def __init__(
|
||||
self,
|
||||
|
||||
@@ -0,0 +1,24 @@
|
||||
rdates_property: property
|
||||
exdates_property: property
|
||||
rrules_property: property
|
||||
|
||||
def multi_language_text_property(main_prop: str, compatibility_prop: str, doc: str) -> property: ...
|
||||
def single_int_property(prop: str, default: int, doc: str) -> property: ...
|
||||
def single_utc_property(name: str, docs: str) -> property: ...
|
||||
def single_string_property(name: str, docs: str, other_name: str | None = None) -> property: ...
|
||||
|
||||
color_property: property
|
||||
sequence_property: property
|
||||
categories_property: property
|
||||
|
||||
__all__ = [
|
||||
"single_utc_property",
|
||||
"color_property",
|
||||
"multi_language_text_property",
|
||||
"single_int_property",
|
||||
"sequence_property",
|
||||
"categories_property",
|
||||
"rdates_property",
|
||||
"exdates_property",
|
||||
"rrules_property",
|
||||
]
|
||||
@@ -6,8 +6,9 @@ from typing_extensions import Self
|
||||
|
||||
from .alarms import Alarms
|
||||
from .caselessdict import CaselessDict
|
||||
from .error import IncompleteComponent as IncompleteComponent
|
||||
from .parser import Contentline, Contentlines
|
||||
from .prop import TypesFactory
|
||||
from .prop import TypesFactory, vRecur
|
||||
from .timezone.tzp import TZP
|
||||
|
||||
__all__ = [
|
||||
@@ -26,7 +27,6 @@ __all__ = [
|
||||
"component_factory",
|
||||
"get_example",
|
||||
"IncompleteComponent",
|
||||
"InvalidCalendar",
|
||||
]
|
||||
|
||||
def get_example(component_directory: str, example_name: str) -> bytes: ...
|
||||
@@ -36,11 +36,6 @@ class ComponentFactory(CaselessDict[Incomplete]):
|
||||
|
||||
INLINE: CaselessDict[int]
|
||||
|
||||
class InvalidCalendar(ValueError): ...
|
||||
class IncompleteComponent(ValueError): ...
|
||||
|
||||
def create_utc_property(name: str, docs: str) -> property: ...
|
||||
|
||||
class Component(CaselessDict[Incomplete]):
|
||||
name: ClassVar[str | None]
|
||||
required: ClassVar[tuple[str, ...]]
|
||||
@@ -84,10 +79,14 @@ class Component(CaselessDict[Incomplete]):
|
||||
def DTSTAMP(self) -> datetime.datetime | None: ...
|
||||
@DTSTAMP.setter
|
||||
def DTSTAMP(self, value: datetime.datetime) -> None: ...
|
||||
@DTSTAMP.deleter
|
||||
def DTSTAMP(self) -> None: ...
|
||||
@property
|
||||
def LAST_MODIFIED(self) -> datetime.datetime | None: ...
|
||||
@LAST_MODIFIED.setter
|
||||
def LAST_MODIFIED(self, value: datetime.datetime) -> None: ...
|
||||
@LAST_MODIFIED.deleter
|
||||
def LAST_MODIFIED(self) -> None: ...
|
||||
def is_thunderbird(self) -> bool: ...
|
||||
|
||||
# type_def is a TypeForm
|
||||
@@ -105,14 +104,20 @@ class Event(Component):
|
||||
def DTSTART(self) -> datetime.date | datetime.datetime | None: ...
|
||||
@DTSTART.setter
|
||||
def DTSTART(self, value: datetime.date | datetime.datetime | None) -> None: ...
|
||||
@DTSTART.deleter
|
||||
def DTSTART(self) -> None: ...
|
||||
@property
|
||||
def DTEND(self) -> datetime.date | datetime.datetime | None: ...
|
||||
@DTEND.setter
|
||||
def DTEND(self, value: datetime.date | datetime.datetime | None) -> None: ...
|
||||
@DTEND.deleter
|
||||
def DTEND(self) -> None: ...
|
||||
@property
|
||||
def DURATION(self) -> datetime.timedelta | None: ...
|
||||
@DURATION.setter
|
||||
def DURATION(self, value: datetime.timedelta | None) -> None: ...
|
||||
@DURATION.deleter
|
||||
def DURATION(self) -> None: ...
|
||||
@property
|
||||
def duration(self) -> datetime.timedelta: ...
|
||||
@property
|
||||
@@ -127,10 +132,40 @@ class Event(Component):
|
||||
def X_MOZ_SNOOZE_TIME(self) -> datetime.datetime | None: ...
|
||||
@X_MOZ_SNOOZE_TIME.setter
|
||||
def X_MOZ_SNOOZE_TIME(self, value: datetime.datetime) -> None: ...
|
||||
@X_MOZ_SNOOZE_TIME.deleter
|
||||
def X_MOZ_SNOOZE_TIME(self) -> None: ...
|
||||
@property
|
||||
def X_MOZ_LASTACK(self) -> datetime.datetime | None: ...
|
||||
@X_MOZ_LASTACK.setter
|
||||
def X_MOZ_LASTACK(self, value: datetime.datetime) -> None: ...
|
||||
@X_MOZ_LASTACK.deleter
|
||||
def X_MOZ_LASTACK(self) -> None: ...
|
||||
@property
|
||||
def color(self) -> str: ...
|
||||
@color.setter
|
||||
def color(self, value: str) -> None: ...
|
||||
@color.deleter
|
||||
def color(self) -> None: ...
|
||||
@property
|
||||
def sequence(self) -> int: ...
|
||||
@sequence.setter
|
||||
def sequence(self, value: int) -> None: ...
|
||||
@sequence.deleter
|
||||
def sequence(self) -> None: ...
|
||||
@property
|
||||
def categories(self) -> list[str]: ...
|
||||
@categories.setter
|
||||
def categories(self, cats: list[str]) -> None: ...
|
||||
@categories.deleter
|
||||
def categories(self) -> None: ...
|
||||
@property
|
||||
def rdates(
|
||||
self,
|
||||
) -> list[tuple[datetime.date, None] | tuple[datetime.datetime, None] | tuple[datetime.datetime, datetime.datetime]]: ...
|
||||
@property
|
||||
def exdates(self) -> list[datetime.date | datetime.datetime]: ...
|
||||
@property
|
||||
def rrules(self) -> list[vRecur]: ...
|
||||
|
||||
class Todo(Component):
|
||||
name: ClassVar[Literal["VTODO"]]
|
||||
@@ -138,14 +173,20 @@ class Todo(Component):
|
||||
def DTSTART(self) -> datetime.datetime | datetime.date | None: ...
|
||||
@DTSTART.setter
|
||||
def DTSTART(self, value: datetime.datetime | datetime.date | None) -> None: ...
|
||||
@DTSTART.deleter
|
||||
def DTSTART(self) -> None: ...
|
||||
@property
|
||||
def DUE(self) -> datetime.datetime | datetime.date | None: ...
|
||||
@DUE.setter
|
||||
def DUE(self, value: datetime.datetime | datetime.date | None) -> None: ...
|
||||
@DUE.deleter
|
||||
def DUE(self) -> None: ...
|
||||
@property
|
||||
def DURATION(self) -> datetime.timedelta | None: ...
|
||||
@DURATION.setter
|
||||
def DURATION(self, value: datetime.timedelta | None) -> None: ...
|
||||
@DURATION.deleter
|
||||
def DURATION(self) -> None: ...
|
||||
@property
|
||||
def start(self) -> datetime.datetime | datetime.date: ...
|
||||
@start.setter
|
||||
@@ -160,12 +201,42 @@ class Todo(Component):
|
||||
def X_MOZ_SNOOZE_TIME(self) -> datetime.datetime | None: ...
|
||||
@X_MOZ_SNOOZE_TIME.setter
|
||||
def X_MOZ_SNOOZE_TIME(self, value: datetime.datetime) -> None: ...
|
||||
@X_MOZ_SNOOZE_TIME.deleter
|
||||
def X_MOZ_SNOOZE_TIME(self) -> None: ...
|
||||
@property
|
||||
def X_MOZ_LASTACK(self) -> datetime.datetime | None: ...
|
||||
@X_MOZ_LASTACK.setter
|
||||
def X_MOZ_LASTACK(self, value: datetime.datetime) -> None: ...
|
||||
@X_MOZ_LASTACK.deleter
|
||||
def X_MOZ_LASTACK(self) -> None: ...
|
||||
@property
|
||||
def alarms(self) -> Alarms: ...
|
||||
@property
|
||||
def color(self) -> str: ...
|
||||
@color.setter
|
||||
def color(self, value: str) -> None: ...
|
||||
@color.deleter
|
||||
def color(self) -> None: ...
|
||||
@property
|
||||
def sequence(self) -> int: ...
|
||||
@sequence.setter
|
||||
def sequence(self, value: int) -> None: ...
|
||||
@sequence.deleter
|
||||
def sequence(self) -> None: ...
|
||||
@property
|
||||
def categories(self) -> list[str]: ...
|
||||
@categories.setter
|
||||
def categories(self, cats: list[str]) -> None: ...
|
||||
@categories.deleter
|
||||
def categories(self) -> None: ...
|
||||
@property
|
||||
def rdates(
|
||||
self,
|
||||
) -> list[tuple[datetime.date, None] | tuple[datetime.datetime, None] | tuple[datetime.datetime, datetime.datetime]]: ...
|
||||
@property
|
||||
def exdates(self) -> list[datetime.date | datetime.datetime]: ...
|
||||
@property
|
||||
def rrules(self) -> list[vRecur]: ...
|
||||
|
||||
class Journal(Component):
|
||||
name: ClassVar[Literal["VJOURNAL"]]
|
||||
@@ -173,6 +244,8 @@ class Journal(Component):
|
||||
def DTSTART(self) -> datetime.date | datetime.datetime | None: ...
|
||||
@DTSTART.setter
|
||||
def DTSTART(self, value: datetime.date | datetime.datetime | None) -> None: ...
|
||||
@DTSTART.deleter
|
||||
def DTSTART(self) -> None: ...
|
||||
@property
|
||||
def start(self) -> datetime.date | datetime.datetime: ...
|
||||
@start.setter
|
||||
@@ -180,11 +253,38 @@ class Journal(Component):
|
||||
end = start
|
||||
@property
|
||||
def duration(self) -> datetime.timedelta: ...
|
||||
@property
|
||||
def color(self) -> str: ...
|
||||
@color.setter
|
||||
def color(self, value: str) -> None: ...
|
||||
@color.deleter
|
||||
def color(self) -> None: ...
|
||||
@property
|
||||
def sequence(self) -> int: ...
|
||||
@sequence.setter
|
||||
def sequence(self, value: int) -> None: ...
|
||||
@sequence.deleter
|
||||
def sequence(self) -> None: ...
|
||||
@property
|
||||
def categories(self) -> list[str]: ...
|
||||
@categories.setter
|
||||
def categories(self, cats: list[str]) -> None: ...
|
||||
@categories.deleter
|
||||
def categories(self) -> None: ...
|
||||
@property
|
||||
def rdates(
|
||||
self,
|
||||
) -> list[tuple[datetime.date, None] | tuple[datetime.datetime, None] | tuple[datetime.datetime, datetime.datetime]]: ...
|
||||
@property
|
||||
def exdates(self) -> list[datetime.date | datetime.datetime]: ...
|
||||
@property
|
||||
def rrules(self) -> list[vRecur]: ...
|
||||
|
||||
class FreeBusy(Component):
|
||||
name: ClassVar[Literal["VFREEBUSY"]]
|
||||
|
||||
class Timezone(Component):
|
||||
subcomponents: list[TimezoneStandard | TimezoneDaylight]
|
||||
name: ClassVar[Literal["VTIMEZONE"]]
|
||||
@classmethod
|
||||
def example(cls, name: str = "pacific_fiji") -> Calendar: ...
|
||||
@@ -209,14 +309,28 @@ class TimezoneStandard(Component):
|
||||
def DTSTART(self) -> datetime.date | datetime.datetime | None: ...
|
||||
@DTSTART.setter
|
||||
def DTSTART(self, value: datetime.date | datetime.datetime | None) -> None: ...
|
||||
@DTSTART.deleter
|
||||
def DTSTART(self) -> None: ...
|
||||
@property
|
||||
def TZOFFSETTO(self) -> datetime.timedelta | None: ...
|
||||
@TZOFFSETTO.setter
|
||||
def TZOFFSETTO(self, value: datetime.timedelta | None) -> None: ...
|
||||
@TZOFFSETTO.deleter
|
||||
def TZOFFSETTO(self) -> None: ...
|
||||
@property
|
||||
def TZOFFSETFROM(self) -> datetime.timedelta | None: ...
|
||||
@TZOFFSETFROM.setter
|
||||
def TZOFFSETFROM(self, value: datetime.timedelta | None) -> None: ...
|
||||
@TZOFFSETFROM.deleter
|
||||
def TZOFFSETFROM(self) -> None: ...
|
||||
@property
|
||||
def rdates(
|
||||
self,
|
||||
) -> list[tuple[datetime.date, None] | tuple[datetime.datetime, None] | tuple[datetime.datetime, datetime.datetime]]: ...
|
||||
@property
|
||||
def exdates(self) -> list[datetime.date | datetime.datetime]: ...
|
||||
@property
|
||||
def rrules(self) -> list[vRecur]: ...
|
||||
|
||||
class TimezoneDaylight(Component):
|
||||
name: ClassVar[Literal["DAYLIGHT"]]
|
||||
@@ -224,14 +338,28 @@ class TimezoneDaylight(Component):
|
||||
def DTSTART(self) -> datetime.date | datetime.datetime | None: ...
|
||||
@DTSTART.setter
|
||||
def DTSTART(self, value: datetime.date | datetime.datetime | None) -> None: ...
|
||||
@DTSTART.deleter
|
||||
def DTSTART(self) -> None: ...
|
||||
@property
|
||||
def TZOFFSETTO(self) -> datetime.timedelta | None: ...
|
||||
@TZOFFSETTO.setter
|
||||
def TZOFFSETTO(self, value: datetime.timedelta | None) -> None: ...
|
||||
@TZOFFSETTO.deleter
|
||||
def TZOFFSETTO(self) -> None: ...
|
||||
@property
|
||||
def TZOFFSETFROM(self) -> datetime.timedelta | None: ...
|
||||
@TZOFFSETFROM.setter
|
||||
def TZOFFSETFROM(self, value: datetime.timedelta | None) -> None: ...
|
||||
@TZOFFSETFROM.deleter
|
||||
def TZOFFSETFROM(self) -> None: ...
|
||||
@property
|
||||
def rdates(
|
||||
self,
|
||||
) -> list[tuple[datetime.date, None] | tuple[datetime.datetime, None] | tuple[datetime.datetime, datetime.datetime]]: ...
|
||||
@property
|
||||
def exdates(self) -> list[datetime.date | datetime.datetime]: ...
|
||||
@property
|
||||
def rrules(self) -> list[vRecur]: ...
|
||||
|
||||
class Alarm(Component):
|
||||
name: ClassVar[Literal["VALARM"]]
|
||||
@@ -239,18 +367,26 @@ class Alarm(Component):
|
||||
def REPEAT(self) -> int: ...
|
||||
@REPEAT.setter
|
||||
def REPEAT(self, value: int) -> None: ...
|
||||
@REPEAT.deleter
|
||||
def REPEAT(self) -> None: ...
|
||||
@property
|
||||
def DURATION(self) -> datetime.timedelta | None: ...
|
||||
@DURATION.setter
|
||||
def DURATION(self, value: datetime.timedelta | None) -> None: ...
|
||||
@DURATION.deleter
|
||||
def DURATION(self) -> None: ...
|
||||
@property
|
||||
def ACKNOWLEDGED(self) -> datetime.datetime | None: ...
|
||||
@ACKNOWLEDGED.setter
|
||||
def ACKNOWLEDGED(self, value: datetime.datetime | None) -> None: ...
|
||||
@ACKNOWLEDGED.deleter
|
||||
def ACKNOWLEDGED(self) -> None: ...
|
||||
@property
|
||||
def TRIGGER(self) -> datetime.timedelta | datetime.datetime | None: ...
|
||||
@TRIGGER.setter
|
||||
def TRIGGER(self, value: datetime.timedelta | datetime.datetime | None) -> None: ...
|
||||
@TRIGGER.deleter
|
||||
def TRIGGER(self) -> None: ...
|
||||
@property
|
||||
def TRIGGER_RELATED(self) -> Literal["START", "END"]: ...
|
||||
@TRIGGER_RELATED.setter
|
||||
@@ -269,6 +405,8 @@ class Calendar(Component):
|
||||
@classmethod
|
||||
def example(cls, name: str = "example") -> Calendar: ...
|
||||
@property
|
||||
def freebusy(self) -> list[FreeBusy]: ...
|
||||
@property
|
||||
def events(self) -> list[Event]: ...
|
||||
@property
|
||||
def todos(self) -> list[Todo]: ...
|
||||
@@ -277,6 +415,30 @@ class Calendar(Component):
|
||||
@property
|
||||
def timezones(self) -> list[Timezone]: ...
|
||||
def add_missing_timezones(self, first_date: datetime.date = ..., last_date: datetime.date = ...) -> None: ...
|
||||
@property
|
||||
def calendar_name(self) -> str | None: ...
|
||||
@calendar_name.setter
|
||||
def calendar_name(self, value: str) -> None: ...
|
||||
@calendar_name.deleter
|
||||
def calendar_name(self) -> None: ...
|
||||
@property
|
||||
def description(self) -> str | None: ...
|
||||
@description.setter
|
||||
def description(self, value: str) -> None: ...
|
||||
@description.deleter
|
||||
def description(self) -> None: ...
|
||||
@property
|
||||
def color(self) -> str: ...
|
||||
@color.setter
|
||||
def color(self, value: str) -> None: ...
|
||||
@color.deleter
|
||||
def color(self) -> None: ...
|
||||
@property
|
||||
def categories(self) -> list[str]: ...
|
||||
@categories.setter
|
||||
def categories(self, cats: list[str]) -> None: ...
|
||||
@categories.deleter
|
||||
def categories(self) -> None: ...
|
||||
|
||||
types_factory: Final[TypesFactory]
|
||||
component_factory: Final[ComponentFactory]
|
||||
|
||||
@@ -0,0 +1,44 @@
|
||||
from enum import Enum
|
||||
|
||||
class PARTSTAT(Enum):
|
||||
NEEDS_ACTION = "NEEDS-ACTION"
|
||||
ACCEPTED = "ACCEPTED"
|
||||
DECLINED = "DECLINED"
|
||||
TENTATIVE = "TENTATIVE"
|
||||
DELEGATED = "DELEGATED"
|
||||
COMPLETED = "COMPLETED"
|
||||
IN_PROCESS = "IN-PROCESS"
|
||||
|
||||
class FBTYPE(Enum):
|
||||
FREE = "FREE"
|
||||
BUSY = "BUSY"
|
||||
BUSY_UNAVAILABLE = "BUSY-UNAVAILABLE"
|
||||
BUSY_TENTATIVE = "BUSY-TENTATIVE"
|
||||
|
||||
class CUTYPE(Enum):
|
||||
INDIVIDUAL = "INDIVIDUAL"
|
||||
GROUP = "GROUP"
|
||||
RESOURCE = "RESOURCE"
|
||||
ROOM = "ROOM"
|
||||
UNKNOWN = "UNKNOWN"
|
||||
|
||||
class RELTYPE(Enum):
|
||||
PARENT = "PARENT"
|
||||
CHILD = "CHILD"
|
||||
SIBLING = "SIBLING"
|
||||
|
||||
class RANGE(Enum):
|
||||
THISANDFUTURE = "THISANDFUTURE"
|
||||
THISANDPRIOR = "THISANDPRIOR" # deprecated
|
||||
|
||||
class RELATED(Enum):
|
||||
START = "START"
|
||||
END = "END"
|
||||
|
||||
class ROLE(Enum):
|
||||
CHAIR = "CHAIR"
|
||||
REQ_PARTICIPANT = "REQ-PARTICIPANT"
|
||||
OPT_PARTICIPANT = "OPT-PARTICIPANT"
|
||||
NON_PARTICIPANT = "NON-PARTICIPANT"
|
||||
|
||||
__all__ = ["PARTSTAT", "FBTYPE", "CUTYPE", "RANGE", "RELATED", "ROLE", "RELTYPE"]
|
||||
@@ -0,0 +1,15 @@
|
||||
class InvalidCalendar(ValueError): ...
|
||||
class IncompleteComponent(ValueError): ...
|
||||
class IncompleteAlarmInformation(ValueError): ...
|
||||
class LocalTimezoneMissing(IncompleteAlarmInformation): ...
|
||||
class ComponentEndMissing(IncompleteAlarmInformation): ...
|
||||
class ComponentStartMissing(IncompleteAlarmInformation): ...
|
||||
|
||||
__all__ = [
|
||||
"InvalidCalendar",
|
||||
"IncompleteComponent",
|
||||
"IncompleteAlarmInformation",
|
||||
"LocalTimezoneMissing",
|
||||
"ComponentEndMissing",
|
||||
"ComponentStartMissing",
|
||||
]
|
||||
@@ -0,0 +1,62 @@
|
||||
from collections.abc import Callable
|
||||
from typing import TypeVar
|
||||
|
||||
from .parser import Parameters
|
||||
|
||||
class IcalendarProperty:
|
||||
params: Parameters
|
||||
|
||||
_T = TypeVar("_T")
|
||||
|
||||
def string_parameter(
|
||||
name: str,
|
||||
doc: str,
|
||||
default: Callable[..., str | None] = ...,
|
||||
convert: Callable[[str], _T] | None = None,
|
||||
convert_to: Callable[[_T], str] | None = None,
|
||||
) -> property: ...
|
||||
|
||||
ALTREP: property
|
||||
CN: property
|
||||
CUTYPE: property
|
||||
|
||||
def quoted_list_parameter(name: str, doc: str) -> property: ...
|
||||
|
||||
DELEGATED_FROM: property
|
||||
DELEGATED_TO: property
|
||||
DIR: property
|
||||
FBTYPE: property
|
||||
LANGUAGE: property
|
||||
MEMBER: property
|
||||
PARTSTAT: property
|
||||
RANGE: property
|
||||
RELATED: property
|
||||
ROLE: property
|
||||
|
||||
def boolean_parameter(name: str, default: bool, doc: str) -> property: ...
|
||||
|
||||
RSVP: property
|
||||
SENT_BY: property
|
||||
TZID: property
|
||||
RELTYPE: property
|
||||
|
||||
__all__ = [
|
||||
"string_parameter",
|
||||
"quoted_list_parameter",
|
||||
"ALTREP",
|
||||
"CN",
|
||||
"CUTYPE",
|
||||
"DELEGATED_FROM",
|
||||
"DELEGATED_TO",
|
||||
"DIR",
|
||||
"FBTYPE",
|
||||
"LANGUAGE",
|
||||
"MEMBER",
|
||||
"PARTSTAT",
|
||||
"RANGE",
|
||||
"RELATED",
|
||||
"ROLE",
|
||||
"RSVP",
|
||||
"SENT_BY",
|
||||
"TZID",
|
||||
]
|
||||
@@ -2,10 +2,11 @@ from _collections_abc import dict_keys
|
||||
from _typeshed import Incomplete
|
||||
from collections.abc import Iterable
|
||||
from re import Pattern
|
||||
from typing import AnyStr, Final, overload
|
||||
from typing import AnyStr, ClassVar, Final, overload
|
||||
from typing_extensions import Self
|
||||
|
||||
from .caselessdict import CaselessDict
|
||||
from .parser_tools import ICAL_TYPE
|
||||
|
||||
__all__ = [
|
||||
"Contentline",
|
||||
@@ -24,6 +25,8 @@ __all__ = [
|
||||
"param_value",
|
||||
"q_join",
|
||||
"q_split",
|
||||
"rfc_6868_escape",
|
||||
"rfc_6868_unescape",
|
||||
"uFOLD",
|
||||
"unescape_char",
|
||||
"unescape_list_or_string",
|
||||
@@ -35,7 +38,7 @@ __all__ = [
|
||||
def escape_char(text: str) -> str: ...
|
||||
def unescape_char(text: AnyStr) -> AnyStr: ...
|
||||
def foldline(line: str, limit: int = 75, fold_sep: str = "\r\n ") -> str: ...
|
||||
def param_value(value: str | list[str] | tuple[str, ...] | Incomplete) -> str: ...
|
||||
def param_value(value: str | list[str] | tuple[str, ...] | Incomplete, always_quote: bool = False) -> str: ...
|
||||
|
||||
NAME: Final[Pattern[str]]
|
||||
UNSAFE_CHAR: Final[Pattern[str]]
|
||||
@@ -49,11 +52,12 @@ def validate_param_value(value: str, quoted: bool = True) -> None: ...
|
||||
|
||||
QUOTABLE: Final[Pattern[str]]
|
||||
|
||||
def dquote(val: str) -> str: ...
|
||||
def dquote(val: str, always_quote: bool = False) -> str: ...
|
||||
def q_split(st: str, sep: str = ",", maxsplit: int = -1) -> list[str]: ...
|
||||
def q_join(lst: Iterable[str], sep: str = ",") -> str: ...
|
||||
def q_join(lst: Iterable[str], sep: str = ",", always_quote: bool = False) -> str: ...
|
||||
|
||||
class Parameters(CaselessDict[str]):
|
||||
always_quoted: ClassVar[tuple[str, ...]]
|
||||
def params(self) -> dict_keys[str, str]: ...
|
||||
def to_ical(self, sorted: bool = True) -> bytes: ...
|
||||
@classmethod
|
||||
@@ -61,6 +65,14 @@ class Parameters(CaselessDict[str]):
|
||||
|
||||
def escape_string(val: str) -> str: ...
|
||||
def unescape_string(val: str) -> str: ...
|
||||
|
||||
RFC_6868_UNESCAPE_REGEX: Final[Pattern[str]]
|
||||
|
||||
def rfc_6868_unescape(param_value: str) -> str: ...
|
||||
|
||||
RFC_6868_ESCAPE_REGEX: Final[Pattern[str]]
|
||||
|
||||
def rfc_6868_escape(param_value: str) -> str: ...
|
||||
@overload
|
||||
def unescape_list_or_string(val: list[str]) -> list[str]: ...
|
||||
@overload
|
||||
@@ -70,7 +82,7 @@ class Contentline(str):
|
||||
strict: bool
|
||||
def __new__(cls, value: str | bytes, strict: bool = False, encoding: str = ...) -> Self: ...
|
||||
@classmethod
|
||||
def from_parts(cls, name: str, params: Parameters, values, sorted: bool = True) -> Self: ...
|
||||
def from_parts(cls, name: ICAL_TYPE, params: Parameters, values, sorted: bool = True) -> Self: ...
|
||||
def parts(self) -> tuple[str, Parameters, str]: ...
|
||||
@classmethod
|
||||
def from_ical(cls, ical: str | bytes, strict: bool = False) -> Self: ...
|
||||
|
||||
@@ -16,6 +16,7 @@ __all__ = [
|
||||
"TimeBase",
|
||||
"TypesFactory",
|
||||
"WEEKDAY_RULE",
|
||||
"tzid_from_dt",
|
||||
"vBinary",
|
||||
"vBoolean",
|
||||
"vCalAddress",
|
||||
@@ -33,14 +34,13 @@ __all__ = [
|
||||
"vMonth",
|
||||
"vPeriod",
|
||||
"vRecur",
|
||||
"vSkip",
|
||||
"vText",
|
||||
"vTime",
|
||||
"vUTCOffset",
|
||||
"vUri",
|
||||
"vWeekday",
|
||||
"tzid_from_dt",
|
||||
"tzid_from_tzinfo",
|
||||
"vSkip",
|
||||
]
|
||||
|
||||
_PropType: TypeAlias = type[Any] # any of the v* classes in this file
|
||||
@@ -77,6 +77,9 @@ class vText(str):
|
||||
def to_ical(self) -> bytes: ...
|
||||
@classmethod
|
||||
def from_ical(cls, ical: ICAL_TYPE) -> Self: ...
|
||||
ALTREP: property
|
||||
LANGUAGE: property
|
||||
RELTYPE: property
|
||||
|
||||
class vCalAddress(str):
|
||||
params: Parameters
|
||||
@@ -90,6 +93,18 @@ class vCalAddress(str):
|
||||
def name(self) -> str: ...
|
||||
@name.setter
|
||||
def name(self, value: str) -> None: ...
|
||||
@name.deleter
|
||||
def name(self) -> None: ...
|
||||
CN: property
|
||||
CUTYPE: property
|
||||
DELEGATED_FROM: property
|
||||
DELEGATED_TO: property
|
||||
DIR: property
|
||||
LANGUAGE: property
|
||||
PARTSTAT: property
|
||||
ROLE: property
|
||||
RSVP: property
|
||||
SENT_BY: property
|
||||
|
||||
class vFloat(float):
|
||||
params: Parameters
|
||||
@@ -123,10 +138,16 @@ class vCategory:
|
||||
@staticmethod
|
||||
def from_ical(ical: ICAL_TYPE) -> str: ...
|
||||
def __eq__(self, other: object) -> bool: ...
|
||||
RANGE: property
|
||||
RELATED: property
|
||||
TZID: property
|
||||
|
||||
class TimeBase:
|
||||
def __eq__(self, other: object) -> bool: ...
|
||||
def __hash__(self) -> int: ...
|
||||
RANGE: property
|
||||
RELATED: property
|
||||
TZID: property
|
||||
|
||||
class vDDDTypes(TimeBase):
|
||||
params: Parameters
|
||||
@@ -186,6 +207,7 @@ class vPeriod(TimeBase):
|
||||
def from_ical(ical: str, timezone: datetime.timezone | str | None = None) -> tuple[Any, Any]: ...
|
||||
@property
|
||||
def dt(self) -> _PeriodTuple: ...
|
||||
FBTYPE: property
|
||||
|
||||
class vWeekday(str):
|
||||
week_days: Final[CaselessDict[int]]
|
||||
@@ -221,7 +243,7 @@ class vSkip(vText, Enum):
|
||||
FORWARD = "FORWARD"
|
||||
BACKWARD = "BACKWARD"
|
||||
|
||||
def __reduce_ex__(self, proto: Unused) -> tuple[Any, ...]: ...
|
||||
def __reduce_ex__(self, _p: Unused) -> tuple[Self, tuple[str]]: ...
|
||||
|
||||
# The type of the values depend on the key. Each key maps to a v* class, and
|
||||
# the allowed types are the types that the corresponding v* class can parse.
|
||||
|
||||
Reference in New Issue
Block a user