1.1 --- a/WebStack/Adapters/ModPython.py Sun Feb 01 15:28:08 2004 +0000
1.2 +++ b/WebStack/Adapters/ModPython.py Sun Feb 01 15:28:25 2004 +0000
1.3 @@ -5,8 +5,23 @@
1.4 """
1.5
1.6 import WebStack.ModPython
1.7 +from mod_python import apache
1.8
1.9 -# NOTE: Implement a handler function which converts a request to a transaction
1.10 -# NOTE: and invokes application resources.
1.11 +def dispatch(request, resource):
1.12 +
1.13 + "Dispatch the given 'request' to the root application-specific 'resource'."
1.14 +
1.15 + trans = WebStack.ModPython.Transaction(request)
1.16 + try:
1.17 + # NOTE: Resource pooling may be appropriate.
1.18 +
1.19 + resource.respond(trans)
1.20 + return apache.OK
1.21 + except:
1.22 +
1.23 + # NOTE: Error conditions should be investigated further, along with
1.24 + # NOTE: other response states.
1.25 +
1.26 + return apache.INTERNAL_SERVER_ERROR
1.27
1.28 # vim: tabstop=4 expandtab shiftwidth=4