1.1 --- a/imiptools/data.py Mon Sep 18 20:34:43 2017 +0200
1.2 +++ b/imiptools/data.py Mon Sep 18 20:36:45 2017 +0200
1.3 @@ -658,6 +658,23 @@
1.4
1.5 return ("VFREEBUSY", {}, record)
1.6
1.7 +def parse_calendar(f, encoding):
1.8 +
1.9 + """
1.10 + Parse the iTIP content from 'f' having the given 'encoding'. Return a
1.11 + mapping from object types to collections of calendar objects.
1.12 + """
1.13 +
1.14 + cal = parse_object(f, encoding, "VCALENDAR")
1.15 + d = {}
1.16 +
1.17 + for objtype, values in cal.items():
1.18 + d[objtype] = l = []
1.19 + for value in values:
1.20 + l.append(Object({objtype : value}))
1.21 +
1.22 + return d
1.23 +
1.24 def parse_object(f, encoding, objtype=None):
1.25
1.26 """