ok

Mini Shell

Direktori : /lib/python2.7/site-packages/pip/_vendor/html5lib/treewalkers/
Upload File :
Current File : //lib/python2.7/site-packages/pip/_vendor/html5lib/treewalkers/__init__.pyc

�
��abc@`s�dZddlmZmZmZddlmZddlmZdddd	d
dgZ	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 do
implement a tree walker object (called TreeWalker by convention) that
implements a 'serialize' method taking a tree as sole argument and
returning an iterator generating tokens.
i(tabsolute_importtdivisiontunicode_literalsi(t	constants(t
default_etreeu
getTreeWalkerupprintudomuetreeugenshiu
etree_lxmlcK`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

    Args:
        treeType (str): 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

        Implementation: A module implementing the tree type e.g.
            xml.etree.ElementTree or cElementTree (Currently applies to the
            "etree" tree type only).
    udomi(tdomugenshi(tgenshiulxml(t
etree_lxmluetree(tetreeN(tlowerttreeWalkerCachetRt
TreeWalkerRRRtNoneRtgetETreeModuletget(ttreeTypetimplementationtkwargsRRRR((sM/usr/lib/python2.7/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((sM/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/treewalkers/__init__.pytconcatenateCharacterTokens<s

		cC`sg}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�ts�td��qt	d|��qWdj
|�S( uPretty printer for tree walkersiutypeuStartTaguEmptyTagu	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"uSpaceCharactersuBconcatenateCharacterTokens should have got rid of all Space tokensuUnknown token type, %su
(uStartTaguEmptyTag(RRt
namespacestprefixesRtsortedtitemstFalsetAssertionErrort
ValueErrorR(twalkertoutputtindentRRtnstnametattrst	namespacet	localnametvalue((sM/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/treewalkers/__init__.pytpprintKsd
!



%"
"

	"
	"N(t__doc__t
__future__RRRRRt_utilsRt__all__R
R
RRR+(((sM/usr/lib/python2.7/site-packages/pip/_vendor/html5lib/treewalkers/__init__.pyt<module>	s'	

Zerion Mini Shell 1.0