Latest Version: 0.9.6.2

fileapp

This module handles sending static content such as in-memory data or files. At this time it has cache helpers and understands the if-modified-since request header.


Classes

C ArchiveStore(...) ...

Returns an application that serves up a DataApp for items requested in a given zip or tar archive.

Constructor Arguments:

filepath the path to the archive being served

cache_control()

This method provides validated construction of the Cache-Control header as well as providing for automated filling out of the EXPIRES header for HTTP/1.0 clients.

This class contains 3 members.

C DataApp(...) ...

Returns an application that will send content in a single chunk, this application has support for setting cache-control and for responding to conditional (or HEAD) requests.

Constructor Arguments:

content the content being sent to the client

headers the headers to send /w the response

The remaining kwargs correspond to headers, where the underscore is replaced with a dash. These values are only added to the headers if they are not already provided; thus, they can be used for default values. Examples include, but are not limited to:

content_type content_encoding content_location

cache_control()

This method provides validated construction of the Cache-Control header as well as providing for automated filling out of the EXPIRES header for HTTP/1.0 clients.

set_content()

This method provides a mechanism to set the content after the application has been constructed. This method does things like changing Last-Modified and Content-Length headers.

This class contains 8 members.

C FileApp(...) ...

Returns an application that will send the file at the given filename. Adds a mime type based on mimetypes.guess_type(). See DataApp for the arguments beyond filename.

This class contains 10 members.

See the source for more information.

Top