Esempio n. 1
0
 def parse_due(todo: "Todo", line: ContentLine):
     if line:
         # TODO: DRY [1]
         if todo._duration:
             raise ValueError("A todo can't have both DUE and DURATION")
         # get the dict of vtimezones passed to the classmethod
         tz_dict = todo._classmethod_kwargs["tz"]
         todo._due_time = iso_to_arrow(line, tz_dict)
Esempio n. 2
0
 def parse_dtend(event, line):
     if line:
         # TODO: DRY [1]
         if event._duration:
             raise ValueError("An event can't have both DTEND and DURATION")
         # get the dict of vtimezones passed to the classmethod
         tz_dict = event._classmethod_kwargs["tz"]
         event._end_time = iso_to_arrow(line, tz_dict)
Esempio n. 3
0
 def parse_trigger(alarm, line):
     if line.params.get("VALUE", [""])[0] == "DATE-TIME":
         alarm.trigger = iso_to_arrow(line)
     elif line.params.get("VALUE", ["DURATION"])[0] == "DURATION":
         alarm.trigger = parse_duration(line.value)
     else:
         warnings.warn(
             "recurrent_ics.py encountered a TRIGGER of unknown type '%s'. It has been ignored."
             % line.params["VALUE"][0]
         )
Esempio n. 4
0
 def parse_dtstart(event, line):
     if line:
         # get the dict of vtimezones passed to the classmethod
         tz_dict = event._classmethod_kwargs["tz"]
         event.begin = iso_to_arrow(line, tz_dict)
         event._begin_precision = iso_precision(line.value)
Esempio n. 5
0
 def parse_last_modified(event, line):
     if line:
         tz_dict = event._classmethod_kwargs["tz"]
         event.last_modified = iso_to_arrow(line, tz_dict)
Esempio n. 6
0
 def parse_dtstamp(event, line):
     if line:
         # get the dict of vtimezones passed to the classmethod
         tz_dict = event._classmethod_kwargs["tz"]
         event.created = iso_to_arrow(line, tz_dict)
Esempio n. 7
0
 def parse_dtstart(todo: "Todo", line: ContentLine):
     if line:
         # get the dict of vtimezones passed to the classmethod
         tz_dict = todo._classmethod_kwargs["tz"]
         todo.begin = iso_to_arrow(line, tz_dict)