# HG changeset patch # User paulb # Date 1190933328 0 # Node ID 0e4413739a51eff165fa3499e92e3831760a845c # Parent 933a8a32a07c78e5b6bd496aa5c59d6530c7e8a5 [project @ 2007-09-27 22:48:48 by paulb] Support both WSGI over CGI and wsgiref. diff -r 933a8a32a07c -r 0e4413739a51 examples/WSGI/CalendarApp.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/examples/WSGI/CalendarApp.py Thu Sep 27 22:48:48 2007 +0000 @@ -0,0 +1,18 @@ +#!/usr/bin/env python + +# Uncomment and adjust the paths below if WebStack is not installed somewhere +# on the PYTHONPATH. + +#import sys +#sys.path.append("/home/paulb/Software/Python/WebStack") +#sys.path.append("/home/paulb/Software/Python/WebStack/examples/Common") + +from WebStack.Adapters.WSGI import deploy +from Calendar import CalendarResource + +# Choose or customise one of the following if the example fails. + +deploy(CalendarResource()) +#deploy(CalendarResource("iso-8859-1")) + +# vim: tabstop=4 expandtab shiftwidth=4 diff -r 933a8a32a07c -r 0e4413739a51 examples/WSGI/CalendarHandler.py --- a/examples/WSGI/CalendarHandler.py Thu Sep 27 22:40:25 2007 +0000 +++ b/examples/WSGI/CalendarHandler.py Thu Sep 27 22:48:48 2007 +0000 @@ -7,12 +7,12 @@ #sys.path.append("/home/paulb/Software/Python/WebStack") #sys.path.append("/home/paulb/Software/Python/WebStack/examples/Common") -from WebStack.Adapters.WSGI import deploy +from WebStack.Adapters.WSGI import deploy_as_cgi from Calendar import CalendarResource # Choose or customise one of the following if the example fails. -deploy(CalendarResource()) -#deploy(CalendarResource("iso-8859-1")) +deploy_as_cgi(CalendarResource()) +#deploy_as_cgi(CalendarResource("iso-8859-1")) # vim: tabstop=4 expandtab shiftwidth=4 diff -r 933a8a32a07c -r 0e4413739a51 examples/WSGI/CookiesApp.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/examples/WSGI/CookiesApp.py Thu Sep 27 22:48:48 2007 +0000 @@ -0,0 +1,15 @@ +#!/usr/bin/env python + +# Uncomment and adjust the paths below if WebStack is not installed somewhere +# on the PYTHONPATH. + +#import sys +#sys.path.append("/home/paulb/Software/Python/WebStack") +#sys.path.append("/home/paulb/Software/Python/WebStack/examples/Common") + +from WebStack.Adapters.WSGI import deploy +from Cookies import CookiesResource + +deploy(CookiesResource()) + +# vim: tabstop=4 expandtab shiftwidth=4 diff -r 933a8a32a07c -r 0e4413739a51 examples/WSGI/CookiesHandler.py --- a/examples/WSGI/CookiesHandler.py Thu Sep 27 22:40:25 2007 +0000 +++ b/examples/WSGI/CookiesHandler.py Thu Sep 27 22:48:48 2007 +0000 @@ -7,9 +7,9 @@ #sys.path.append("/home/paulb/Software/Python/WebStack") #sys.path.append("/home/paulb/Software/Python/WebStack/examples/Common") -from WebStack.Adapters.WSGI import deploy +from WebStack.Adapters.WSGI import deploy_as_cgi from Cookies import CookiesResource -deploy(CookiesResource()) +deploy_as_cgi(CookiesResource()) # vim: tabstop=4 expandtab shiftwidth=4 diff -r 933a8a32a07c -r 0e4413739a51 examples/WSGI/FormApp.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/examples/WSGI/FormApp.py Thu Sep 27 22:48:48 2007 +0000 @@ -0,0 +1,15 @@ +#!/usr/bin/env python + +# Uncomment and adjust the paths below if WebStack is not installed somewhere +# on the PYTHONPATH. + +#import sys +#sys.path.append("/home/paulb/Software/Python/WebStack") +#sys.path.append("/home/paulb/Software/Python/WebStack/examples/Common") + +from WebStack.Adapters.WSGI import deploy +from Form import FormResource + +deploy(FormResource()) + +# vim: tabstop=4 expandtab shiftwidth=4 diff -r 933a8a32a07c -r 0e4413739a51 examples/WSGI/FormHandler.py --- a/examples/WSGI/FormHandler.py Thu Sep 27 22:40:25 2007 +0000 +++ b/examples/WSGI/FormHandler.py Thu Sep 27 22:48:48 2007 +0000 @@ -7,9 +7,9 @@ #sys.path.append("/home/paulb/Software/Python/WebStack") #sys.path.append("/home/paulb/Software/Python/WebStack/examples/Common") -from WebStack.Adapters.WSGI import deploy +from WebStack.Adapters.WSGI import deploy_as_cgi from Form import FormResource -deploy(FormResource()) +deploy_as_cgi(FormResource()) # vim: tabstop=4 expandtab shiftwidth=4 diff -r 933a8a32a07c -r 0e4413739a51 examples/WSGI/LoginApp.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/examples/WSGI/LoginApp.py Thu Sep 27 22:48:48 2007 +0000 @@ -0,0 +1,25 @@ +#!/usr/bin/env python + +# Uncomment and adjust the paths below if WebStack is not installed somewhere +# on the PYTHONPATH. + +#import sys +#sys.path.append("/home/paulb/Software/Python/WebStack") +#sys.path.append("/home/paulb/Software/Python/WebStack/examples/Common") + +from WebStack.Adapters.WSGI import deploy +from WebStack.Resources.Login import LoginResource, LoginAuthenticator + +deploy( + LoginResource( + LoginAuthenticator( + secret_key="horses", + credentials=( + ("badger", "abc"), + ("vole", "xyz"), + ) + ) + ) +) + +# vim: tabstop=4 expandtab shiftwidth=4 diff -r 933a8a32a07c -r 0e4413739a51 examples/WSGI/LoginHandler.py --- a/examples/WSGI/LoginHandler.py Thu Sep 27 22:40:25 2007 +0000 +++ b/examples/WSGI/LoginHandler.py Thu Sep 27 22:48:48 2007 +0000 @@ -7,10 +7,10 @@ #sys.path.append("/home/paulb/Software/Python/WebStack") #sys.path.append("/home/paulb/Software/Python/WebStack/examples/Common") -from WebStack.Adapters.WSGI import deploy +from WebStack.Adapters.WSGI import deploy_as_cgi from WebStack.Resources.Login import LoginResource, LoginAuthenticator -deploy( +deploy_as_cgi( LoginResource( LoginAuthenticator( secret_key="horses", diff -r 933a8a32a07c -r 0e4413739a51 examples/WSGI/SessionsHandler.py --- a/examples/WSGI/SessionsHandler.py Thu Sep 27 22:40:25 2007 +0000 +++ b/examples/WSGI/SessionsHandler.py Thu Sep 27 22:48:48 2007 +0000 @@ -7,9 +7,9 @@ #sys.path.append("/home/paulb/Software/Python/WebStack") #sys.path.append("/home/paulb/Software/Python/WebStack/examples/Common") -from WebStack.Adapters.WSGI import deploy +from WebStack.Adapters.WSGI import deploy_as_cgi from Sessions import SessionsResource -deploy(SessionsResource()) +deploy_as_cgi(SessionsResource()) # vim: tabstop=4 expandtab shiftwidth=4 diff -r 933a8a32a07c -r 0e4413739a51 examples/WSGI/SimpleApp.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/examples/WSGI/SimpleApp.py Thu Sep 27 22:48:48 2007 +0000 @@ -0,0 +1,15 @@ +#!/usr/bin/env python + +# Uncomment and adjust the paths below if WebStack is not installed somewhere +# on the PYTHONPATH. + +#import sys +#sys.path.append("/home/paulb/Software/Python/WebStack") +#sys.path.append("/home/paulb/Software/Python/WebStack/examples/Common") + +from WebStack.Adapters.WSGI import deploy +from Simple import SimpleResource + +deploy(SimpleResource()) + +# vim: tabstop=4 expandtab shiftwidth=4 diff -r 933a8a32a07c -r 0e4413739a51 examples/WSGI/SimpleHandler.py --- a/examples/WSGI/SimpleHandler.py Thu Sep 27 22:40:25 2007 +0000 +++ b/examples/WSGI/SimpleHandler.py Thu Sep 27 22:48:48 2007 +0000 @@ -7,9 +7,9 @@ #sys.path.append("/home/paulb/Software/Python/WebStack") #sys.path.append("/home/paulb/Software/Python/WebStack/examples/Common") -from WebStack.Adapters.WSGI import deploy +from WebStack.Adapters.WSGI import deploy_as_cgi from Simple import SimpleResource -deploy(SimpleResource()) +deploy_as_cgi(SimpleResource()) # vim: tabstop=4 expandtab shiftwidth=4 diff -r 933a8a32a07c -r 0e4413739a51 examples/WSGI/UnicodeApp.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/examples/WSGI/UnicodeApp.py Thu Sep 27 22:48:48 2007 +0000 @@ -0,0 +1,15 @@ +#!/usr/bin/env python + +# Uncomment and adjust the paths below if WebStack is not installed somewhere +# on the PYTHONPATH. + +#import sys +#sys.path.append("/home/paulb/Software/Python/WebStack") +#sys.path.append("/home/paulb/Software/Python/WebStack/examples/Common") + +from WebStack.Adapters.WSGI import deploy +from Unicode import UnicodeResource + +deploy(UnicodeResource()) + +# vim: tabstop=4 expandtab shiftwidth=4 diff -r 933a8a32a07c -r 0e4413739a51 examples/WSGI/UnicodeHandler.py --- a/examples/WSGI/UnicodeHandler.py Thu Sep 27 22:40:25 2007 +0000 +++ b/examples/WSGI/UnicodeHandler.py Thu Sep 27 22:48:48 2007 +0000 @@ -7,9 +7,9 @@ #sys.path.append("/home/paulb/Software/Python/WebStack") #sys.path.append("/home/paulb/Software/Python/WebStack/examples/Common") -from WebStack.Adapters.WSGI import deploy +from WebStack.Adapters.WSGI import deploy_as_cgi from Unicode import UnicodeResource -deploy(UnicodeResource()) +deploy_as_cgi(UnicodeResource()) # vim: tabstop=4 expandtab shiftwidth=4 diff -r 933a8a32a07c -r 0e4413739a51 examples/WSGI/VerySimpleApp.py --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/examples/WSGI/VerySimpleApp.py Thu Sep 27 22:48:48 2007 +0000 @@ -0,0 +1,15 @@ +#!/usr/bin/env python + +# Uncomment and adjust the paths below if WebStack is not installed somewhere +# on the PYTHONPATH. + +#import sys +#sys.path.append("/home/paulb/Software/Python/WebStack") +#sys.path.append("/home/paulb/Software/Python/WebStack/examples/Common") + +from WebStack.Adapters.WSGI import deploy +from VerySimple import VerySimpleResource + +deploy(VerySimpleResource()) + +# vim: tabstop=4 expandtab shiftwidth=4 diff -r 933a8a32a07c -r 0e4413739a51 examples/WSGI/VerySimpleHandler.py --- a/examples/WSGI/VerySimpleHandler.py Thu Sep 27 22:40:25 2007 +0000 +++ b/examples/WSGI/VerySimpleHandler.py Thu Sep 27 22:48:48 2007 +0000 @@ -7,9 +7,9 @@ #sys.path.append("/home/paulb/Software/Python/WebStack") #sys.path.append("/home/paulb/Software/Python/WebStack/examples/Common") -from WebStack.Adapters.WSGI import deploy +from WebStack.Adapters.WSGI import deploy_as_cgi from VerySimple import VerySimpleResource -deploy(VerySimpleResource()) +deploy_as_cgi(VerySimpleResource()) # vim: tabstop=4 expandtab shiftwidth=4