Ñò
•èRc           @` s•   d  d k  l Z l Z l Z d  d k Z e i Z d  d k Z d  d k l Z d d k	 l
 Z
 d d k l Z e i d ƒ Z d	 „  Z e e ƒ Z d S(
   i    (   t   absolute_importt   divisiont   unicode_literalsN(   t	   text_typei   (   t   _basei   (   t   moduleFactoryFactoryu   {([^}]*)}(.*)c         ` s>   |  } | i  d ƒ i ‰  d t i f ‡  f d †  ƒ  Y} t ƒ  S(   Nu   asdt
   TreeWalkerc           ` s8   e  Z d  Z ‡  f d †  Z d „  Z d „  Z d „  Z RS(   uË  Given the particular ElementTree representation, this implementation,
        to avoid using recursion, returns "nodes" as tuples with the following
        content:

        1. The current element

        2. The index of the element relative to its parent

        3. A stack of ancestor elements

        4. A flag "text", "tail" or None to indicate if the current node is a
           text node; either the text or tail of the current element (1)
        c         ` sî  t  | t ƒ o@ | \ } } } } | d j o t i t | | ƒ f S| } n t | d ƒ p | i ƒ  } n | i d j o t i f S| i d j o) t i	 | i
 | i d ƒ | i d ƒ f S| i ˆ  j o t i | i
 f St | i ƒ t j p t t | i ƒ ‚ t i | i ƒ } | o | i ƒ  \ } } n d  } | i } h  }	 xo t | i i ƒ  ƒ D]X \ }
 } t i |
 ƒ } | o& | |	 | i d	 ƒ | i d
 ƒ f <qh| |	 d  |
 f <qhWt i | | |	 t | ƒ p | i
 f Sd  S(   Nu   textu   tailu   tagu   DOCUMENT_ROOTu   DOCUMENT_FRAGMENTu
   <!DOCTYPE>u   publicIdu   systemIdi   i   (   u   textu   tail(   u   DOCUMENT_ROOTu   DOCUMENT_FRAGMENT(   t
   isinstancet   tupleR   t   TEXTt   getattrt   hasattrt   getroott   tagt   DOCUMENTt   DOCTYPEt   textt   gett   COMMENTt   typeR   t   AssertionErrort
   tag_regexpt   matcht   groupst   Nonet   listt   attribt   itemst   groupt   ELEMENTt   len(   t   selft   nodet   eltt   keyt   parentst   flagR   t	   namespaceR   t   attrst   namet   value(   t   ElementTreeCommentType(    sa   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/vendor/html5lib/treewalkers/etree.pyt   getNodeDetails"   s:    
)	 &c         S` s¨   t  | t ƒ o | \ } } } } n | d  g  d  f \ } } } } | d j o d  S| i o | | | d f St | ƒ o" | i | ƒ | d d | d  f Sd  Sd  S(   Nu   textu   taili    (   u   textu   tail(   R   R   R   R   R   t   append(   R   R    t   elementR"   R#   R$   (    (    sa   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/vendor/html5lib/treewalkers/etree.pyt   getFirstChildJ   s    
c         S` sÚ   t  | t ƒ o | \ } } } } n d  S| d j o7 t | ƒ o" | i | ƒ | d d | d  f Sd  Sni | i o | d j o | | | d f S| t | d ƒ d j  o! | d | d | d | d  f Sd  Sd  S(   Nu   texti    u   tailiÿÿÿÿi   (   R   R   R   R   R+   t   tail(   R   R    R,   R"   R#   R$   (    (    sa   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/vendor/html5lib/treewalkers/etree.pyt   getNextSibling[   s    !c         S` s–   t  | t ƒ o | \ } } } } n d  S| d j o  | p | S| | | d  f Sn< | i ƒ  } | p | S| t | d ƒ i | ƒ | d  f Sd  S(   Nu   textiÿÿÿÿ(   R   R   R   t   popR   t   index(   R   R    R,   R"   R#   R$   t   parent(    (    sa   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/vendor/html5lib/treewalkers/etree.pyt   getParentNodeo   s    (   t   __name__t
   __module__t   __doc__R*   R-   R/   R3   (    (   R)   (    sa   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/vendor/html5lib/treewalkers/etree.pyR      s
   (		(   t   CommentR   R   t   NonRecursiveTreeWalkert   locals(   t   ElementTreeImplementationt   ElementTreeR   (    (   R)   sa   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/vendor/html5lib/treewalkers/etree.pyt   getETreeBuilder   s    m(   t
   __future__R    R   R   t   gettextt   _t   ret   pip.vendor.sixR   t    R   t   utilsR   t   compileR   R<   t   getETreeModule(    (    (    sa   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/vendor/html5lib/treewalkers/etree.pyt   <module>   s   		s