Ñò
•èRc           @` sT   d  Z  d d k l Z l Z l Z d d k Z d d k l Z h  Z d d „ Z
 d S(   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    (   t   absolute_importt   divisiont   unicode_literalsNi   (   t   default_etreec         K` s  |  i  ƒ  }  |  t j oí |  d j o8 d t |  f } t | ƒ t i | } | i t |  <q|  d j o! d d k l } | i t |  <q|  d j o! d d k l	 } | i t |  <q|  d	 j o; d d
 k l
 } | d j o
 t } n | i | |  i Sn t i |  ƒ S(   u6  Get a TreeWalker class for various types of tree with built-in support

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

                "dom" - The xml.dom.minidom DOM implementation
                "pulldom" - The xml.dom.pulldom event stream
                "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 - (Currently applies to the "etree" tree type only). A module
                      implementing the tree type e.g. xml.etree.ElementTree or
                      cElementTree.u   domu   pulldomu   %s.%su   genshii   (   t   genshistreamu   lxml(   t	   lxmletreeu   etree(   t   etree(   u   domu   pulldomN(   t   lowert   treeWalkerCachet   __name__t
   __import__t   syst   modulest
   TreeWalkert    R   R   R   t   NoneR   t   getETreeModulet   get(   t   treeTypet   implementationt   kwargst   namet   modR   R   R   (    (    sd   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/vendor/html5lib/treewalkers/__init__.pyt   getTreeWalker   s&    

(   t   __doc__t
   __future__R    R   R   R   t   utilsR   R   R   R   (    (    (    sd   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/vendor/html5lib/treewalkers/__init__.pyt   <module>	   s
   