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/__init__.pyo

�
Bu�_c@`svdZddlmZmZmZddlmZddlmZddgZ	iZ
dd�Zd	�Z
d
�ZdS(u�A collection of modules for iterating through different kinds of
tree, generating tokens identical to those produced by the tokenizer
module.

To create a tree walker for a new type of tree, you need to
implement a tree walker object (called TreeWalker by convention) that
implements a 'serialize' method which takes a tree as sole argument and
returns an iterator which generates tokens.
i(tabsolute_importtdivisiontunicode_literalsi(t	constants(t
default_etreeu
getTreeWalkerupprintcK`s�|j�}|tkr�|dkrDddlm}|jt|<q�|dkrpddlm}|jt|<q�|dkr�ddlm}|jt|<q�|dkr�dd	lm}|d
kr�t	}n|j
||�jSntj|�S(u;Get a TreeWalker class for various types of tree with built-in support

    :arg str treeType: the name of the tree type required (case-insensitive).
        Supported values are:

        * "dom": The xml.dom.minidom DOM implementation
        * "etree": A generic walker for tree implementations exposing an
          elementtree-like interface (known to work with ElementTree,
          cElementTree and lxml.etree).
        * "lxml": Optimized walker for lxml.etree
        * "genshi": a Genshi stream

    :arg implementation: A module implementing the tree type e.g.
        xml.etree.ElementTree or cElementTree (Currently applies to the "etree"
        tree type only).

    :arg kwargs: keyword arguments passed to the etree walker--for other
        walkers, this has no effect

    :returns: a TreeWalker class

    udomi(tdomugenshi(tgenshiulxml(t
etree_lxmluetree(tetreeN(tlowerttreeWalkerCachetRt
TreeWalkerRRRtNoneRtgetETreeModuletget(ttreeTypetimplementationtkwargsRRRR((sZ/opt/alt/python36/lib/python3.6/site-packages/pip/_vendor/html5lib/treewalkers/__init__.pyt
getTreeWalkers"	cc`s�g}xh|D]`}|d}|dkr=|j|d�q
|rhidd6dj|�d6Vg}n|Vq
W|r�idd6dj|�d6VndS(Nutypeu
CharactersuSpaceCharactersudatau(u
CharactersuSpaceCharacters(tappendtjoin(ttokenstpendingCharactersttokenttype((sZ/opt/alt/python36/lib/python3.6/site-packages/pip/_vendor/html5lib/treewalkers/__init__.pytconcatenateCharacterTokensAs

		cC`s�g}d}x�t|�D]�}|d}|dkr~|dr�|dtjdkr�|dtjkr}tj|d}n
|d}d||df}n
|d}|jd	d
||f�|d7}|d}x�t|j��D]t\\}}	}
|r:|tjkr!tj|}n|}d||	f}n|	}|jd
d
|||
f�q�W|dkr�|d8}q�q|dkr�|d8}q|dkr�|jdd
||df�q|dkr�|drz|dr%|jdd
||d|d|dr|dndf�q�|drX|jdd
||d|df�q�|jdd
||df�q�|jdd
|f�q|dkr�|jdd
||df�q|dkr�qtd|��qWdj|�S(u�Pretty printer for tree walkers

    Takes a TreeWalker instance and pretty prints the output of walking the tree.

    :arg walker: a TreeWalker instance

    iutypeuStartTaguEmptyTagu	namespaceuhtmlu%s %sunameu%s<%s>u iudatau	%s%s="%s"uEndTaguCommentu
%s<!-- %s -->uDoctypeupublicIdu%s<!DOCTYPE %s "%s" "%s">usystemIduu%s<!DOCTYPE %s "" "%s">u%s<!DOCTYPE %s>u
%s<!DOCTYPE >u
Charactersu%s"%s"uSpaceCharactersuUnknown token type, %su
(uStartTaguEmptyTag(	RRt
namespacestprefixesRtsortedtitemst
ValueErrorR(twalkertoutputtindentRRtnstnametattrst	namespacet	localnametvalue((sZ/opt/alt/python36/lib/python3.6/site-packages/pip/_vendor/html5lib/treewalkers/__init__.pytpprintPsd
!



%"
"

	"
	"N(t__doc__t
__future__RRRRRt_utilsRt__all__R
R
RRR)(((sZ/opt/alt/python36/lib/python3.6/site-packages/pip/_vendor/html5lib/treewalkers/__init__.pyt<module>	s,	

Zerion Mini Shell 1.0