示例#1
0
 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
示例#2
0
 def parse_description(event, line):
     event.description = unescape_string(line.value) if line else None
示例#3
0
 def parse_summary(event, line):
     event.name = unescape_string(line.value) if line else None
示例#4
0
 def parse_url(todo: "Todo", line: ContentLine):
     todo.url = unescape_string(line.value) if line else None
示例#5
0
 def parse_summary(todo: "Todo", line: ContentLine):
     todo.name = unescape_string(line.value) if line else None
示例#6
0
 def parse_location(todo: "Todo", line: ContentLine):
     todo.location = unescape_string(line.value) if line else None
示例#7
0
 def parse_description(alarm, line):
     alarm.body = unescape_string(line.value) if line else None
示例#8
0
 def parse_url(event, line):
     event.url = unescape_string(line.value) if line else None
示例#9
0
 def parse_cn(person: "Person", value):
     if value:
         person.common_name = unescape_string(value)
示例#10
0
 def parse_cutype(attendee: "Attendee", value):
     if value:
         attendee.cutype = unescape_string(value)
示例#11
0
 def parse_partstat(attendee: "Attendee", value):
     if value:
         attendee.partstat = unescape_string(value)
示例#12
0
 def parse_role(attendee: "Attendee", value):
     if value:
         attendee.role = unescape_string(value)
示例#13
0
 def parse_sent_by(person: "Person", value):
     if value:
         person.sent_by = unescape_string(value)
示例#14
0
 def parse_summary(alarm, line):
     alarm.subject = unescape_string(line.value) if line else None
示例#15
0
 def parse_location(event, line):
     event.location = unescape_string(line.value) if line else None
示例#16
0
 def parse_geo(event, line):
     if line:
         latitude, _, longitude = unescape_string(line.value).partition(";")
         event.geo = float(latitude), float(longitude)
示例#17
0
 def parse_dir(person: "Person", value):
     if value:
         person.dir = unescape_string(value)
示例#18
0
 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)})
示例#19
0
 def parse_description(alarm, line):
     alarm.display_text = unescape_string(line.value) if line else None