# HG changeset patch # User paulb # Date 1076197774 0 # Node ID 0e55491769193c11123c4b88a6d3dde7641f291e # Parent a983e3856185fad9a3af32a66e73db09954b2166 [project @ 2004-02-07 23:49:23 by paulb] Renamed Simple example. diff -r a983e3856185 -r 0e5549176919 examples/ModPython/Simple/SimpleHandler.py --- a/examples/ModPython/Simple/SimpleHandler.py Sat Feb 07 23:49:18 2004 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,20 +0,0 @@ -#!/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 SimpleApplication import SimpleResource - -# NOTE: Not sure if the resource should be maintained in a resource pool. - -resource = SimpleResource() - -def handler(req): - global resource - return ModPython.dispatch(req, resource, debug=1) - -# vim: tabstop=4 expandtab shiftwidth=4 diff -r a983e3856185 -r 0e5549176919 examples/ModPython/SimpleApp/SimpleHandler.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/examples/ModPython/SimpleApp/SimpleHandler.py Sat Feb 07 23:49:34 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 SimpleApplication import SimpleResource + +# NOTE: Not sure if the resource should be maintained in a resource pool. + +resource = SimpleResource() + +def handler(req): + global resource + return ModPython.dispatch(req, resource, debug=1) + +# vim: tabstop=4 expandtab shiftwidth=4 diff -r a983e3856185 -r 0e5549176919 examples/Twisted/Simple.py --- a/examples/Twisted/Simple.py Sat Feb 07 23:49:18 2004 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,15 +0,0 @@ -#!/usr/bin/env python - -from WebStack.Adapters import Twisted -from SimpleApplication import SimpleResource -import twisted.web.server -import twisted.internet.reactor - -# Special magic incantation. - -top_level = Twisted.Dispatcher(SimpleResource()) -site = twisted.web.server.Site(top_level) -twisted.internet.reactor.listenTCP(8080, site) -twisted.internet.reactor.run() - -# vim: tabstop=4 expandtab shiftwidth=4 diff -r a983e3856185 -r 0e5549176919 examples/Twisted/SimpleApp.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/examples/Twisted/SimpleApp.py Sat Feb 07 23:49:34 2004 +0000 @@ -0,0 +1,15 @@ +#!/usr/bin/env python + +from WebStack.Adapters import Twisted +from SimpleApplication import SimpleResource +import twisted.web.server +import twisted.internet.reactor + +# Special magic incantation. + +top_level = Twisted.Dispatcher(SimpleResource()) +site = twisted.web.server.Site(top_level) +twisted.internet.reactor.listenTCP(8080, site) +twisted.internet.reactor.run() + +# vim: tabstop=4 expandtab shiftwidth=4 diff -r a983e3856185 -r 0e5549176919 examples/Webware/Simple/Properties.py --- a/examples/Webware/Simple/Properties.py Sat Feb 07 23:49:18 2004 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,15 +0,0 @@ -#!/usr/bin/env python - -name = "Simple" - -version = (0, 1, 0) - -status = "alpha" - -releaseDate = "?" - -requiredPyVersion = (2, 2, 0) - -synopsis = "A simple WebStack application." - -# vim: tabstop=4 expandtab shiftwidth=4 diff -r a983e3856185 -r 0e5549176919 examples/Webware/Simple/__init__.py --- a/examples/Webware/Simple/__init__.py Sat Feb 07 23:49:18 2004 +0000 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,25 +0,0 @@ -#!/usr/bin/env python - -""" -Webware plug-in code. -""" - -__version__ = "0.1" - -from WebStack.Adapters.Webware import WebStackServletFactory -from SimpleApplication import SimpleResource - -# NOTE: Initialising a shared resource. - -resource = SimpleResource() - -def InstallInWebKit(appServer): - global resource - app = appServer.application() - - # NOTE: Allow .simple files only. Really, we'd like any kind of file, but - # NOTE: that would severely undermine the servlet factory concept. - - app.addServletFactory(WebStackServletFactory(app, resource, [".simple"])) - -# vim: tabstop=4 expandtab shiftwidth=4 diff -r a983e3856185 -r 0e5549176919 examples/Webware/SimpleApp/Properties.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/examples/Webware/SimpleApp/Properties.py Sat Feb 07 23:49:34 2004 +0000 @@ -0,0 +1,15 @@ +#!/usr/bin/env python + +name = "Simple" + +version = (0, 1, 0) + +status = "alpha" + +releaseDate = "?" + +requiredPyVersion = (2, 2, 0) + +synopsis = "A simple WebStack application." + +# vim: tabstop=4 expandtab shiftwidth=4 diff -r a983e3856185 -r 0e5549176919 examples/Webware/SimpleApp/__init__.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/examples/Webware/SimpleApp/__init__.py Sat Feb 07 23:49:34 2004 +0000 @@ -0,0 +1,25 @@ +#!/usr/bin/env python + +""" +Webware plug-in code. +""" + +__version__ = "0.1" + +from WebStack.Adapters.Webware import WebStackServletFactory +from SimpleApplication import SimpleResource + +# NOTE: Initialising a shared resource. + +resource = SimpleResource() + +def InstallInWebKit(appServer): + global resource + app = appServer.application() + + # NOTE: Allow .simple files only. Really, we'd like any kind of file, but + # NOTE: that would severely undermine the servlet factory concept. + + app.addServletFactory(WebStackServletFactory(app, resource, [".simple"])) + +# vim: tabstop=4 expandtab shiftwidth=4