cleanup of whitespaces in scripts

This commit is contained in:
mdipierro
2013-03-29 02:30:15 -05:00
parent 244d3c68eb
commit 706324b9c6
15 changed files with 411 additions and 427 deletions
+4 -5
View File
@@ -46,9 +46,9 @@ def allow_access(environ,host):
filename = os.path.join(os.path.dirname(__file__),'access.wsgi.log')
f = open(filename,'a')
try:
f.write('\n'+header+'\n'+pprint+'\n')
f.write('\n'+header+'\n'+pprint+'\n')
finally:
f.close()
f.close()
app = environ['REQUEST_URI'].split('/')[1]
keys = [key for key in environ if key.startswith('HTTP_')]
headers = {}
@@ -58,8 +58,7 @@ def allow_access(environ,host):
try:
data = urllib.urlencode({'request_uri':environ['REQUEST_URI']})
request = urllib2.Request(URL_CHECK_ACCESS % dict(app=app),data,headers)
response = urllib2.urlopen(request).read().strip().lower()
if response.startswith('true'): return True
response = urllib2.urlopen(request).read().strip().lower()
if response.startswith('true'): return True
except: pass
return False