WhakerPy 0.8

https://sourceforge.net/projects/whakerpy/

Module whakerpy.htmlmaker

Class EmptyNode

Description

A node to represents an HTML empty element.

An HTML element without content is called an empty node. It has a start tag but neither a content nor an end tag.

Constructor

Create a new empty node.

Parameters
  • parent: (str) Parent identifier
  • identifier: (str) This node identifier
  • tag: (str) The element tag
  • attributes: (dict) key=(str) value=(str or None)
Raises
  • NodeInvalidIdentifierError
  • NodeTagError
  • TypeError
View Source
def __init__(self, parent: str, identifier: str, tag: str, attributes: dict=dict()):
    """Create a new empty node.

    :param parent: (str) Parent identifier
    :param identifier: (str) This node identifier
    :param tag: (str) The element tag
    :param attributes: (dict) key=(str) value=(str or None)
    :raises: NodeInvalidIdentifierError:
    :raises: NodeTagError:
    :raises: TypeError:

    """
    super(EmptyNode, self).__init__(parent, identifier, tag, attributes)
    if self.tag not in HTML_EMPTY_TAGS.keys():
        raise NodeTagError(tag)