Disable Outlook Rules for Facebook
authorJames French <[email protected]>
Mon, 4 Mar 2013 14:42:58 +0000 (22:42 +0800)
committerJames French <[email protected]>
Mon, 4 Mar 2013 14:42:58 +0000 (22:42 +0800)
- Bugfixes as a bonus

icalparse.py
parserrules.py

index 4dd1229..1d62a70 100755 (executable)
@@ -206,11 +206,14 @@ def exitQuiet(exitstate=0):
 
 
 def runCGI():
-    '''Main run function if this script is called as a CGI script'''
+    '''Main run function if this script is called as a CGI script
+    to process facebook ical files'''
     import cgi
     import re
     import cgitb; cgitb.enable()
     
+    ruleConfig["facebook"] = True
+
     form = cgi.FieldStorage()
     if "uid" not in form or "key" not in form:
         print('Content-Type: text/calendar\n')
@@ -248,7 +251,7 @@ def runCGI():
     cal = applyRules(cal, generateRules(ruleConfig), False)
 
     print('Content-Type: text/calendar; charset=%s\n'%encoding)
-    icalparse.writeOutput(cal)
+    writeOutput(cal)
     
 
 if __name__ == '__main__':
index 4bb0dd5..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

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