From d50e6aab6bb6945fd7ddeb1037f522166e116b98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Richard=20V=C3=A9zina?= Date: Fri, 8 Apr 2016 11:52:09 -0400 Subject: [PATCH] Improve default.py PEP8 --- applications/examples/controllers/default.py | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/applications/examples/controllers/default.py b/applications/examples/controllers/default.py index 9f41403f..129c071a 100644 --- a/applications/examples/controllers/default.py +++ b/applications/examples/controllers/default.py @@ -10,7 +10,7 @@ session.forget() cache_expire = not request.is_local and 300 or 0 -#@cache.action(time_expire=300, cache_model=cache.ram, quick='P') +# @cache.action(time_expire=300, cache_model=cache.ram, quick='P') def index(): return response.render() @@ -19,14 +19,13 @@ def index(): def what(): import urllib try: - images = XML(urllib.urlopen( - 'http://www.web2py.com/poweredby/default/images').read()) + images = XML(urllib.urlopen('http://www.web2py.com/poweredby/default/images').read()) except: images = [] return response.render(images=images) -#@cache.action(time_expire=300, cache_model=cache.ram, quick='P') +# @cache.action(time_expire=300, cache_model=cache.ram, quick='P') def download(): return response.render() @@ -74,14 +73,15 @@ def license(): filename = os.path.join(request.env.gluon_parent, 'LICENSE') return response.render(dict(license=MARKMIN(read_file(filename)))) + def version(): - if request.args(0)=='raw': + if request.args(0) == 'raw': return request.env.web2py_version from gluon.fileutils import parse_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' % ( - a,b,c,build.year,build.month,build.day, - build.hour,build.minute,build.second,pre_release) + return 'Version %i.%i.%i (%.4i-%.2i-%.2i %.2i:%.2i:%.2i) %s' % \ + (a, b, c, build.year, build.month, build.day, build.hour, build.minute, build.second, pre_release) + @cache.action(time_expire=300, cache_model=cache.ram, quick='P') def examples():