diff --git a/stubs/vobject/METADATA.toml b/stubs/vobject/METADATA.toml index aeece27cafe4..554c827f2b8a 100644 --- a/stubs/vobject/METADATA.toml +++ b/stubs/vobject/METADATA.toml @@ -1,2 +1,2 @@ -version = "~=0.9.9" +version = "~=0.9.10" upstream-repository = "https://github.com/py-vobject/vobject" diff --git a/stubs/vobject/vobject/__init__.pyi b/stubs/vobject/vobject/__init__.pyi index bda5a171276a..c9893323ae2c 100644 --- a/stubs/vobject/vobject/__init__.pyi +++ b/stubs/vobject/vobject/__init__.pyi @@ -1,5 +1,9 @@ +from typing import Final + from . import icalendar as icalendar, vcard as vcard -from .base import VERSION as VERSION, Component, readComponents as readComponents, readOne as readOne +from .base import Component, readComponents as readComponents, readOne as readOne + +VERSION: Final[str] def iCalendar() -> Component: ... def vCard() -> Component: ... diff --git a/stubs/vobject/vobject/base.pyi b/stubs/vobject/vobject/base.pyi index 3c48123e7fbc..5a9dacd21b96 100644 --- a/stubs/vobject/vobject/base.pyi +++ b/stubs/vobject/vobject/base.pyi @@ -8,8 +8,6 @@ from typing_extensions import Self _V = TypeVar("_V", bound=VBase) _W = TypeVar("_W", bound=SupportsWrite[bytes]) -VERSION: Final[str] - def to_unicode(value: str | bytes | bytearray) -> str: ... def to_basestring(s: str | bytes) -> bytes: ... @@ -21,6 +19,7 @@ CRLF: str SPACE: str TAB: str SPACEORTAB: str +DEFAULT_MAX_NESTING: Final = 100 class VBase: group: Incomplete | None @@ -157,10 +156,16 @@ class Stack: def pop(self): ... def readComponents( - streamOrString, validate: bool = False, transform: bool = True, ignoreUnreadable: bool = False, allowQP: bool = False + streamOrString, + validate: bool = False, + transform: bool = True, + ignoreUnreadable: bool = False, + allowQP: bool = False, + max_nesting: int = 100, ) -> Iterator[Component]: ... def readOne(stream, validate: bool = False, transform: bool = True, ignoreUnreadable: bool = False, allowQP: bool = False): ... def registerBehavior(behavior, name: str | None = None, default: bool = False, id=None) -> None: ... def getBehavior(name: str, id=None): ... def newFromBehavior(name: str, id=None) -> Component | ContentLine: ... def backslashEscape(s: str) -> str: ... +def get_prodid() -> str: ... diff --git a/stubs/vobject/vobject/errors.pyi b/stubs/vobject/vobject/errors.pyi new file mode 100644 index 000000000000..974c7c56318c --- /dev/null +++ b/stubs/vobject/vobject/errors.pyi @@ -0,0 +1,15 @@ +from _typeshed import Incomplete + +class VObjectError(Exception): + msg: str + lineNumber: int + def __init__(self, msg: str, line_number: int | None = None) -> None: ... + +class ParseError(VObjectError): + inputs: Incomplete + def __init__(self, msg: str, line_number: int | None = None, *, inputs=None) -> None: ... + +class ValidateError(VObjectError): ... +class NativeError(VObjectError): ... +class AmbiguousTimeError(VObjectError): ... +class NonExistentTimeError(VObjectError): ... diff --git a/stubs/vobject/vobject/icalendar.pyi b/stubs/vobject/vobject/icalendar.pyi index 72287e03803b..0aeea44cd083 100644 --- a/stubs/vobject/vobject/icalendar.pyi +++ b/stubs/vobject/vobject/icalendar.pyi @@ -10,7 +10,6 @@ from .behavior import Behavior DATENAMES: Final[tuple[str, ...]] RULENAMES: Final[tuple[str, ...]] DATESANDRULES: Final[tuple[str, ...]] -PRODID: Final[str] WEEKDAYS: Final[tuple[str, ...]] FREQUENCIES: Final[tuple[str, ...]] ZERO_DELTA: Final[timedelta] @@ -43,7 +42,7 @@ class TimezoneComponent(Component): normal_attributes: Incomplete @staticmethod def pickTzid(tzinfo, allowUTC: bool = False) -> str | None: ... - def prettyPrint(self, level: int, tabwidth: int) -> None: ... # type: ignore[override] + def prettyPrint(self, level: int = 0, tabwidth: int = 3) -> None: ... class RecurringComponent(Component): isNative: bool