fault.web

System interfaces supporting web services.

itertools
import

typing
import

media
import

xml
import

Path
import

calculate_range
function

calculate_range(ranges, size)

render_xml_directory_listing
function

render_xml_directory_listing(xs, dl, fl)

Iterator producing the XML elements describing the directory's content.

render_directory_listing
function

render_directory_listing(directories, files)

Object directory listing.

xml_context_element
function

xml_context_element(xs, hostname, root)

_render_index_xml
function

_render_index_xml(xml, routes, rpath)

materialize_xml_index
function

materialize_xml_index(ctl, root, rpath, rpoints, routes)

_render_index
function

_render_index(routes, rpath)

materialize_json_index
function

materialize_json_index(ctl, root, rpath, rpoints, routes)

materialize_text_index
function

materialize_text_index(ctl, root, rpath, rpoints, routes)

supported_directory_types
data

supported_directory_types = (
	media.type_from_bytes(b'application/json'),
	media.type_from_bytes(b'text/xml'),
	media.type_from_bytes(b'text/plain'),
)

directory_materialization
data

directory_materialization = {
	media.type_from_bytes(b'application/json'): materialize_json_index,
	media.type_from_bytes(b'text/xml'): materialize_xml_index,
	media.type_from_bytes(b'text/plain'): materialize_text_index,
}

select_filesystem_resource
function

select_filesystem_resource(error, routes, ctl, root, rpath)

Identify a target resource and materialize a response.