Package wsgiref :: Module handlers :: Class SimpleHandler
[hide private]
[frames] | no frames]

Class SimpleHandler

BaseHandler --+
              |
             SimpleHandler
Known Subclasses:

Handler that's just initialized with streams, environment, etc.

This handler subclass is intended for synchronous HTTP/1.0 origin servers, and handles sending the entire response output, given the correct inputs.

Usage:

   handler = SimpleHandler(
       inp,out,err,env, multithread=False, multiprocess=True
   )
   handler.run(app)
Nested Classes [hide private]

Inherited from BaseHandler: headers_class, wsgi_file_wrapper

Instance Methods [hide private]
 
__init__(self, stdin, stdout, stderr, environ, multithread=True, multiprocess=False)
 
get_stdin(self)
Override in subclass to return suitable 'wsgi.input'
 
get_stderr(self)
Override in subclass to return suitable 'wsgi.errors'
 
add_cgi_vars(self)
Override in subclass to insert CGI variables in 'self.environ'
 
_write(self, data)
Override in subclass to buffer data for send to client
 
_flush(self)
Override in subclass to force sending of recent '_write()' calls

Inherited from BaseHandler: cleanup_headers, client_is_modern, close, error_output, finish_content, finish_response, get_scheme, handle_error, log_exception, result_is_file, run, send_headers, send_preamble, sendfile, set_content_length, setup_environ, start_response, write

Class Variables [hide private]

Inherited from BaseHandler: bytes_sent, error_body, error_headers, error_status, headers, headers_sent, http_version, origin_server, os_environ, result, server_software, status, traceback_limit, wsgi_multiprocess, wsgi_multithread, wsgi_run_once, wsgi_version

Method Details [hide private]

get_stdin(self)

 

Override in subclass to return suitable 'wsgi.input'

Overrides: BaseHandler.get_stdin
(inherited documentation)

get_stderr(self)

 

Override in subclass to return suitable 'wsgi.errors'

Overrides: BaseHandler.get_stderr
(inherited documentation)

add_cgi_vars(self)

 

Override in subclass to insert CGI variables in 'self.environ'

Overrides: BaseHandler.add_cgi_vars
(inherited documentation)

_write(self, data)

 

Override in subclass to buffer data for send to client

It's okay if this method actually transmits the data; BaseHandler just separates write and flush operations for greater efficiency when the underlying system actually has such a distinction.

Overrides: BaseHandler._write
(inherited documentation)

_flush(self)

 

Override in subclass to force sending of recent '_write()' calls

It's okay if this method is a no-op (i.e., if '_write()' actually sends the data.

Overrides: BaseHandler._flush
(inherited documentation)