Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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/vobject/METADATA.toml
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
version = "~=0.9.9"
version = "~=0.9.10"
upstream-repository = "https://github.com/py-vobject/vobject"
6 changes: 5 additions & 1 deletion stubs/vobject/vobject/__init__.pyi
Original file line number Diff line number Diff line change
@@ -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: ...
11 changes: 8 additions & 3 deletions stubs/vobject/vobject/base.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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: ...

Expand All @@ -21,6 +19,7 @@ CRLF: str
SPACE: str
TAB: str
SPACEORTAB: str
DEFAULT_MAX_NESTING: Final = 100

class VBase:
group: Incomplete | None
Expand Down Expand Up @@ -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: ...
15 changes: 15 additions & 0 deletions stubs/vobject/vobject/errors.pyi
Original file line number Diff line number Diff line change
@@ -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): ...
3 changes: 1 addition & 2 deletions stubs/vobject/vobject/icalendar.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down Expand Up @@ -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
Expand Down
Loading