abc

Module Contents

Classes

AbstractRouter(self)
AbstractMatchInfo()
AbstractView(self,request) Abstract class based view.
AbstractResolver() Abstract DNS resolver.
AbstractCookieJar(self) Abstract Cookie Jar.
AbstractStreamWriter() Abstract stream writer.
AbstractAccessLogger(self,logger,log_format) Abstract writer to access log.
class AbstractRouter
__init__()
post_init(app)

Post init stage.

Not an abstract method for sake of backward compatibility, but if the router wants to be aware of the application it can override this.

frozen()
freeze()

Freeze router.

resolve(request)

Return MATCH_INFO for given request

class AbstractMatchInfo
handler(request)

Execute matched request handler

expect_handler(request)

Expect handler for 100-continue processing

http_exception()

HTTPException instance raised on router’s resolving, or None

get_info()

Return a dict with additional info useful for introspection

apps()

Stack of nested applications.

Top level application is left-most element.

add_app(app)

Add application to the nested apps stack.

freeze()

Freeze the match info.

The method is called after route resolution.

After the call .add_app() is forbidden.

class AbstractView(request)

Abstract class based view.

__init__(request)
request()

Request instance.

__await__()

Execute the view handler.

class AbstractResolver

Abstract DNS resolver.

resolve(hostname)

Return IP address for given hostname

close()

Release resolver

class AbstractCookieJar

Abstract Cookie Jar.

__init__()
clear()

Clear all cookies.

update_cookies(cookies, response_url=None)

Update cookies.

filter_cookies(request_url)

Return the jar’s cookies filtered by their attributes.

class AbstractStreamWriter

Abstract stream writer.

write(chunk)

Write chunk into stream.

write_eof(chunk=None)

Write last chunk.

drain()

Flush the write buffer.

class AbstractAccessLogger(logger, log_format)

Abstract writer to access log.

__init__(logger, log_format)
log(request, response, time)

Emit log to logger.