# HG changeset patch # User paulb # Date 1121538374 0 # Node ID c01a805e987e297717dd539076448a2ee264cb65 # Parent 470103644a033d4e906f95f9881da9032e4811ed [project @ 2005-07-16 18:26:11 by paulb] Moved site map initialisation into the applications. Added mod_python examples. diff -r 470103644a03 -r c01a805e987e examples/ModPython/PEP241App/PEP241Handler.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/examples/ModPython/PEP241App/PEP241Handler.py Sat Jul 16 18:26:14 2005 +0000 @@ -0,0 +1,24 @@ +#!/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/XSLTools") +sys.path.append("/home/paulb/Software/Python/XSLTools/examples/Common") +sys.path.append("/home/paulb/Software/Python/libxml2dom") + +from WebStack.Adapters import ModPython +import PEP241 + +# Get a simple Web site. + +resource = PEP241.get_site() + +# NOTE: Not sure if the resource should be maintained in a resource pool. + +def handler(req): + global resource + return ModPython.respond(req, resource, handle_errors=0) + +# vim: tabstop=4 expandtab shiftwidth=4 diff -r 470103644a03 -r c01a805e987e examples/ModPython/QuestionnaireApp/QuestionnaireHandler.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/examples/ModPython/QuestionnaireApp/QuestionnaireHandler.py Sat Jul 16 18:26:14 2005 +0000 @@ -0,0 +1,24 @@ +#!/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/XSLTools") +sys.path.append("/home/paulb/Software/Python/XSLTools/examples/Common") +sys.path.append("/home/paulb/Software/Python/libxml2dom") + +from WebStack.Adapters import ModPython +import Questionnaire + +# Get a simple Web site. + +resource = Questionnaire.get_site() + +# NOTE: Not sure if the resource should be maintained in a resource pool. + +def handler(req): + global resource + return ModPython.respond(req, resource, handle_errors=0) + +# vim: tabstop=4 expandtab shiftwidth=4