Disable Outlook Rules for Facebook
[frenchie/icalparse.git] / parserrules.py
index f1c55c1..4ba71e8 100644 (file)
@@ -62,6 +62,8 @@ def whatPrivacy(cal):
 
 def dropAttributes(cal):
        '''Removing unwanted metadata'''
+       if "facebook" in ruleConfig:
+               if ruleConfig["facebook"] == True: return cal
 
        eventBlacklist = [x.lower() for x in [
                "X-ALT-DESC",
@@ -103,6 +105,8 @@ def dropAttributes(cal):
 
 def exDate(cal):
        '''Replacing multi-value EXDATES with multiple single-value EXDATES'''
+       if "facebook" in ruleConfig:
+               if ruleConfig["facebook"] == True: return cal
 
        from datetime import datetime
        from pytz import timezone
@@ -164,22 +168,3 @@ def unwantedParams(cal):
                        except AttributeError: continue
 
        return cal
-
-def exDate(cal):
-       '''Changes multi-EXDATE into singles (apple can't obey even simple specs).
-       If the remote calendar specifies a timezone then use it, otherwise use the user specified value'''
-
-       for event in cal.vevent_list:
-               if not event.contents.has_key(u'exdate'): continue
-               dates = event.exdate.value
-               try: tzid = event.exdate.tzid_param
-               except AttributeError: tzid = ''
-
-               del event.contents[u'exdate']
-
-               for date in dates:
-                       entry = event.add(u'exdate')
-                       entry.value = [date]
-                       if tzid: entry.tzid_param = tzid
-
-       return cal

UCC git Repository :: git.ucc.asn.au