# HG changeset patch # User paulb # Date 1094399540 0 # Node ID 0cf18a44cf67c8d444315b06f06d65f16e83f9dd # Parent 509f867851353a2ab9c4a9446c5bfe88a82c52cc [project @ 2004-09-05 15:52:18 by paulb] Added the session example for frameworks using WebStack.Helpers.Session. diff -r 509f86785135 -r 0cf18a44cf67 examples/BaseHTTPRequestHandler/SessionsApp.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/examples/BaseHTTPRequestHandler/SessionsApp.py Sun Sep 05 15:52:20 2004 +0000 @@ -0,0 +1,14 @@ +#!/usr/bin/env python + +from WebStack.Adapters import BaseHTTPRequestHandler +from Sessions import SessionsResource +import BaseHTTPServer + +# Special magic incantation. + +handler = BaseHTTPRequestHandler.HandlerFactory(SessionsResource()) +address = ("", 8080) +server = BaseHTTPServer.HTTPServer(address, handler) +server.serve_forever() + +# vim: tabstop=4 expandtab shiftwidth=4 diff -r 509f86785135 -r 0cf18a44cf67 examples/CGI/SessionsHandler.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/examples/CGI/SessionsHandler.py Sun Sep 05 15:52:20 2004 +0000 @@ -0,0 +1,15 @@ +#!/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 CGI +from Sessions import SessionsResource + +resource = SessionsResource() +CGI.respond(resource) + +# vim: tabstop=4 expandtab shiftwidth=4