Merge pull request #1667 from BuhtigithuB/improve/pep8-main-py
Enhance main.py PEP8
This commit is contained in:
+6
-7
@@ -11,7 +11,8 @@ The gluon wsgi application
|
|||||||
"""
|
"""
|
||||||
from __future__ import print_function
|
from __future__ import print_function
|
||||||
|
|
||||||
if False: import import_all # DO NOT REMOVE PART OF FREEZE PROCESS
|
if False:
|
||||||
|
import import_all # DO NOT REMOVE PART OF FREEZE PROCESS
|
||||||
import gc
|
import gc
|
||||||
|
|
||||||
import os
|
import os
|
||||||
@@ -254,6 +255,7 @@ class LazyWSGI(object):
|
|||||||
return [data]
|
return [data]
|
||||||
for item in middleware_apps:
|
for item in middleware_apps:
|
||||||
app = item(app)
|
app = item(app)
|
||||||
|
|
||||||
def caller(app):
|
def caller(app):
|
||||||
return app(self.environ, self.start_response)
|
return app(self.environ, self.start_response)
|
||||||
return lambda caller=caller, app=app: caller(app)
|
return lambda caller=caller, app=app: caller(app)
|
||||||
@@ -325,7 +327,6 @@ def wsgibase(environ, responder):
|
|||||||
'Expires'] = 'Thu, 31 Dec 2037 23:59:59 GMT'
|
'Expires'] = 'Thu, 31 Dec 2037 23:59:59 GMT'
|
||||||
response.stream(static_file, request=request)
|
response.stream(static_file, request=request)
|
||||||
|
|
||||||
|
|
||||||
# ##################################################
|
# ##################################################
|
||||||
# fill in request items
|
# fill in request items
|
||||||
# ##################################################
|
# ##################################################
|
||||||
@@ -360,13 +361,11 @@ def wsgibase(environ, responder):
|
|||||||
folder=abspath('applications', app) + os.sep,
|
folder=abspath('applications', app) + os.sep,
|
||||||
ajax=x_req_with == 'xmlhttprequest',
|
ajax=x_req_with == 'xmlhttprequest',
|
||||||
cid=env.http_web2py_component_element,
|
cid=env.http_web2py_component_element,
|
||||||
is_local = (env.remote_addr in local_hosts and
|
is_local=(env.remote_addr in local_hosts and client == env.remote_addr),
|
||||||
client == env.remote_addr),
|
|
||||||
is_shell=False,
|
is_shell=False,
|
||||||
is_scheduler=False,
|
is_scheduler=False,
|
||||||
is_https = env.wsgi_url_scheme in HTTPS_SCHEMES or \
|
is_https=env.wsgi_url_scheme in HTTPS_SCHEMES or
|
||||||
request.env.http_x_forwarded_proto in HTTPS_SCHEMES \
|
request.env.http_x_forwarded_proto in HTTPS_SCHEMES or env.https == 'on'
|
||||||
or env.https == 'on'
|
|
||||||
)
|
)
|
||||||
request.url = environ['PATH_INFO']
|
request.url = environ['PATH_INFO']
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user