# HG changeset patch # User paulb # Date 1075677365 0 # Node ID 6fe367aff979695aa4b36838eaf0307b635028db # Parent 398e64b781b12dbe36333710bec6329cbfa7d857 [project @ 2004-02-01 23:16:05 by paulb] Moved mod_python handlers into separate directories. Added a handler for the calendar application. diff -r 398e64b781b1 -r 6fe367aff979 examples/ModPython/CalendarApp/CalendarHandler.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/examples/ModPython/CalendarApp/CalendarHandler.py Sun Feb 01 23:16:05 2004 +0000 @@ -0,0 +1,20 @@ +#!/usr/bin/env python + +# NOTE: Path manipulation requires manual customisation. + +import sys +sys.path.append("/home/paulb/Software/Python/WebStack") +sys.path.append("/home/paulb/Software/Python/WebStack/examples/Common") + +from WebStack.Adapters import ModPython +from Calendar import DirectoryResource + +# NOTE: Not sure if the resource should be maintained in a resource pool. + +resource = DirectoryResource() + +def handler(req): + global resource + return ModPython.dispatch(req, resource, debug=1) + +# vim: tabstop=4 expandtab shiftwidth=4