ok

Mini Shell

Direktori : /opt/alt/python36/lib/python3.6/site-packages/pip/_vendor/html5lib/treewalkers/
Upload File :
Current File : //opt/alt/python36/lib/python3.6/site-packages/pip/_vendor/html5lib/treewalkers/base.pyc

�
Bu�_c	@`s�ddlmZmZmZddlmZddlmZmZm	Z	ddddd	d
ddd
g	Z
ejZej
ZejZejZejZejZdZdje	�Z	defd��YZdefd��YZdS(i(tabsolute_importtdivisiontunicode_literals(tNodei(t
namespacestvoidElementstspaceCharactersuDOCUMENTuDOCTYPEuTEXTuELEMENTuCOMMENTuENTITYuUNKNOWNu
TreeWalkeruNonRecursiveTreeWalkeru<#UNKNOWN#>ut
TreeWalkercB`szeZdZd�Zd�Zd�Zed�Zd�Zd�Z	d�Z
d�Zddd	�Z
d
�Zd�ZRS(
u}Walks a tree yielding tokens

    Tokens are dicts that all have a ``type`` field specifying the type of the
    token.

    cC`s
||_dS(uCCreates a TreeWalker

        :arg tree: the tree to walk

        N(ttree(tselfR((sV/opt/alt/python36/lib/python3.6/site-packages/pip/_vendor/html5lib/treewalkers/base.pyt__init__scC`s
t�dS(N(tNotImplementedError(R	((sV/opt/alt/python36/lib/python3.6/site-packages/pip/_vendor/html5lib/treewalkers/base.pyt__iter__#scC`sidd6|d6S(u�Generates an error token with the given message

        :arg msg: the error message

        :returns: SerializeError token

        uSerializeErrorutypeudata((R	tmsg((sV/opt/alt/python36/lib/python3.6/site-packages/pip/_vendor/html5lib/treewalkers/base.pyterror&scc`s<idd6|d6|d6|d6V|r8|jd�VndS(urGenerates an EmptyTag token

        :arg namespace: the namespace of the token--can be ``None``

        :arg name: the name of the element

        :arg attrs: the attributes of the element as a dict

        :arg hasChildren: whether or not to yield a SerializationError because
            this tag shouldn't have children

        :returns: EmptyTag token

        uEmptyTagutypeunameu	namespaceudatauVoid element has childrenN(R(R	t	namespacetnametattrsthasChildren((sV/opt/alt/python36/lib/python3.6/site-packages/pip/_vendor/html5lib/treewalkers/base.pytemptyTag0s
	cC`s idd6|d6|d6|d6S(u�Generates a StartTag token

        :arg namespace: the namespace of the token--can be ``None``

        :arg name: the name of the element

        :arg attrs: the attributes of the element as a dict

        :returns: StartTag token

        uStartTagutypeunameu	namespaceudata((R	RRR((sV/opt/alt/python36/lib/python3.6/site-packages/pip/_vendor/html5lib/treewalkers/base.pytstartTagEs
cC`sidd6|d6|d6S(u�Generates an EndTag token

        :arg namespace: the namespace of the token--can be ``None``

        :arg name: the name of the element

        :returns: EndTag token

        uEndTagutypeunameu	namespace((R	RR((sV/opt/alt/python36/lib/python3.6/site-packages/pip/_vendor/html5lib/treewalkers/base.pytendTagVs

cc`s�|}|jt�}|t|�t|� }|rKidd6|d6Vn|}|jt�}|t|�}|r�idd6|d6Vn|r�idd6|d6VndS(utGenerates SpaceCharacters and Characters tokens

        Depending on what's in the data, this generates one or more
        ``SpaceCharacters`` and ``Characters`` tokens.

        For example:

            >>> from html5lib.treewalkers.base import TreeWalker
            >>> # Give it an empty tree just so it instantiates
            >>> walker = TreeWalker([])
            >>> list(walker.text(''))
            []
            >>> list(walker.text('  '))
            [{u'data': '  ', u'type': u'SpaceCharacters'}]
            >>> list(walker.text(' abc '))  # doctest: +NORMALIZE_WHITESPACE
            [{u'data': ' ', u'type': u'SpaceCharacters'},
            {u'data': u'abc', u'type': u'Characters'},
            {u'data': u' ', u'type': u'SpaceCharacters'}]

        :arg data: the text data

        :returns: one or more ``SpaceCharacters`` and ``Characters`` tokens

        uSpaceCharactersutypeudatau
CharactersN(tlstripRtlentrstrip(R	tdatatmiddletlefttright((sV/opt/alt/python36/lib/python3.6/site-packages/pip/_vendor/html5lib/treewalkers/base.pyttextdscC`sidd6|d6S(udGenerates a Comment token

        :arg data: the comment

        :returns: Comment token

        uCommentutypeudata((R	R((sV/opt/alt/python36/lib/python3.6/site-packages/pip/_vendor/html5lib/treewalkers/base.pytcomment�scC`s idd6|d6|d6|d6S(u�Generates a Doctype token

        :arg name:

        :arg publicId:

        :arg systemId:

        :returns: the Doctype token

        uDoctypeutypeunameupublicIdusystemId((R	RtpublicIdtsystemId((sV/opt/alt/python36/lib/python3.6/site-packages/pip/_vendor/html5lib/treewalkers/base.pytdoctype�s
cC`sidd6|d6S(ujGenerates an Entity token

        :arg name: the entity name

        :returns: an Entity token

        uEntityutypeuname((R	R((sV/opt/alt/python36/lib/python3.6/site-packages/pip/_vendor/html5lib/treewalkers/base.pytentity�scC`s|jd|�S(uHandles unknown node typesuUnknown node type: (R(R	tnodeType((sV/opt/alt/python36/lib/python3.6/site-packages/pip/_vendor/html5lib/treewalkers/base.pytunknown�sN(t__name__t
__module__t__doc__R
RRtFalseRRRRRtNoneR!R"R$(((sV/opt/alt/python36/lib/python3.6/site-packages/pip/_vendor/html5lib/treewalkers/base.pyRs			
			&	
	
tNonRecursiveTreeWalkercB`s5eZd�Zd�Zd�Zd�Zd�ZRS(cC`s
t�dS(N(R(R	tnode((sV/opt/alt/python36/lib/python3.6/site-packages/pip/_vendor/html5lib/treewalkers/base.pytgetNodeDetails�scC`s
t�dS(N(R(R	R+((sV/opt/alt/python36/lib/python3.6/site-packages/pip/_vendor/html5lib/treewalkers/base.pyt
getFirstChild�scC`s
t�dS(N(R(R	R+((sV/opt/alt/python36/lib/python3.6/site-packages/pip/_vendor/html5lib/treewalkers/base.pytgetNextSibling�scC`s
t�dS(N(R(R	R+((sV/opt/alt/python36/lib/python3.6/site-packages/pip/_vendor/html5lib/treewalkers/base.pyt
getParentNode�scc`s�|j}x�|dk	r�|j|�}|d|d}}t}|tkr_|j|�Vn |tkr�x|j|�D]}|Vq{Wn�|tkr|\}}}}|s�|t	dkr�|t
kr�x%|j||||�D]}|Vq�Wt}q|j|||�Vni|t
kr7|j|d�VnH|tkrX|j|d�Vn'|tkrmt}n|j|d�V|r�|j|�}	nd}	|	dk	r�|	}qx�|dk	r�|j|�}|d|d}}|tkr<|\}}}}|r|t	dks%|t
kr<|j||�Vq<n|j|krUd}Pn|j|�}
|
dk	rz|
}Pq�|j|�}q�WqWdS(Niiuhtml(RR)R,R(tDOCTYPER!tTEXTRtELEMENTRRRRtCOMMENTRtENTITYR"tDOCUMENTtTrueR$R-RR.R/(R	tcurrentNodetdetailsttypeRttokenRRt
attributest
firstChildtnextSibling((sV/opt/alt/python36/lib/python3.6/site-packages/pip/_vendor/html5lib/treewalkers/base.pyR�sZ	#
				"(R%R&R,R-R.R/R(((sV/opt/alt/python36/lib/python3.6/site-packages/pip/_vendor/html5lib/treewalkers/base.pyR*�s
				N(t
__future__RRRtxml.domRt	constantsRRRt__all__t
DOCUMENT_NODER5tDOCUMENT_TYPE_NODER0t	TEXT_NODER1tELEMENT_NODER2tCOMMENT_NODER3tENTITY_NODER4tUNKNOWNtjointobjectRR*(((sV/opt/alt/python36/lib/python3.6/site-packages/pip/_vendor/html5lib/treewalkers/base.pyt<module>s						�

Zerion Mini Shell 1.0