Viewing File: /usr/lib/python3.6/site-packages/pip/_vendor/html5lib/treebuilders/__pycache__/base.cpython-36.pyc
3
ajv6 @ s d dl mZmZmZ d dlmZ ddlmZmZm Z dZ
eedfeeee d dfgB dfeeee d d fe d d
fgB dfee d dfe d dfgdfee d dfe d d
fgdfdZ
G dd deZG dd deZG dd deZdS ) )absolute_importdivisionunicode_literals) text_type )scopingElementstableInsertModeElements
namespacesNFhtmlbuttonZolZultableoptgroupoptionT)Nr listr Zselectc @ s^ e Zd Zdd Zdd Zdd Zdd Zdd
dZdd
Zdd Z dd Z
dd Zdd Zd S )Nodec C s( || _ d| _d| _i | _g | _g | _dS )a6 Node representing an item in the tree.
name - The tag name associated with the node
parent - The parent of the current node (or None for the document node)
value - The value of the current node (applies to text nodes and
comments
attributes - a dict holding name, value pairs for attributes of the node
childNodes - a list of child nodes of the current node. This must
include all elements but not necessarily other node types
_flags - A list of miscellaneous flags that can be set on the node
N)nameparentvalue
attributes
childNodesZ_flags)selfr r /usr/lib/python3.6/base.py__init__ s z
Node.__init__c C s: dj dd | jj D }|r,d| j|f S d| j S d S )N c S s g | ]\}}d ||f qS )z%s="%s"r ).0r r r r r
<listcomp>+ s z Node.__str__.<locals>.<listcomp>z<%s %s>z<%s>)joinr itemsr )r Z
attributesStrr r r __str__* s
zNode.__str__c C s
d| j S )Nz<%s>)r )r r r r __repr__3 s z
Node.__repr__c C s t dS )z3Insert node as a child of the current node
N)NotImplementedError)r noder r r appendChild6 s zNode.appendChildNc C s t dS )zInsert data as text in the current node, positioned before the
start of node insertBefore or to the end of the node's text.
N)r! )r datainsertBeforer r r
insertText; s zNode.insertTextc C s t dS )zInsert node as a child of the current node, before refNode in the
list of child nodes. Raises ValueError if refNode is not a child of
the current nodeN)r! )r r"