ophelia.request

Functions

ophelia.request.get_file_context()[source]
ophelia.request.get_request()[source]
ophelia.request.push_request(func)[source]

Classes

Inheritance diagram of ophelia.request

class ophelia.request.Namespace(*args, **kwargs)

Bases: dict

Collection of named variables, accessible both as attributes and mapping items.

class ophelia.request.Request(path, template_root, site, **env)[source]

Bases: object

Ophelia’s request object.

Instantiate as Request(path, template_root, site, **env).

path: str, path to traverse from the site root, elements separated by ‘/’ template_root: str, file system path to the template root site: str, absolute URL to site root, ends with ‘/’ env: the environment

innerslot = None
content = None
compiled_headers = None
history = None
next_name = None
xml_version = '1.1'
traverse(request, *args, **kwargs)[source]
traverse_next()[source]
get_next()[source]
traverse_dir()[source]
traverse_file(file_path)[source]
process_file(file_path, insert=False, context=None)[source]
tales_namespace(file_context={})[source]
build()[source]
build_content(request, *args, **kwargs)[source]
build_headers(request, *args, **kwargs)[source]
load_macros(name)[source]
insert_template(name)[source]
render_template(name)[source]
class ophelia.request.ThreadContext[source]

Bases: thread._local

Exceptions

exception ophelia.request.NotFound[source]

Bases: exceptions.Exception

Signals that Ophelia can’t find all files needed by the request.

exception ophelia.request.Redirect(uri=None, path=None)[source]

Bases: exceptions.Exception

Signals that the server should redirect the client to another URI.

exception ophelia.request.StopTraversal(text=None)[source]

Bases: exceptions.Exception

Flow control device for scripts to stop directory traversal.

text = ''