pydiffx.dom.writer#
Writer for generating a DiffX file from DOM objects.
Classes
A writer for generating a DiffX file from DOM objects. |
- class pydiffx.dom.writer.DiffXDOMWriter#
Bases:
object
A writer for generating a DiffX file from DOM objects.
This will write a
DiffX
object tree to a byte stream, such as a file, HTTP response, or memory-backed stream.If constructing manually, one instance can be reused for multiple DiffX objects.
- writer_cls#
The class to instantiate for writing to a stream.
Subclasses can set this if they need to use a more specialized writer.
- Type
alias of
DiffXWriter
- write_stream(diffx, stream)#
Write a DiffX object to a stream.
- Parameters
diffx (
pydiffx.dom.objects.DiffX
) – The DiffX object to write.stream (
file
orio.IOBase
) – The byte stream to write to.
- Raises
pydiffx.errors.BaseDiffXError – The DiffX contents could not be written. Details will be in the error message.