Package wsgitools :: Module applications :: Class StaticFile
[hide private]
[frames] | no frames]

Class StaticFile

source code


This wsgi application provides the content of a static file on whatever request it receives with method GET or HEAD (content stripped). If not present, a content-length header is computed.

Instance Methods [hide private]
 
__init__(self, filelike, status='200 OK', headers=[], blocksize=4096)
x.__init__(...) initializes x; see help(type(x)) for signature
source code
 
_serve_in_chunks(self, stream)
internal method yielding data from the given stream
source code
 
__call__(self, environ, start_response)
wsgi interface
source code

Inherited from object: __delattr__, __format__, __getattribute__, __hash__, __new__, __reduce__, __reduce_ex__, __repr__, __setattr__, __sizeof__, __str__, __subclasshook__

Properties [hide private]

Inherited from object: __class__

Method Details [hide private]

__init__(self, filelike, status='200 OK', headers=[], blocksize=4096)
(Constructor)

source code 

x.__init__(...) initializes x; see help(type(x)) for signature

Parameters:
  • status (str) - is the HTTP status returned to the browser
  • headers ([(str, str)]) - is a list of (header, value) pairs being delivered as HTTP headers
  • filelike (str or file-like) - may either be an path in the local file system or a file-like that must support read(size) and seek(0). If tell() is present, seek(0, 2) and tell() will be used to compute the content-length.
  • blocksize (int) - the content is provided in chunks of this size
Overrides: object.__init__