Skip to content
Open
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
1 change: 1 addition & 0 deletions news/1072.documentation.5
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Corrected the xCal parser parameter documentation for UNKNOWN property values; used OpenAI GPT-6 to draft and check the wording. @sshnox
16 changes: 12 additions & 4 deletions src/icalendar/prop/unknown.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,14 @@ def from_xcal(cls, parser: XCalParser, params: Parameters) -> Self:
"""Parse xCal from :rfc:`6321`.

Parameters:
xml: The XML to parse or a parser.
parser: The xCal parser containing the UNKNOWN value.
params: The property parameters to update with the UNKNOWN value type.

Returns:
The parsed UNKNOWN property value.

Raises:
~error.XCalParsingError: If the provided xCal is invalid.
~icalendar.error.XCalParsingError: If the provided xCal is invalid.
"""
element = parser.parse_tag(cls.default_value)
params.value = cls.default_value # UNKNOWN is never the default type
Expand All @@ -200,10 +204,14 @@ def from_first_xcal_element(cls, parser: XCalParser, params: Parameters) -> Self
This class is used as a fallback if no other type can parse this.

Parameters:
xml: The XML to parse or a parser.
parser: The xCal parser containing the UNKNOWN value.
params: The property parameters to update with the UNKNOWN value type.

Returns:
The parsed UNKNOWN property value.

Raises:
~error.XCalParsingError: If the provided xCal is invalid.
~icalendar.error.XCalParsingError: If the provided xCal is invalid.
"""
element = parser.parse_tag()
params.value = element.tag.upper() # set the VALUE parameter
Expand Down
Loading