# HG changeset patch # User paulb # Date 1113240525 0 # Node ID ab86d4582405b21bd7323848387fa20efdcbeec2 # Parent 2fa1d52d0c0f5ebcde89868b690d248f827f43c1 [project @ 2005-04-11 17:28:45 by paulb] Added missing handle_errors parameters to various adapters' deploy methods. diff -r 2fa1d52d0c0f -r ab86d4582405 WebStack/Adapters/BaseHTTPRequestHandler.py --- a/WebStack/Adapters/BaseHTTPRequestHandler.py Mon Apr 11 17:28:14 2005 +0000 +++ b/WebStack/Adapters/BaseHTTPRequestHandler.py Mon Apr 11 17:28:45 2005 +0000 @@ -79,15 +79,18 @@ default_address = ("", 8080) -def deploy(resource, authenticator=None, address=None): +def deploy(resource, authenticator=None, address=None, handle_errors=1): """ Deploy the given 'resource', with the given optional 'authenticator', at the given optional 'address', where 'address' is a 2-tuple of the form (host_string, port_integer). + + The optional 'handle_errors' flag (true by default) specifies whether error + conditions are handled gracefully. """ - handler = HandlerFactory(resource, authenticator) + handler = HandlerFactory(resource, authenticator, handle_errors) server = BaseHTTPServer.HTTPServer(address or default_address, handler) server.serve_forever() diff -r 2fa1d52d0c0f -r ab86d4582405 WebStack/Adapters/Twisted.py --- a/WebStack/Adapters/Twisted.py Mon Apr 11 17:28:14 2005 +0000 +++ b/WebStack/Adapters/Twisted.py Mon Apr 11 17:28:45 2005 +0000 @@ -58,7 +58,7 @@ default_address = ("", 8080) -def deploy(resource, authenticator=None, address=None): +def deploy(resource, authenticator=None, address=None, handle_errors=1): """ Deploy the given 'resource', with the given optional 'authenticator', at the @@ -66,11 +66,14 @@ (host_string, port_integer). NOTE: Twisted only makes use of the port number provided in the 'address'. + + The optional 'handle_errors' flag (true by default) specifies whether error + conditions are handled gracefully. """ address = address or default_address - top_level = Dispatcher(resource, authenticator) + top_level = Dispatcher(resource, authenticator, handle_errors) site = twisted.web.server.Site(top_level) twisted.internet.reactor.listenTCP(address[1], site) twisted.internet.reactor.run() diff -r 2fa1d52d0c0f -r ab86d4582405 WebStack/Adapters/WSGI.py --- a/WebStack/Adapters/WSGI.py Mon Apr 11 17:28:14 2005 +0000 +++ b/WebStack/Adapters/WSGI.py Mon Apr 11 17:28:45 2005 +0000 @@ -67,7 +67,7 @@ ) return [trans.get_wsgi_content()] -def deploy(resource, authenticator=None, address=None): +def deploy(resource, authenticator=None, address=None, handle_errors=1): """ Deploy the given 'resource', with the given optional 'authenticator', at the @@ -75,9 +75,12 @@ (host_string, port_integer). NOTE: The 'address' is ignored with the current WSGI implementation. + + The optional 'handle_errors' flag (true by default) specifies whether error + conditions are handled gracefully. """ - handler = WSGIAdapter(resource, authenticator) + handler = WSGIAdapter(resource, authenticator, handle_errors) run_with_cgi(handler) # vim: tabstop=4 expandtab shiftwidth=4