icalendar.prop.request_status module#
vRequestStatus is a subclass of vText with convenience methods.
- class icalendar.prop.request_status.vRequestStatus(value, encoding='utf-8', /, params=None)[source]#
Bases:
vTextA text specifically for REQUEST-STATUS.
See RFC 5545 Section 3.8.8.3, RFC 6321 Appendix A in subsection 3.8.8.3 Request Status and, RFC 7265 Section 3.4.1.2.
Examples
The attributes of a valid request status return the parsed data.
>>> from icalendar.prop import vRequestStatus >>> r = vRequestStatus("2.0;Success") >>> r.code (2, 0) >>> r.description 'Success' >>> r.data is None True
An invalid
codeis indicated by an empty tuple and an empty description.>>> r = vRequestStatus("2.10;invalid") >>> r.code () >>> r.description '' >>> r.data is None True
- property code: tuple[int, int] | tuple[int, int, int] | tuple[()]#
Return the status code as a tuple.
- Returns:
A tuple of integers or
()if the status code could not be parsed.
- property code_string: str#
Return the status code as a string.
- Returns:
The status string or
""if the request status could not be parsed.
- property data: str | None#
Return the data of the request status.
- Returns:
The data of the request status or
None.
- property description: str#
Return the description of the request status.
- Returns:
The description of the request status or
""if the request status could not be parsed.
- encoding#
- classmethod from_jcal(jcal_property)[source]#
Parse jCal from RFC 7265.
- Parameters:
jcal_property (
list) – The jCal property to parse.- Raises:
JCalParsingError – If the provided jCal is invalid.
- Return type:
- classmethod from_xcal(xml)[source]#
Parse xCal from RFC 6321.
- Parameters:
xml (
XCalParser|ElementAdapter|Element) – The XML to parse or a parser.- Raises:
XCalParsingError – If the provided xCal is invalid.
- Return type:
VProp
- classmethod new(code, description='', data=None, *, params=None, validate=True)[source]#
Create a new request status object.
- Parameters:
- Raises:
InvalidCalendar – If the code is not valid.
TypeError – If the code is neither a tuple of integers nor string.
- Return type:
- Returns:
A new request status object.
- params: Parameters#