diff options
| author | ianb <devnull@localhost> | 2005-06-02 18:12:57 +0000 |
|---|---|---|
| committer | ianb <devnull@localhost> | 2005-06-02 18:12:57 +0000 |
| commit | 6c443d6d37a59c938eb6986c50f3928e19de6a1c (patch) | |
| tree | c0f47e4393336ddb005d4916877d369f4394ee3c /paste/webkit | |
| parent | a4076409127b9a46fe0a51ef1574e697620ba2eb (diff) | |
| download | paste-6c443d6d37a59c938eb6986c50f3928e19de6a1c.tar.gz | |
Added class property wsgi_app that serves as a WSGI application that creates new instances on each invocation
Diffstat (limited to 'paste/webkit')
| -rw-r--r-- | paste/webkit/wkservlet.py | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/paste/webkit/wkservlet.py b/paste/webkit/wkservlet.py index 782fb97..47e9a89 100644 --- a/paste/webkit/wkservlet.py +++ b/paste/webkit/wkservlet.py @@ -7,6 +7,17 @@ applications, and __call__ is provided to do this. import wkcommon from wktransaction import Transaction +class make_application(object): + + def __get__(self, obj, type=None): + # Instances are already applications: + if obj: + return obj + # This application creates an instance for each call: + def application(environ, start_response): + return type()(environ, start_response) + return application + class Servlet(object): # This is nested in Servlet so that transactions can access it as @@ -33,6 +44,8 @@ class Servlet(object): except self.EndResponse: trans.response().deliver() return trans.response().wsgiIterator() + + wsgi_app = make_application() ## Access ## |
