Module n.f.ten

Part of nevow.flat View Source

No module docstring
Line # Kind Name Docs
26 Function registerFlattener Register a function, 'flattener', which will be invoked when an object of type 'forType'
43 Function getFlattener Get a flattener function with signature (ctx, original) for the object original.
48 Function getSerializer Undocumented
53 Function partialflatten Run a flattener on the object 'obj' in the context 'context'.
68 Function serialize Undocumented
73 Function iterflatten This is the main meat of the nevow renderer. End-user programmers should
118 Function flatten Given the stan and the optional context, return a string containing the
132 Function precompile Given the stan and the optional context, return a list of strings and
def registerFlattener(flattener, forType): (source)

Register a function, 'flattener', which will be invoked when an object of type 'forType' is encountered in the stan dom. This function should return or yield strings, or objects for which there is also a flattener registered.

flattener should take (original, ctx) where original is the object to flatten.
def getFlattener(original): (source)
Get a flattener function with signature (ctx, original) for the object original.
def getSerializer(obj): (source)
Undocumented
def partialflatten(context, obj): (source)

Run a flattener on the object 'obj' in the context 'context'.

The return results from this function will not necessarily be a string, but will probably need further processing.
def serialize(obj, context): (source)
Undocumented
def iterflatten(stan, ctx, writer, shouldYieldItem=None): (source)
This is the main meat of the nevow renderer. End-user programmers should instead use either flatten or precompile.
def flatten(stan, ctx=None): (source)
Given the stan and the optional context, return a string containing the representation of the tree in the given context.
def precompile(stan, ctx=None): (source)

Given the stan and the optional context, return a list of strings and Context instances, optimizing as much static content as possible into contiguous string runs.

The Context instances will have Tag instances whose .children have also been precompiled.
API Documentation for Nevow, generated by pydoctor.