diff options
author | pje <pje@571e12c6-e1fa-0310-aee7-ff1267fa46bd> | 2004-10-06 06:36:57 +0000 |
---|---|---|
committer | pje <pje@571e12c6-e1fa-0310-aee7-ff1267fa46bd> | 2004-10-06 06:36:57 +0000 |
commit | 2ee4011863a3d25593ed7465fd54821c23f5ba96 (patch) | |
tree | ea0245d3d950bce60af2fe9fd5868e9cb765b98d | |
parent | 1378a45106c862d762f914ee4276124d10bed19d (diff) | |
download | wsgiref-2ee4011863a3d25593ed7465fd54821c23f5ba96.tar.gz |
Fix 'last_call' references that should've been 'run_once'; Misc. doc fixes.
git-svn-id: svn://svn.eby-sarna.com/svnroot/wsgiref@250 571e12c6-e1fa-0310-aee7-ff1267fa46bd
-rw-r--r-- | src/wsgiref/__init__.py | 6 | ||||
-rw-r--r-- | src/wsgiref/handlers.py | 16 | ||||
-rw-r--r-- | src/wsgiref/tests/test_handlers.py | 2 |
3 files changed, 13 insertions, 11 deletions
diff --git a/src/wsgiref/__init__.py b/src/wsgiref/__init__.py index d130a83..d79e3f8 100644 --- a/src/wsgiref/__init__.py +++ b/src/wsgiref/__init__.py @@ -1,13 +1,15 @@ """wsgiref -- a WSGI (PEP 333) Reference Library -Contained Modules: +Current Contents: * util -- Miscellaneous useful functions and wrappers * headers -- Manage response headers - * handler -- base classes for server/gateway implementations + * handlers -- base classes for server/gateway implementations +To-Do: + * server -- a SimpleHTTPServer that supports WSGI * cgi_gateway -- Run WSGI apps under CGI diff --git a/src/wsgiref/handlers.py b/src/wsgiref/handlers.py index c7a39bf..d49b687 100644 --- a/src/wsgiref/handlers.py +++ b/src/wsgiref/handlers.py @@ -45,7 +45,7 @@ class BaseHandler: wsgi_version = (1,0) wsgi_multithread = True wsgi_multiprocess = True - wsgi_last_call = False + wsgi_run_once = False # os_environ may be overridden at class or instance level, if desired os_environ = dict(os.environ.items()) @@ -89,7 +89,7 @@ class BaseHandler: env['wsgi.input'] = self.get_stdin() env['wsgi.errors'] = self.get_stderr() env['wsgi.version'] = self.wsgi_version - env['wsgi.last_call'] = self.wsgi_last_call + env['wsgi.run_once'] = self.wsgi_run_once env['wsgi.url_scheme'] = self.get_scheme() env['wsgi.multithread'] = self.wsgi_multithread env['wsgi.multiprocess'] = self.wsgi_multiprocess @@ -341,8 +341,12 @@ class BaseCGIHandler(BaseHandler): class CGIHandler(BaseCGIHandler): """CGI-based invocation via sys.stdin/stdout/stderr and os.environ + Usage:: + + CGIHandler().run(app) + The difference between this class and BaseCGIHandler is that it always - uses 'wsgi.last_call' of 'True', 'wsgi.multithread' of 'False', and + uses 'wsgi.run_once' of 'True', 'wsgi.multithread' of 'False', and 'wsgi.multiprocess' of 'True'. It does not take any initialization parameters, but always uses 'sys.stdin', 'os.environ', and friends. @@ -350,7 +354,7 @@ class CGIHandler(BaseCGIHandler): instead. """ - wsgi_last_call = True + wsgi_run_once = True def __init__(self): BaseCGIHandler.__init__( @@ -363,7 +367,3 @@ class CGIHandler(BaseCGIHandler): - - - - diff --git a/src/wsgiref/tests/test_handlers.py b/src/wsgiref/tests/test_handlers.py index 2e6bcba..69b86d9 100644 --- a/src/wsgiref/tests/test_handlers.py +++ b/src/wsgiref/tests/test_handlers.py @@ -44,7 +44,7 @@ class HandlerTests(TestCase): def checkEnvironAttrs(self, handler): env = handler.environ for attr in [ - 'version','multithread','multiprocess','last_call','file_wrapper' + 'version','multithread','multiprocess','run_once','file_wrapper' ]: if attr=='file_wrapper' and handler.wsgi_file_wrapper is None: continue |