From: James French Date: Thu, 16 Jul 2020 05:00:58 +0000 (+0800) Subject: Tabs vs Spaces X-Git-Tag: 1.1 X-Git-Url: https://git.ucc.asn.au/?a=commitdiff_plain;h=refs%2Fheads%2Fmaster;p=frenchie%2Ficalparse.git Tabs vs Spaces --- diff --git a/icalparse.py b/icalparse.py index c5d469e..59e409b 100755 --- a/icalparse.py +++ b/icalparse.py @@ -68,7 +68,7 @@ def getHTTPContent(url=''): try: import httplib2 except ImportError: - pass + pass if not url: return ('','') @@ -124,6 +124,7 @@ def generateRules(ruleConfig): parserrules.ruleConfig[conf] = ruleConfig[conf] rules = [getattr(parserrules, rule) for rule in dir(parserrules) if callable(getattr(parserrules, rule))] + return rules @@ -215,13 +216,13 @@ def runCGI(): form = cgi.FieldStorage() if "uid" not in form or "key" not in form: - print('Content-Type: text/calendar\n') - sys.exit(0) + print('Content-Type: text/calendar\n') + sys.exit(0) try: - # UID should be numeric, if it's not we have someone playing games - uid = int(form['uid'].value) + # UID should be numeric, if it's not we have someone playing games + uid = int(form['uid'].value) except: - exitQuiet() + exitQuiet() # The user's key will be a 16 character string key = form['key'].value @@ -234,11 +235,11 @@ def runCGI(): # nothing just assume they want Australia/Perth tz = "" if "tz" in form: - from pytz import timezone - try: - timezone(form['tz'].value) - tz = form['tz'].value - except: pass + from pytz import timezone + try: + timezone(form['tz'].value) + tz = form['tz'].value + except: pass ruleConfig["defaultTZ"] = tz or ruleConfig["defaultTZ"]