From fa0cfc592ec1f14783765da63f6176c17ae5d3af Mon Sep 17 00:00:00 2001 From: James French Date: Mon, 4 Mar 2013 22:20:51 +0800 Subject: [PATCH] Revert "Removed functions to do with Outlook ICS Files" This reverts commit ae40266069204ee411350d5fd3d31f40d89187af. These changes should be better enabled with a toggle --- parserrules.py | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/parserrules.py b/parserrules.py index a2175fe..4bb0dd5 100644 --- a/parserrules.py +++ b/parserrules.py @@ -60,6 +60,47 @@ def whatPrivacy(cal): return cal +def dropAttributes(cal): + '''Removing unwanted metadata''' + + eventBlacklist = [x.lower() for x in [ + "X-ALT-DESC", + "X-MICROSOFT-CDO-BUSYSTATUS", + "X-MICROSOFT-CDO-IMPORTANCE", + "X-MICROSOFT-DISALLOW-COUNTER", + "X-MS-OLK-ALLOWEXTERNCHECK", + "X-MS-OLK-AUTOSTARTCHECK", + "X-MS-OLK-CONFTYPE", + "X-MS-OLK-AUTOFILLLOCATION", + "TRANSP", + "SEQUENCE", + "PRIORITY" + ]] + + mainBlacklist = [x.lower() for x in [ + "X-CLIPSTART", + "X-CALSTART", + "X-OWNER", + "X-MS-OLK-WKHRSTART", + "X-MS-OLK-WKHREND", + "X-WR-RELCALID", + "X-MS-OLK-WKHRDAYS", + "X-MS-OLK-APPTSEQTIME", + "X-CLIPEND", + "X-CALEND", + "VTIMEZONE", + "X-PRIMARY-CALENDAR" + ]] + + for event in cal.vevent_list: + for blacklist in eventBlacklist: + if event.contents.has_key(blacklist): del event.contents[blacklist] + + for blkl in mainBlacklist: + while blkl in cal.contents: del cal.contents[blkl] + + return cal + def exDate(cal): '''Replacing multi-value EXDATES with multiple single-value EXDATES''' -- 2.20.1