1.1 --- a/WebStack/Adapters/BaseHTTPRequestHandler.py Mon Apr 11 17:28:14 2005 +0000
1.2 +++ b/WebStack/Adapters/BaseHTTPRequestHandler.py Mon Apr 11 17:28:45 2005 +0000
1.3 @@ -79,15 +79,18 @@
1.4
1.5 default_address = ("", 8080)
1.6
1.7 -def deploy(resource, authenticator=None, address=None):
1.8 +def deploy(resource, authenticator=None, address=None, handle_errors=1):
1.9
1.10 """
1.11 Deploy the given 'resource', with the given optional 'authenticator', at the
1.12 given optional 'address', where 'address' is a 2-tuple of the form
1.13 (host_string, port_integer).
1.14 +
1.15 + The optional 'handle_errors' flag (true by default) specifies whether error
1.16 + conditions are handled gracefully.
1.17 """
1.18
1.19 - handler = HandlerFactory(resource, authenticator)
1.20 + handler = HandlerFactory(resource, authenticator, handle_errors)
1.21 server = BaseHTTPServer.HTTPServer(address or default_address, handler)
1.22 server.serve_forever()
1.23
2.1 --- a/WebStack/Adapters/Twisted.py Mon Apr 11 17:28:14 2005 +0000
2.2 +++ b/WebStack/Adapters/Twisted.py Mon Apr 11 17:28:45 2005 +0000
2.3 @@ -58,7 +58,7 @@
2.4
2.5 default_address = ("", 8080)
2.6
2.7 -def deploy(resource, authenticator=None, address=None):
2.8 +def deploy(resource, authenticator=None, address=None, handle_errors=1):
2.9
2.10 """
2.11 Deploy the given 'resource', with the given optional 'authenticator', at the
2.12 @@ -66,11 +66,14 @@
2.13 (host_string, port_integer).
2.14
2.15 NOTE: Twisted only makes use of the port number provided in the 'address'.
2.16 +
2.17 + The optional 'handle_errors' flag (true by default) specifies whether error
2.18 + conditions are handled gracefully.
2.19 """
2.20
2.21 address = address or default_address
2.22
2.23 - top_level = Dispatcher(resource, authenticator)
2.24 + top_level = Dispatcher(resource, authenticator, handle_errors)
2.25 site = twisted.web.server.Site(top_level)
2.26 twisted.internet.reactor.listenTCP(address[1], site)
2.27 twisted.internet.reactor.run()
3.1 --- a/WebStack/Adapters/WSGI.py Mon Apr 11 17:28:14 2005 +0000
3.2 +++ b/WebStack/Adapters/WSGI.py Mon Apr 11 17:28:45 2005 +0000
3.3 @@ -67,7 +67,7 @@
3.4 )
3.5 return [trans.get_wsgi_content()]
3.6
3.7 -def deploy(resource, authenticator=None, address=None):
3.8 +def deploy(resource, authenticator=None, address=None, handle_errors=1):
3.9
3.10 """
3.11 Deploy the given 'resource', with the given optional 'authenticator', at the
3.12 @@ -75,9 +75,12 @@
3.13 (host_string, port_integer).
3.14
3.15 NOTE: The 'address' is ignored with the current WSGI implementation.
3.16 +
3.17 + The optional 'handle_errors' flag (true by default) specifies whether error
3.18 + conditions are handled gracefully.
3.19 """
3.20
3.21 - handler = WSGIAdapter(resource, authenticator)
3.22 + handler = WSGIAdapter(resource, authenticator, handle_errors)
3.23 run_with_cgi(handler)
3.24
3.25 # vim: tabstop=4 expandtab shiftwidth=4