diff --git a/gluon/rocket.py.footer b/gluon/rocket.py.footer index 3977d3dd..d6be8ef3 100644 --- a/gluon/rocket.py.footer +++ b/gluon/rocket.py.footer @@ -1,21 +1,22 @@ +# The following code is not part of Rocket but was added to +# web2py for testing purposes. -# -# the following code is not part of Rocket but was added in web2py for testing purposes -# def demo_app(environ, start_response): global static_folder import os - types = {'htm': 'text/html','html': 'text/html','gif': 'image/gif', - 'jpg': 'image/jpeg','png': 'image/png','pdf': 'applications/pdf'} + types = {'htm': 'text/html', 'html': 'text/html', + 'gif': 'image/gif', 'jpg': 'image/jpeg', + 'png': 'image/png', 'pdf': 'applications/pdf'} if static_folder: if not static_folder.startswith('/'): - static_folder = os.path.join(os.getcwd(),static_folder) - path = os.path.join(static_folder, environ['PATH_INFO'][1:] or 'index.html') - type = types.get(path.split('.')[-1],'text') + static_folder = os.path.join(os.getcwd(), static_folder) + path = os.path.join( + static_folder, environ['PATH_INFO'][1:] or 'index.html') + type = types.get(path.split('.')[-1], 'text') if os.path.exists(path): try: - data = open(path,'rb').read() + data = open(path, 'rb').read() start_response('200 OK', [('Content-Type', type)]) except IOError: start_response('404 NOT FOUND', []) @@ -25,24 +26,26 @@ def demo_app(environ, start_response): data = '500 INTERNAL SERVER ERROR' else: start_response('200 OK', [('Content-Type', 'text/html')]) - data = '