plainbox.impl.exporter.html

HTML exporter for human consumption

Warning

THIS MODULE DOES NOT HAVE A STABLE PUBLIC API

class plainbox.impl.exporter.html.HTMLResourceInliner[source]

A helper class to inline resources referenced in an lxml tree.

inline_resources(document_tree)[source]

Replace references to external resources by an in-place (inlined) representation of each resource.

Currently images, stylesheets and scripts are inlined.

Only local (i.e. file) resources/locations are supported. If a non-local resource is requested for inlining, it will be removed (replaced by a blank string), with the goal that the resulting lxml tree will not reference any unreachable resources.

Parameters:document_tree – lxml tree to process.
Returns:lxml tree with some elements replaced by their inlined representation.
class plainbox.impl.exporter.html.HTMLSessionStateExporter(option_list=None, system_id=None, timestamp=None, client_version=None, client_name='plainbox')[source]

Session state exporter creating HTML documents.

It basically applies an xslt to the XMLSessionStateExporter output, and then inlines some resources to produce a monolithic report in a single file.

dump(data, stream)[source]

Public method to dump the HTML report to a stream

dump_etree(root, stream, xslt_template, template_substitutions)[source]

Dumps the given lxml root tree into the given stream, by applying the provided xslt. If template_substitutions is provided, the xslt will first be processed as a string.Template with those substitutions.

Parameters:
  • root – lxml root element of tree to process.
  • stream – Byte stream into which to dump the resulting output.
  • xslt_template – String containing an xslt with which to process the lxml tree to output the desired document type.
  • template_substitutions – Dictionary with substitutions for variables which may be in the xslt_template.

Previous topic

plainbox.impl.exporter – shared code for session state exporters

Next topic

plainbox.impl.exporter.json – JSON exporter

This Page