コード例 #1
0
ファイル: event_parser.py プロジェクト: tomschr/ics.py
 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
ファイル: alarm_parser.py プロジェクト: tomschr/ics.py
 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
ファイル: todo_parser.py プロジェクト: tomschr/ics.py
 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
ファイル: todo_parser.py プロジェクト: tomschr/ics.py
 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
ファイル: todo_parser.py プロジェクト: tomschr/ics.py
 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
ファイル: todo_parser.py プロジェクト: tomschr/ics.py
 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
ファイル: event_parser.py プロジェクト: tomschr/ics.py
 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
ファイル: event_parser.py プロジェクト: tomschr/ics.py
 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
ファイル: event_parser.py プロジェクト: tomschr/ics.py
 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)