dasbus.xml module

class XMLGenerator[source]

Bases: XMLParser

Class for generating XML.

static add_child(parent_element, child_element)[source]

Append the child element to the parent element.

static add_comment(element, comment)[source]
static create_interface(name)[source]

Create an interface element.

static create_method(name)[source]

Create a method element.

static create_node()[source]

Create a node element called node.

static create_parameter(name, param_type, direction)[source]

Create a parameter element.

static create_property(name, property_type, access)[source]

Create a property element.

static create_signal(name)[source]

Create a signal element.

static element_to_xml(element)[source]

Return XML of the element.

static prettify_xml(xml)[source]

Return pretty printed normalized XML.

Python 3.8 changed the order of the attributes and introduced the function canonicalize that should be used to normalize XML.

class XMLParser[source]

Bases: object

Class for parsing XML.

static get_access(node)[source]
static get_direction(node)[source]
static get_interfaces_from_node(node_element)[source]

Return a dictionary of interfaces defined in a node element.

static get_name(node)[source]
static get_type(node)[source]
static has_name(node, node_name)[source]
static is_interface(member_node)[source]
static is_member(member_node)[source]
static is_method(member_node)[source]
static is_parameter(member_node)[source]
static is_property(member_node)[source]
static is_signal(member_node)[source]
static xml_to_element(xml)[source]