1.1 --- a/examples/ModPython/AuthApp/AuthHandler.py Sun Jan 15 23:22:13 2006 +0000 1.2 +++ b/examples/ModPython/AuthApp/AuthHandler.py Sun Jan 15 23:23:29 2006 +0000 1.3 @@ -5,7 +5,7 @@ 1.4 import sys, os 1.5 sys.path.append(os.path.abspath(os.path.join(__file__, "../../../Common"))) 1.6 1.7 -from WebStack.Adapters import ModPython 1.8 +from WebStack.Adapters.ModPython import deploy 1.9 from Auth import AuthResource, AuthAuthenticator 1.10 1.11 # NOTE: Not sure if the resource should be maintained in a resource pool. 1.12 @@ -13,10 +13,6 @@ 1.13 resource = AuthResource() 1.14 authenticator = AuthAuthenticator() 1.15 1.16 -def handler(req): 1.17 - return ModPython.respond(req, resource, handle_errors=0) 1.18 - 1.19 -def authenhandler(req): 1.20 - return ModPython.authenticate(req, authenticator, handle_errors=0) 1.21 +handler, authenhandler = deploy(resource, authenticator, handle_errors=0) 1.22 1.23 # vim: tabstop=4 expandtab shiftwidth=4
2.1 --- a/examples/ModPython/CalendarApp/CalendarHandler.py Sun Jan 15 23:22:13 2006 +0000 2.2 +++ b/examples/ModPython/CalendarApp/CalendarHandler.py Sun Jan 15 23:23:29 2006 +0000 2.3 @@ -5,7 +5,7 @@ 2.4 import sys, os 2.5 sys.path.append(os.path.abspath(os.path.join(__file__, "../../../Common"))) 2.6 2.7 -from WebStack.Adapters import ModPython 2.8 +from WebStack.Adapters.ModPython import deploy 2.9 from Calendar import CalendarResource 2.10 2.11 # NOTE: Not sure if the resource should be maintained in a resource pool. 2.12 @@ -14,7 +14,6 @@ 2.13 resource = CalendarResource() 2.14 #resource = CalendarResource("iso-8859-1") 2.15 2.16 -def handler(req): 2.17 - return ModPython.respond(req, resource, handle_errors=0) 2.18 +handler, _no_authentication = deploy(resource, handle_errors=0) 2.19 2.20 # vim: tabstop=4 expandtab shiftwidth=4
3.1 --- a/examples/ModPython/CookiesApp/CookiesHandler.py Sun Jan 15 23:22:13 2006 +0000 3.2 +++ b/examples/ModPython/CookiesApp/CookiesHandler.py Sun Jan 15 23:23:29 2006 +0000 3.3 @@ -5,14 +5,13 @@ 3.4 import sys, os 3.5 sys.path.append(os.path.abspath(os.path.join(__file__, "../../../Common"))) 3.6 3.7 -from WebStack.Adapters import ModPython 3.8 +from WebStack.Adapters.ModPython import deploy 3.9 from Cookies import CookiesResource 3.10 3.11 # NOTE: Not sure if the resource should be maintained in a resource pool. 3.12 3.13 resource = CookiesResource() 3.14 3.15 -def handler(req): 3.16 - return ModPython.respond(req, resource, handle_errors=0) 3.17 +handler, _no_authentication = deploy(resource, handle_errors=0) 3.18 3.19 # vim: tabstop=4 expandtab shiftwidth=4
4.1 --- a/examples/ModPython/FormApp/FormHandler.py Sun Jan 15 23:22:13 2006 +0000 4.2 +++ b/examples/ModPython/FormApp/FormHandler.py Sun Jan 15 23:23:29 2006 +0000 4.3 @@ -5,14 +5,13 @@ 4.4 import sys, os 4.5 sys.path.append(os.path.abspath(os.path.join(__file__, "../../../Common"))) 4.6 4.7 -from WebStack.Adapters import ModPython 4.8 +from WebStack.Adapters.ModPython import deploy 4.9 from Form import FormResource 4.10 4.11 # NOTE: Not sure if the resource should be maintained in a resource pool. 4.12 4.13 resource = FormResource() 4.14 4.15 -def handler(req): 4.16 - return ModPython.respond(req, resource, handle_errors=0) 4.17 +handler, _no_authentication = deploy(resource, handle_errors=0) 4.18 4.19 # vim: tabstop=4 expandtab shiftwidth=4
5.1 --- a/examples/ModPython/LoginApp/LoginHandler.py Sun Jan 15 23:22:13 2006 +0000 5.2 +++ b/examples/ModPython/LoginApp/LoginHandler.py Sun Jan 15 23:23:29 2006 +0000 5.3 @@ -5,7 +5,7 @@ 5.4 import sys, os 5.5 sys.path.append(os.path.abspath(os.path.join(__file__, "../../../Common"))) 5.6 5.7 -from WebStack.Adapters import ModPython 5.8 +from WebStack.Adapters.ModPython import deploy 5.9 from WebStack.Resources.Login import LoginResource, LoginAuthenticator 5.10 5.11 # NOTE: Not sure if the resource should be maintained in a resource pool. 5.12 @@ -21,7 +21,6 @@ 5.13 use_redirect=0 5.14 ) 5.15 5.16 -def handler(req): 5.17 - return ModPython.respond(req, resource, handle_errors=0) 5.18 +handler, _no_authentication = deploy(resource, handle_errors=0) 5.19 5.20 # vim: tabstop=4 expandtab shiftwidth=4
6.1 --- a/examples/ModPython/SessionsApp/SessionsHandler.py Sun Jan 15 23:22:13 2006 +0000 6.2 +++ b/examples/ModPython/SessionsApp/SessionsHandler.py Sun Jan 15 23:23:29 2006 +0000 6.3 @@ -5,14 +5,13 @@ 6.4 import sys, os 6.5 sys.path.append(os.path.abspath(os.path.join(__file__, "../../../Common"))) 6.6 6.7 -from WebStack.Adapters import ModPython 6.8 +from WebStack.Adapters.ModPython import deploy 6.9 from Sessions import SessionsResource 6.10 6.11 # NOTE: Not sure if the resource should be maintained in a resource pool. 6.12 6.13 resource = SessionsResource() 6.14 6.15 -def handler(req): 6.16 - return ModPython.respond(req, resource, handle_errors=0) 6.17 +handler, _no_authentication = deploy(resource, handle_errors=0) 6.18 6.19 # vim: tabstop=4 expandtab shiftwidth=4
7.1 --- a/examples/ModPython/SimpleApp/SimpleHandler.py Sun Jan 15 23:22:13 2006 +0000 7.2 +++ b/examples/ModPython/SimpleApp/SimpleHandler.py Sun Jan 15 23:23:29 2006 +0000 7.3 @@ -5,14 +5,13 @@ 7.4 import sys, os 7.5 sys.path.append(os.path.abspath(os.path.join(__file__, "../../../Common"))) 7.6 7.7 -from WebStack.Adapters import ModPython 7.8 +from WebStack.Adapters.ModPython import deploy 7.9 from Simple import SimpleResource 7.10 7.11 # NOTE: Not sure if the resource should be maintained in a resource pool. 7.12 7.13 resource = SimpleResource() 7.14 7.15 -def handler(req): 7.16 - return ModPython.respond(req, resource, handle_errors=0) 7.17 +handler, _no_authentication = deploy(resource, handle_errors=0) 7.18 7.19 # vim: tabstop=4 expandtab shiftwidth=4
8.1 --- a/examples/ModPython/SimpleWithLoginApp/SimpleWithLoginHandler.py Sun Jan 15 23:22:13 2006 +0000 8.2 +++ b/examples/ModPython/SimpleWithLoginApp/SimpleWithLoginHandler.py Sun Jan 15 23:23:29 2006 +0000 8.3 @@ -5,14 +5,14 @@ 8.4 import sys, os 8.5 sys.path.append(os.path.abspath(os.path.join(__file__, "../../../Common"))) 8.6 8.7 -from WebStack.Adapters import ModPython 8.8 +from WebStack.Adapters.ModPython import deploy 8.9 from WebStack.Resources.LoginRedirect import LoginRedirectResource, LoginRedirectAuthenticator 8.10 from Simple import SimpleResource 8.11 8.12 # NOTE: Not sure if the resource should be maintained in a resource pool. 8.13 8.14 resource = LoginRedirectResource( 8.15 - login_url="http://localhost/login/app.login", 8.16 + login_url="http://localhost/login/app", 8.17 app_url="http://localhost", 8.18 resource=SimpleResource(), 8.19 authenticator=LoginRedirectAuthenticator(secret_key="horses"), 8.20 @@ -21,7 +21,6 @@ 8.21 use_logout_redirect=0 8.22 ) 8.23 8.24 -def handler(req): 8.25 - return ModPython.respond(req, resource, handle_errors=0) 8.26 +handler, _no_authentication = deploy(resource, handle_errors=0) 8.27 8.28 # vim: tabstop=4 expandtab shiftwidth=4
9.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 9.2 +++ b/examples/ModPython/UnicodeApp/UnicodeHandler.py Sun Jan 15 23:23:29 2006 +0000 9.3 @@ -0,0 +1,17 @@ 9.4 +#!/usr/bin/env python 9.5 + 9.6 +# NOTE: Path manipulation may require manual customisation. 9.7 + 9.8 +import sys, os 9.9 +sys.path.append(os.path.abspath(os.path.join(__file__, "../../../Common"))) 9.10 + 9.11 +from WebStack.Adapters.ModPython import deploy 9.12 +from Simple import SimpleResource 9.13 + 9.14 +# NOTE: Not sure if the resource should be maintained in a resource pool. 9.15 + 9.16 +resource = UnicodeResource() 9.17 + 9.18 +handler, _no_authentication = deploy(resource, handle_errors=0) 9.19 + 9.20 +# vim: tabstop=4 expandtab shiftwidth=4
10.1 --- a/examples/ModPython/VerySimpleApp/VerySimpleHandler.py Sun Jan 15 23:22:13 2006 +0000 10.2 +++ b/examples/ModPython/VerySimpleApp/VerySimpleHandler.py Sun Jan 15 23:23:29 2006 +0000 10.3 @@ -5,14 +5,13 @@ 10.4 import sys, os 10.5 sys.path.append(os.path.abspath(os.path.join(__file__, "../../../Common"))) 10.6 10.7 -from WebStack.Adapters import ModPython 10.8 +from WebStack.Adapters.ModPython import deploy 10.9 from VerySimple import VerySimpleResource 10.10 10.11 # NOTE: Not sure if the resource should be maintained in a resource pool. 10.12 10.13 resource = VerySimpleResource() 10.14 10.15 -def handler(req): 10.16 - return ModPython.respond(req, resource, handle_errors=0) 10.17 +handler, _no_authentication = deploy(resource, handle_errors=0) 10.18 10.19 # vim: tabstop=4 expandtab shiftwidth=4
11.1 --- a/examples/Webware/AuthContext/__init__.py Sun Jan 15 23:22:13 2006 +0000 11.2 +++ b/examples/Webware/AuthContext/__init__.py Sun Jan 15 23:23:29 2006 +0000 11.3 @@ -4,13 +4,13 @@ 11.4 Webware context for the Auth application (post Webware 0.8.1). 11.5 """ 11.6 11.7 -from WebStack.Adapters.Webware import WebStackURLParser 11.8 +from WebStack.Adapters.Webware import deploy 11.9 from Auth import AuthResource, AuthAuthenticator 11.10 11.11 # NOTE: Initialising a shared resource. 11.12 11.13 resource = AuthResource() 11.14 authenticator = AuthAuthenticator() 11.15 -urlParser = WebStackURLParser(resource, authenticator) 11.16 +urlParser = deploy(resource, authenticator, handle_errors=0) 11.17 11.18 # vim: tabstop=4 expandtab shiftwidth=4
12.1 --- a/examples/Webware/CalendarContext/__init__.py Sun Jan 15 23:22:13 2006 +0000 12.2 +++ b/examples/Webware/CalendarContext/__init__.py Sun Jan 15 23:23:29 2006 +0000 12.3 @@ -4,7 +4,7 @@ 12.4 Webware context for the Calendar application (post Webware 0.8.1). 12.5 """ 12.6 12.7 -from WebStack.Adapters.Webware import WebStackURLParser 12.8 +from WebStack.Adapters.Webware import deploy 12.9 from Calendar import CalendarResource 12.10 12.11 # NOTE: Initialising a shared resource. 12.12 @@ -13,6 +13,6 @@ 12.13 resource = CalendarResource() 12.14 #resource = CalendarResource("iso-8859-1") 12.15 12.16 -urlParser = WebStackURLParser(resource) 12.17 +urlParser = deploy(resource, handle_errors=0) 12.18 12.19 # vim: tabstop=4 expandtab shiftwidth=4
13.1 --- a/examples/Webware/CookiesContext/__init__.py Sun Jan 15 23:22:13 2006 +0000 13.2 +++ b/examples/Webware/CookiesContext/__init__.py Sun Jan 15 23:23:29 2006 +0000 13.3 @@ -4,12 +4,12 @@ 13.4 Webware context for the Cookies application (post Webware 0.8.1). 13.5 """ 13.6 13.7 -from WebStack.Adapters.Webware import WebStackURLParser 13.8 +from WebStack.Adapters.Webware import deploy 13.9 from Cookies import CookiesResource 13.10 13.11 # NOTE: Initialising a shared resource. 13.12 13.13 resource = CookiesResource() 13.14 -urlParser = WebStackURLParser(resource) 13.15 +urlParser = deploy(resource, handle_errors=0) 13.16 13.17 # vim: tabstop=4 expandtab shiftwidth=4
14.1 --- a/examples/Webware/FormContext/__init__.py Sun Jan 15 23:22:13 2006 +0000 14.2 +++ b/examples/Webware/FormContext/__init__.py Sun Jan 15 23:23:29 2006 +0000 14.3 @@ -4,12 +4,12 @@ 14.4 Webware context for the Form application (post Webware 0.8.1). 14.5 """ 14.6 14.7 -from WebStack.Adapters.Webware import WebStackURLParser 14.8 +from WebStack.Adapters.Webware import deploy 14.9 from Form import FormResource 14.10 14.11 # NOTE: Initialising a shared resource. 14.12 14.13 resource = FormResource() 14.14 -urlParser = WebStackURLParser(resource) 14.15 +urlParser = deploy(resource, handle_errors=0) 14.16 14.17 # vim: tabstop=4 expandtab shiftwidth=4
15.1 --- a/examples/Webware/LoginContext/__init__.py Sun Jan 15 23:22:13 2006 +0000 15.2 +++ b/examples/Webware/LoginContext/__init__.py Sun Jan 15 23:23:29 2006 +0000 15.3 @@ -4,7 +4,7 @@ 15.4 Webware context for the Login application (post Webware 0.8.1). 15.5 """ 15.6 15.7 -from WebStack.Adapters.Webware import WebStackURLParser 15.8 +from WebStack.Adapters.Webware import deploy 15.9 from WebStack.Resources.Login import LoginResource, LoginAuthenticator 15.10 15.11 # NOTE: Initialising a shared resource. 15.12 @@ -19,6 +19,6 @@ 15.13 ) 15.14 ) 15.15 15.16 -urlParser = WebStackURLParser(resource) 15.17 +urlParser = deploy(resource, handle_errors=0) 15.18 15.19 # vim: tabstop=4 expandtab shiftwidth=4
16.1 --- a/examples/Webware/SessionsContext/__init__.py Sun Jan 15 23:22:13 2006 +0000 16.2 +++ b/examples/Webware/SessionsContext/__init__.py Sun Jan 15 23:23:29 2006 +0000 16.3 @@ -4,12 +4,12 @@ 16.4 Webware context for the Sessions application (post Webware 0.8.1). 16.5 """ 16.6 16.7 -from WebStack.Adapters.Webware import WebStackURLParser 16.8 +from WebStack.Adapters.Webware import deploy 16.9 from Sessions import SessionsResource 16.10 16.11 # NOTE: Initialising a shared resource. 16.12 16.13 resource = SessionsResource() 16.14 -urlParser = WebStackURLParser(resource) 16.15 +urlParser = deploy(resource, handle_errors=0) 16.16 16.17 # vim: tabstop=4 expandtab shiftwidth=4
17.1 --- a/examples/Webware/SimpleContext/__init__.py Sun Jan 15 23:22:13 2006 +0000 17.2 +++ b/examples/Webware/SimpleContext/__init__.py Sun Jan 15 23:23:29 2006 +0000 17.3 @@ -4,12 +4,12 @@ 17.4 Webware context for the Simple application (post Webware 0.8.1). 17.5 """ 17.6 17.7 -from WebStack.Adapters.Webware import WebStackURLParser 17.8 +from WebStack.Adapters.Webware import deploy 17.9 from Simple import SimpleResource 17.10 17.11 # NOTE: Initialising a shared resource. 17.12 17.13 resource = SimpleResource() 17.14 -urlParser = WebStackURLParser(resource, handle_errors=0) 17.15 +urlParser = deploy(resource, handle_errors=0) 17.16 17.17 # vim: tabstop=4 expandtab shiftwidth=4
18.1 --- a/examples/Webware/SimpleWithLoginContext/__init__.py Sun Jan 15 23:22:13 2006 +0000 18.2 +++ b/examples/Webware/SimpleWithLoginContext/__init__.py Sun Jan 15 23:23:29 2006 +0000 18.3 @@ -4,7 +4,7 @@ 18.4 Webware context for the Simple application (post Webware 0.8.1). 18.5 """ 18.6 18.7 -from WebStack.Adapters.Webware import WebStackURLParser 18.8 +from WebStack.Adapters.Webware import deploy 18.9 from WebStack.Resources.LoginRedirect import LoginRedirectResource, LoginRedirectAuthenticator 18.10 from Simple import SimpleResource 18.11 18.12 @@ -18,6 +18,6 @@ 18.13 anonymous_parameter_name="anonymous", 18.14 logout_parameter_name="logout" 18.15 ) 18.16 -urlParser = WebStackURLParser(resource) 18.17 +urlParser = deploy(resource, handle_errors=0) 18.18 18.19 # vim: tabstop=4 expandtab shiftwidth=4
19.1 --- a/examples/Webware/UnicodeContext/__init__.py Sun Jan 15 23:22:13 2006 +0000 19.2 +++ b/examples/Webware/UnicodeContext/__init__.py Sun Jan 15 23:23:29 2006 +0000 19.3 @@ -4,12 +4,12 @@ 19.4 Webware context for the Unicode application (post Webware 0.8.1). 19.5 """ 19.6 19.7 -from WebStack.Adapters.Webware import WebStackURLParser 19.8 +from WebStack.Adapters.Webware import deploy 19.9 from Unicode import UnicodeResource 19.10 19.11 # NOTE: Initialising a shared resource. 19.12 19.13 resource = UnicodeResource() 19.14 -urlParser = WebStackURLParser(resource) 19.15 +urlParser = deploy(resource, handle_errors=0) 19.16 19.17 # vim: tabstop=4 expandtab shiftwidth=4
20.1 --- a/examples/Webware/VerySimpleContext/__init__.py Sun Jan 15 23:22:13 2006 +0000 20.2 +++ b/examples/Webware/VerySimpleContext/__init__.py Sun Jan 15 23:23:29 2006 +0000 20.3 @@ -4,12 +4,12 @@ 20.4 Webware context for the VerySimple application (post Webware 0.8.1). 20.5 """ 20.6 20.7 -from WebStack.Adapters.Webware import WebStackURLParser 20.8 +from WebStack.Adapters.Webware import deploy 20.9 from VerySimple import VerySimpleResource 20.10 20.11 # NOTE: Initialising a shared resource. 20.12 20.13 resource = VerySimpleResource() 20.14 -urlParser = WebStackURLParser(resource, handle_errors=0) 20.15 +urlParser = deploy(resource, handle_errors=0) 20.16 20.17 # vim: tabstop=4 expandtab shiftwidth=4