def wsgiapp():
 def decorator(func):
  def wsgiapp_wrapper(*args):
   if (len(args) == 3):
    environ = args[1]
    start_response = args[2]
    args = [args[0]]
   else:
    (environ, start_response) = args
    args = []
   def application(environ, start_response):
    form = wsgilib.parse_formvars(environ, include_get_vars=True)
    headers = response.HeaderDict({'content-type': 'text/html', 'status': '200 OK'})
    form['environ'] = environ
    form['headers'] = headers
    res = func(*args, **form.mixed())
    status = headers.pop('status')
    start_response(status, headers.headeritems())
    return [res]
   app = httpexceptions.make_middleware(application)
   app = simplecatcher(app)
   return app(environ, start_response)
  wsgiapp_wrapper.exposed = True
  return wsgiapp_wrapper
 return decorator

def wsgiapp ( ) : def decorator ( func ) : def wsgiapp_wrapper ( * args ) : if ( len ( args ) == 3 ) : environ = args [ 1 ] start_response = args [ 2 ] args = [ args [ 0 ] ] else : ( environ , start_response ) = args args = [ ] def application ( environ , start_response ) : form = wsgilib . parse_formvars ( environ , include_get_vars = True ) headers = response . HeaderDict ( { 'content-type' : 'text/html' , 'status' : '200 OK' } ) form [ 'environ' ] = environ form [ 'headers' ] = headers res = func ( * args , ** form . mixed ( ) ) status = headers . pop ( 'status' ) start_response ( status , headers . headeritems ( ) ) return [ res ] app = httpexceptions . make_middleware ( application ) app = simplecatcher ( app ) return app ( environ , start_response ) wsgiapp_wrapper . exposed = True return wsgiapp_wrapper return decorator
turns a function or method into a wsgi application .