示例#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))
示例#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])
示例#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))
示例#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))
示例#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)
示例#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)
示例#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))
示例#8
0
 def test_none(self):
     self.assertIs(None, parse_datetime(None))
示例#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))
示例#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)
示例#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)