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))
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])
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))
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))
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)
def parse_last_modified(todo: "Todo", line: ContentLine): if line: tz_dict = todo._classmethod_kwargs["tz"] todo.last_modified = parse_datetime(line, tz_dict)
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))
def test_none(self): self.assertIs(None, parse_datetime(None))
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))
def parse_last_modified(event: "Event", line: ContentLine): if line: tz_dict = event._classmethod_kwargs["tz"] event.last_modified = parse_datetime(line, tz_dict)
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)