Part of twisted.web View Source
Function | escapedData | Escape a string for inclusion in a document. |
Function | escapedCDATA | Escape CDATA for inclusion in a document. |
Function | escapedComment | Escape a comment for inclusion in a document. |
Function | _getSlotValue | Find the value of the named slot in the given stack of slot data. |
Function | _flattenElement | Make root slightly more flat by yielding all its immediate
contents as strings, deferreds or generators that are recursive calls to
itself. |
Function | _flattenTree | Make root into an iterable of str and Deferred by
doing a depth first traversal of the tree. |
Function | _writeFlattenedData | Take strings from an iterator and pass them to a writer function. |
Parameters | data | The string to escape. (type: str or unicode ) |
inAttribute | A flag which, if set, indicates that the string should be quoted for use as
the value of an XML tag value. (type: bool ) | |
Returns | The quoted form of data . If data is unicode,
return a utf-8 encoded string. (type: str ) |
Parameters | data | The string to escape. (type: str or unicode ) |
Returns | The quoted form of data . If data is unicode,
return a utf-8 encoded string. (type: str ) |
Parameters | data | The string to escape. (type: str or unicode ) |
Returns | The quoted form of data . If data is unicode,
return a utf-8 encoded string. (type: str ) |
root
slightly more flat by yielding all its immediate
contents as strings, deferreds or generators that are recursive calls to
itself.Parameters | request | A request object which will be passed to IRenderable.render . |
root | An object to be made flatter. This may be of type unicode ,
str , slot , Tag , URL , tuple ,
list ,
GeneratorType , Deferred , or
an object that implements IRenderable . | |
slotData | A list of dict mapping str slot
names to data with which those slots will be replaced. | |
renderFactory | If not None , An object that provides IRenderable . | |
inAttribute | A flag which, if set, indicates that str and
unicode instances encountered must be quoted as for XML tag
attribute values. | |
Returns | An iterator which yields str , Deferred , and
more iterators of the same type. |
root
into an iterable of str
and Deferred
by
doing a depth first traversal of the tree.Parameters | request | A request object which will be passed to IRenderable.render . |
root | An object to be made flatter. This may be of type unicode ,
str , slot , Tag , tuple ,
list ,
GeneratorType , Deferred , or
something providing IRenderable . | |
Returns | An iterator which yields objects of type str and Deferred . A Deferred is
only yielded when one is encountered in the process of flattening
root . The returned iterator must not be iterated again until
the Deferred is
called back. |
Parameters | state | An iterator of str and Deferred .
str instances will be passed to write . Deferred
instances will be waited on before resuming iteration of
state . |
write | A callable which will be invoked with each str produced by
iterating state . | |
result | A Deferred
which will be called back when state has been completely
flattened into write or which will be errbacked if an
exception in a generator passed to state or an errback from a
Deferred
from state occurs. | |
Returns | None |