eric5.E5XML.XMLWriterBase

Module implementing a base class for all of eric5s XML writers.

Global Attributes

None

Classes

XMLWriterBase Class implementing a base class for all of eric5s XML writers.

Functions

None


XMLWriterBase

Class implementing a base class for all of eric5s XML writers.

Derived from

object

Class Attributes

None

Methods

XMLWriterBase Constructor
_write Protected method used to do the real write operation.
_writeBasics Protected method to dump an object of a basic Python type.
_write_bool Protected method to dump a bool object.
_write_bytearray Protected method to dump a bytearray object.
_write_bytes Protected method to dump a bytes object.
_write_complex Protected method to dump a complex object.
_write_dictionary Protected method to dump a dict object.
_write_float Protected method to dump a float object.
_write_frozenset Protected method to dump a frozenset object.
_write_int Protected method to dump an int object.
_write_list Protected method to dump a list object.
_write_none Protected method to dump a NoneType object.
_write_set Protected method to dump a set object.
_write_string Protected method to dump a str object.
_write_tuple Protected method to dump a tuple object.
_write_unimplemented Protected method to dump a type, that has no special method.
encodedNewLines Public method to encode newlines and paragraph breaks.
escape Function to escape &, <, and > in a string of data.
writeXML Public method to write the XML to the file.

XMLWriterBase (Constructor)

XMLWriterBase(file)

Constructor

file
open file (like) object for writing

XMLWriterBase._write

_write(s, newline = True)

Protected method used to do the real write operation.

s
string to be written to the XML file
newline
flag indicating a linebreak

XMLWriterBase._writeBasics

_writeBasics(pyobject, indent = 0)

Protected method to dump an object of a basic Python type.

pyobject
object to be dumped
indent
indentation level for prettier output (integer)

XMLWriterBase._write_bool

_write_bool(value, indent)

Protected method to dump a bool object.

value
value to be dumped (boolean)
indent
indentation level for prettier output (integer)

XMLWriterBase._write_bytearray

_write_bytearray(value, indent)

Protected method to dump a bytearray object.

value
value to be dumped (bytearray)
indent
indentation level for prettier output (integer)

XMLWriterBase._write_bytes

_write_bytes(value, indent)

Protected method to dump a bytes object.

value
value to be dumped (bytes)
indent
indentation level for prettier output (integer)

XMLWriterBase._write_complex

_write_complex(value, indent)

Protected method to dump a complex object.

value
value to be dumped (complex)
indent
indentation level for prettier output (integer)

XMLWriterBase._write_dictionary

_write_dictionary(value, indent)

Protected method to dump a dict object.

value
value to be dumped (dictionary)
indent
indentation level for prettier output (integer)

XMLWriterBase._write_float

_write_float(value, indent)

Protected method to dump a float object.

value
value to be dumped (float)
indent
indentation level for prettier output (integer)

XMLWriterBase._write_frozenset

_write_frozenset(value, indent)

Protected method to dump a frozenset object.

value
value to be dumped (frozenset)
indent
indentation level for prettier output (integer)

XMLWriterBase._write_int

_write_int(value, indent)

Protected method to dump an int object.

value
value to be dumped (integer)
indent
indentation level for prettier output (integer)

XMLWriterBase._write_list

_write_list(value, indent)

Protected method to dump a list object.

value
value to be dumped (list)
indent
indentation level for prettier output (integer)

XMLWriterBase._write_none

_write_none(value, indent)

Protected method to dump a NoneType object.

value
value to be dumped (None) (ignored)
indent
indentation level for prettier output (integer)

XMLWriterBase._write_set

_write_set(value, indent)

Protected method to dump a set object.

value
value to be dumped (set)
indent
indentation level for prettier output (integer)

XMLWriterBase._write_string

_write_string(value, indent)

Protected method to dump a str object.

value
value to be dumped (string)
indent
indentation level for prettier output (integer)

XMLWriterBase._write_tuple

_write_tuple(value, indent)

Protected method to dump a tuple object.

value
value to be dumped (tuple)
indent
indentation level for prettier output (integer)

XMLWriterBase._write_unimplemented

_write_unimplemented(value, indent)

Protected method to dump a type, that has no special method.

value
value to be dumped (any pickleable object)
indent
indentation level for prettier output (integer)

XMLWriterBase.encodedNewLines

encodedNewLines(text)

Public method to encode newlines and paragraph breaks.

text
text to encode (string)

XMLWriterBase.escape

escape(data, attribute=False)

Function to escape &, <, and > in a string of data.

data
data to be escaped (string)
attribute
flag indicating escaping is done for an attribute
Returns:
the escaped data (string)

XMLWriterBase.writeXML

writeXML()

Public method to write the XML to the file.

Up