def parse(cls, line: ContentLine) -> "Person": email = unescape_string(line.value) if email.lower().startswith("mailto:"): email = email[len("mailto:"):] val = cls(email) val.populate(line) return val
def parse_description(event, line): event.description = unescape_string(line.value) if line else None
def parse_summary(event, line): event.name = unescape_string(line.value) if line else None
def parse_url(todo: "Todo", line: ContentLine): todo.url = unescape_string(line.value) if line else None
def parse_summary(todo: "Todo", line: ContentLine): todo.name = unescape_string(line.value) if line else None
def parse_location(todo: "Todo", line: ContentLine): todo.location = unescape_string(line.value) if line else None
def parse_description(alarm, line): alarm.body = unescape_string(line.value) if line else None
def parse_url(event, line): event.url = unescape_string(line.value) if line else None
def parse_cn(person: "Person", value): if value: person.common_name = unescape_string(value)
def parse_cutype(attendee: "Attendee", value): if value: attendee.cutype = unescape_string(value)
def parse_partstat(attendee: "Attendee", value): if value: attendee.partstat = unescape_string(value)
def parse_role(attendee: "Attendee", value): if value: attendee.role = unescape_string(value)
def parse_sent_by(person: "Person", value): if value: person.sent_by = unescape_string(value)
def parse_summary(alarm, line): alarm.subject = unescape_string(line.value) if line else None
def parse_location(event, line): event.location = unescape_string(line.value) if line else None
def parse_geo(event, line): if line: latitude, _, longitude = unescape_string(line.value).partition(";") event.geo = float(latitude), float(longitude)
def parse_dir(person: "Person", value): if value: person.dir = unescape_string(value)
def parse_categories(event, line): event.categories = set() if line: # In the regular expression: Only match unquoted commas. for cat in re.split("(?<!\\\\),", line.value): event.categories.update({unescape_string(cat)})
def parse_description(alarm, line): alarm.display_text = unescape_string(line.value) if line else None