Esempio n. 1
0
 def parse1_dtstart(event: "Event", line: ContentLine):
     if line:
         # get the dict of vtimezones passed to the classmethod
         tz_dict = event._classmethod_kwargs["tz"]
         event._timespan = event._timespan.replace(
             begin_time=parse_datetime(line, tz_dict),
             precision=iso_precision(line.value))
Esempio n. 2
0
 def parse_trigger(alarm: "BaseAlarm", line: ContentLine):
     if line.params.get("VALUE", [""])[0] == "DATE-TIME":
         alarm.trigger = parse_datetime(line)
     elif line.params.get("VALUE", ["DURATION"])[0] == "DURATION":
         alarm.trigger = parse_duration(line.value)
     else:
         warnings.warn(
             "ics.py encountered a TRIGGER of unknown type '%s'. It has been ignored."
             % line.params["VALUE"][0])
Esempio n. 3
0
 def parse_due(todo: "Todo", line: ContentLine):
     if line:
         tz_dict = todo._classmethod_kwargs["tz"]
         todo._timespan = todo._timespan.replace(
             end_time=parse_datetime(line, tz_dict))
Esempio n. 4
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._timespan = todo._timespan.replace(
             begin_time=parse_datetime(line, tz_dict))
Esempio n. 5
0
 def parse_created(todo: "Todo", line: ContentLine):
     if line:
         # get the dict of vtimezones passed to the classmethod
         tz_dict = todo._classmethod_kwargs["tz"]
         todo.created = parse_datetime(line, tz_dict)
Esempio n. 6
0
 def parse_last_modified(todo: "Todo", line: ContentLine):
     if line:
         tz_dict = todo._classmethod_kwargs["tz"]
         todo.last_modified = parse_datetime(line, tz_dict)
Esempio n. 7
0
 def test_timezone_not_dropped(self):
     line = ContentLine.parse("DTSTART;TZID=Europe/Berlin:20151104T190000")
     parsed = parse_datetime(line)
     self.assertIn("Europe/Berlin", str(parsed.tzinfo))
Esempio n. 8
0
 def test_none(self):
     self.assertIs(None, parse_datetime(None))
Esempio n. 9
0
 def parse3_dtend(event: "Event", line: ContentLine):
     if line:
         tz_dict = event._classmethod_kwargs["tz"]
         event._timespan = event._timespan.replace(
             end_time=parse_datetime(line, tz_dict))
Esempio n. 10
0
 def parse_last_modified(event: "Event", line: ContentLine):
     if line:
         tz_dict = event._classmethod_kwargs["tz"]
         event.last_modified = parse_datetime(line, tz_dict)
Esempio n. 11
0
 def parse_dtstamp(event: "Event", line: ContentLine):
     if line:
         # get the dict of vtimezones passed to the classmethod
         tz_dict = event._classmethod_kwargs["tz"]
         event.dtstamp = parse_datetime(line, tz_dict)