# HG changeset patch # User paulb # Date 1082331601 0 # Node ID 4efafd268fb37ebf92371be43a3c8c9ae415adf1 # Parent 0bb522526666f12caa170670ed793b7bace0c01a [project @ 2004-04-18 23:40:01 by paulb] Added a handler for the cookies example. diff -r 0bb522526666 -r 4efafd268fb3 examples/ModPython/CookiesApp/CookiesHandler.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/examples/ModPython/CookiesApp/CookiesHandler.py Sun Apr 18 23:40:01 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 Cookies import CookiesResource + +# NOTE: Not sure if the resource should be maintained in a resource pool. + +resource = CookiesResource() + +def handler(req): + global resource + return ModPython.respond(req, resource, debug=1) + +# vim: tabstop=4 expandtab shiftwidth=4