+
+def splitFields(cal):
+ '''Takes a list of lines in a calendar file and returns a list of key, value pairs'''
+
+ ical = [tuple(x.split(':',1)) for x in cal]
+
+ # Check that we got 2 items on every line
+ for line in ical:
+ if not len(line) == 2:
+ raise InvalidICS, "Didn't find a content key on: %s"%(line)
+
+ return ical
+
+