Improve default.py PEP8

This commit is contained in:
Richard Vézina committed 2016-04-08 11:52:09 -04:00
1 parent ff0d10ac4f
commit d50e6aab6b
1 file changed
+5 -5
+5 -5
View File
@@ -19,8 +19,7 @@ def index():
def what(): def what():
import urllib import urllib
try: try:
images = XML(urllib.urlopen( images = XML(urllib.urlopen('http://www.web2py.com/poweredby/default/images').read())
'http://www.web2py.com/poweredby/default/images').read())
except: except:
images = [] images = []
return response.render(images=images) return response.render(images=images)
@@ -74,14 +73,15 @@ def license():
filename = os.path.join(request.env.gluon_parent, 'LICENSE') filename = os.path.join(request.env.gluon_parent, 'LICENSE')
return response.render(dict(license=MARKMIN(read_file(filename)))) return response.render(dict(license=MARKMIN(read_file(filename))))
def version(): def version():
if request.args(0) == 'raw': if request.args(0) == 'raw':
return request.env.web2py_version return request.env.web2py_version
from gluon.fileutils import parse_version from gluon.fileutils import parse_version
(a, b, c, pre_release, build) = parse_version(request.env.web2py_version) (a, b, c, pre_release, build) = parse_version(request.env.web2py_version)
return 'Version %i.%i.%i (%.4i-%.2i-%.2i %.2i:%.2i:%.2i) %s' % ( return 'Version %i.%i.%i (%.4i-%.2i-%.2i %.2i:%.2i:%.2i) %s' % \
a,b,c,build.year,build.month,build.day, (a, b, c, build.year, build.month, build.day, build.hour, build.minute, build.second, pre_release)
build.hour,build.minute,build.second,pre_release)
@cache.action(time_expire=300, cache_model=cache.ram, quick='P') @cache.action(time_expire=300, cache_model=cache.ram, quick='P')
def examples(): def examples():