def wsgi(self, environ, start_response):
try:<EOL><INDENT>environ['<STR_LIT>'] = self<EOL>request.bind(environ)<EOL>response.bind()<EOL>out = self._cast(self._handle(environ), request, response)<EOL>if response._status_code in (<NUM_LIT:100>, <NUM_LIT>, <NUM_LIT>, <NUM_LIT>)or request.method == '<STR_LIT>':<EOL><INDENT>if hasattr(out, '<STR_LIT>'): out.close()<EOL>out = []<EOL><DEDENT>start_response(response._status_line, list(response.iter_headers()))<EOL>return out<EOL><DEDENT>except (KeyboardInterrupt, SystemExit, MemoryError):<EOL><INDENT>raise<EOL><DEDENT>except Exception as e:<EOL><INDENT>if not self.catchall: raise<EOL>err = '<STR_LIT>'% html_escape(environ.get('<STR_LIT>', '<STR_LIT:/>'))<EOL>if DEBUG:<EOL><INDENT>err += '<STR_LIT>''<STR_LIT>'% (html_escape(repr(e)), html_escape(format_exc(<NUM_LIT:10>)))<EOL><DEDENT>environ['<STR_LIT>'].write(err)<EOL>headers = [('<STR_LIT:Content-Type>', '<STR_LIT>')]<EOL>start_response('<STR_LIT>', headers)<EOL>return [tob(err)]<EOL><DEDENT>
The bottle WSGI-interface.