def serve_application(application, prefix, port=None, host=None, max_children=None):
 class SCGIAppHandler(SWAP, ):
  def __init__(self, *args, **kwargs):
   self.prefix = prefix
   self.app_obj = application
   SWAP.__init__(self, *args, **kwargs)
 kwargs = dict(handler_class=SCGIAppHandler)
 for kwarg in ('host', 'port', 'max_children'):
  if (locals()[kwarg] is not None):
   kwargs[kwarg] = locals()[kwarg]
 scgi_server.SCGIServer(**kwargs).serve()

def serve_application ( application , prefix , port = None , host = None , max_children = None ) : class SCGIAppHandler ( SWAP , ) : def __init__ ( self , * args , ** kwargs ) : self . prefix = prefix self . app_obj = application SWAP . __init__ ( self , * args , ** kwargs ) kwargs = dict ( handler_class = SCGIAppHandler ) for kwarg in ( 'host' , 'port' , 'max_children' ) : if ( locals ( ) [ kwarg ] is not None ) : kwargs [ kwarg ] = locals ( ) [ kwarg ] scgi_server . SCGIServer ( ** kwargs ) . serve ( )
serve the specified wsgi application via scgi proxy .