Merge pull request #840 from BuhtigithuB/pep8-globals-py
Improve PEP8 globals.py
This commit is contained in:
+7
-7
@@ -211,7 +211,7 @@ class Request(Storage):
|
|||||||
env = self.env
|
env = self.env
|
||||||
post_vars = self._post_vars = Storage()
|
post_vars = self._post_vars = Storage()
|
||||||
body = self.body
|
body = self.body
|
||||||
#if content-type is application/json, we must read the body
|
# if content-type is application/json, we must read the body
|
||||||
is_json = env.get('content_type', '')[:16] == 'application/json'
|
is_json = env.get('content_type', '')[:16] == 'application/json'
|
||||||
|
|
||||||
if is_json:
|
if is_json:
|
||||||
@@ -438,7 +438,7 @@ class Response(Storage):
|
|||||||
def include_meta(self):
|
def include_meta(self):
|
||||||
s = "\n";
|
s = "\n";
|
||||||
for meta in (self.meta or {}).iteritems():
|
for meta in (self.meta or {}).iteritems():
|
||||||
k,v = meta
|
k, v = meta
|
||||||
if isinstance(v,dict):
|
if isinstance(v,dict):
|
||||||
s = s+'<meta'+''.join(' %s="%s"' % (xmlescape(key), xmlescape(v[key])) for key in v) +' />\n'
|
s = s+'<meta'+''.join(' %s="%s"' % (xmlescape(key), xmlescape(v[key])) for key in v) +' />\n'
|
||||||
else:
|
else:
|
||||||
@@ -491,10 +491,10 @@ class Response(Storage):
|
|||||||
for item in files:
|
for item in files:
|
||||||
if isinstance(item, str):
|
if isinstance(item, str):
|
||||||
f = item.lower().split('?')[0]
|
f = item.lower().split('?')[0]
|
||||||
# if static_version we need also to check for
|
# if static_version we need also to check for
|
||||||
# static_version_urls. In that case, the _.x.x.x
|
# static_version_urls. In that case, the _.x.x.x
|
||||||
# bit would have already been added by the URL()
|
# bit would have already been added by the URL()
|
||||||
# function
|
# function
|
||||||
if self.static_version and not self.static_version_urls:
|
if self.static_version and not self.static_version_urls:
|
||||||
item = item.replace(
|
item = item.replace(
|
||||||
'/static/', '/static/_%s/' % self.static_version, 1)
|
'/static/', '/static/_%s/' % self.static_version, 1)
|
||||||
@@ -881,7 +881,7 @@ class Session(Storage):
|
|||||||
table_migrate = False
|
table_migrate = False
|
||||||
tname = tablename + '_' + masterapp
|
tname = tablename + '_' + masterapp
|
||||||
table = db.get(tname, None)
|
table = db.get(tname, None)
|
||||||
#Field = db.Field
|
# Field = db.Field
|
||||||
if table is None:
|
if table is None:
|
||||||
db.define_table(
|
db.define_table(
|
||||||
tname,
|
tname,
|
||||||
|
|||||||
Reference in New Issue
Block a user