ั๒
่Rc           @` s๘   d  d k  l Z l Z l Z d  d k l Z d  d k Z e i Z d d k l	 Z	 l
 Z
 d i e
  Z
 d e f d     YZ d	 e f d
     YZ d  d k l Z e i Z e i Z e i Z e i Z e i Z e i Z d Z d e f d     YZ d S(   i    (   t   absolute_importt   divisiont   unicode_literals(   t	   text_typeNi   (   t   voidElementst   spaceCharactersu    t
   TreeWalkerc           B` sw   e  Z d    Z d   Z d   Z e d  Z d   Z d   Z d   Z	 d   Z
 d d e d  Z d	   Z d
   Z RS(   c         C` s   | |  _  d  S(   N(   t   tree(   t   selfR   (    (    sa   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/vendor/html5lib/treewalkers/_base.pyt   __init__   s    c         C` s
   t   d  S(   N(   t   NotImplementedError(   R   (    (    sa   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/vendor/html5lib/treewalkers/_base.pyt   __iter__   s    c         C` s   h d d 6| d 6S(   Nu   SerializeErroru   typeu   data(    (   R   t   msg(    (    sa   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/vendor/html5lib/treewalkers/_base.pyt   error   s    c         c` sต   | d  j p  t | t  p t t |   t | t  p t t |   t d   | i   D  p t  h d d 6| d 6| d 6| d 6V| o |  i t d   Vn d  S(   Nc         s` s[   xT |  ]M \ \ } } } | d  j p t | t  o t | t  o t | t  Vq Wd  S(   N(   t   Nonet
   isinstanceR   (   t   .0t	   namespacet   namet   value(    (    sa   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/vendor/html5lib/treewalkers/_base.pys	   <genexpr>   s   	u   EmptyTagu   typeu   nameu	   namespaceu   datau   Void element has children(	   R   R   R   t   AssertionErrort   typet   allt   itemsR   t   _(   R   R   R   t   attrst   hasChildren(    (    sa   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/vendor/html5lib/treewalkers/_base.pyt   emptyTag   s    - 		c         C` s   | d  j p  t | t  p t t |   t | t  p t t |   t d   | i   D  p t  h d d 6| d 6| d 6| d 6S(   Nc         s` s[   xT |  ]M \ \ } } } | d  j p t | t  o t | t  o t | t  Vq Wd  S(   N(   R   R   R   (   R   R   R   R   (    (    sa   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/vendor/html5lib/treewalkers/_base.pys	   <genexpr>&   s   	u   StartTagu   typeu   nameu	   namespaceu   data(   R   R   R   R   R   R   R   (   R   R   R   R   (    (    sa   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/vendor/html5lib/treewalkers/_base.pyt   startTag#   s    - 	
c         C` sm   | d  j p  t | t  p t t |   t | t  p t t |   h d d 6| d 6| d 6h  d 6S(   Nu   EndTagu   typeu   nameu	   namespaceu   data(   R   R   R   R   R   (   R   R   R   (    (    sa   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/vendor/html5lib/treewalkers/_base.pyt   endTag0   s    - 
c         c` sา   t  | t  p t t |   | } | i t  } | t |  t |   } | o h d d 6| d 6Vn | } | i t  } | t |  } | o h d d 6| d 6Vn | o h d d 6| d 6Vn d  S(   Nu   SpaceCharactersu   typeu   datau
   Characters(   R   R   R   R   t   lstripR   t   lent   rstrip(   R   t   datat   middlet   leftt   right(    (    sa   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/vendor/html5lib/treewalkers/_base.pyt   text9   s     c         C` s2   t  | t  p t t |   h d d 6| d 6S(   Nu   Commentu   typeu   data(   R   R   R   R   (   R   R!   (    (    sa   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/vendor/html5lib/treewalkers/_base.pyt   commentI   s     c         C` sย   | d  j p  t | t  p t t |   | d  j p  t | t  p t t |   | d  j p  t | t  p t t |   h d d 6| d  j	 o | n d d 6| d 6| d 6| d 6S(   Nu   Doctypeu   typeu    u   nameu   publicIdu   systemIdu   correct(   R   R   R   R   R   (   R   R   t   publicIdt   systemIdt   correct(    (    sa   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/vendor/html5lib/treewalkers/_base.pyt   doctypeN   s    ---
c         C` s2   t  | t  p t t |   h d d 6| d 6S(   Nu   Entityu   typeu   name(   R   R   R   R   (   R   R   (    (    sa   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/vendor/html5lib/treewalkers/_base.pyt   entityY   s     c         C` s   |  i  t d  |  S(   Nu   Unknown node type: (   R   R   (   R   t   nodeType(    (    sa   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/vendor/html5lib/treewalkers/_base.pyt   unknown^   s    N(   t   __name__t
   __module__R	   R   R   t   FalseR   R   R   R%   R&   R   t   TrueR*   R+   R-   (    (    (    sa   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/vendor/html5lib/treewalkers/_base.pyR      s   									t   RecursiveTreeWalkerc           B` s   e  Z d    Z d   Z RS(   c         C` s
   t   d  S(   N(   R
   (   R   t   node(    (    sa   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/vendor/html5lib/treewalkers/_base.pyt   walkChildrenc   s    c         c` s   | t  j o, xr |  i | | | |  D] } | Vq& WnJ |  i | |  V| o# x  |  i |  D] } | Vqa Wn |  i |  Vd  S(   N(   R   R   R   R4   R   (   R   R3   R   R   R   R   t   token(    (    sa   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/vendor/html5lib/treewalkers/_base.pyt   elementf   s      (   R.   R/   R4   R6   (    (    (    sa   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/vendor/html5lib/treewalkers/_base.pyR2   b   s   	(   t   Nodeu   <#UNKNOWN#>t   NonRecursiveTreeWalkerc           B` s5   e  Z d    Z d   Z d   Z d   Z d   Z RS(   c         C` s
   t   d  S(   N(   R
   (   R   R3   (    (    sa   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/vendor/html5lib/treewalkers/_base.pyt   getNodeDetails}   s    c         C` s
   t   d  S(   N(   R
   (   R   R3   (    (    sa   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/vendor/html5lib/treewalkers/_base.pyt   getFirstChild   s    c         C` s
   t   d  S(   N(   R
   (   R   R3   (    (    sa   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/vendor/html5lib/treewalkers/_base.pyt   getNextSibling   s    c         C` s
   t   d  S(   N(   R
   (   R   R3   (    (    sa   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/vendor/html5lib/treewalkers/_base.pyt   getParentNode   s    c         c` s  |  i  } xv| d  j	 oh|  i |  } | d | d } } t } | t j o |  i |   Vn| t j o# x|  i |   D] } | Vq Wnๆ | t j oi | \ } } } } | t	 j o2 x% |  i
 | | | |  D] } | Vqื Wt } qw|  i | | |  Vnp | t j o |  i | d  VnM | t j o |  i | d  Vn* | t j o
 t } n |  i | d  V| o |  i |  }	 n d  }	 |	 d  j	 o
 |	 } q xฬ | d  j	 oพ |  i |  } | d | d } } | t j o8 | \ } } } } | t	 j o |  i | |  Vq'n |  i  | j o d  } Pn |  i |  }
 |
 d  j	 o |
 } Pqฑ|  i |  } qฑWq Wd  S(   Ni    i   (   R   R   R9   R0   t   DOCTYPER*   t   TEXTR%   t   ELEMENTR   R   R   t   COMMENTR&   t   ENTITYR+   t   DOCUMENTR1   R-   R:   R   R;   R<   (   R   t   currentNodet   detailsR   R   R5   R   R   t
   attributest
   firstChildt   nextSibling(    (    sa   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/vendor/html5lib/treewalkers/_base.pyR      sb    	   	


 (   R.   R/   R9   R:   R;   R<   R   (    (    (    sa   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/vendor/html5lib/treewalkers/_base.pyR8   |   s
   				(   t
   __future__R    R   R   t   pip.vendor.sixR   t   gettextR   t	   constantsR   R   t   joint   objectR   R2   t   xml.domR7   t   DOCUMENT_NODERB   t   DOCUMENT_TYPE_NODER=   t	   TEXT_NODER>   t   ELEMENT_NODER?   t   COMMENT_NODER@   t   ENTITY_NODERA   t   UNKNOWNR8   (    (    (    sa   /var/www/html/kasc-wg8/erics/lib/python2.6/site-packages/pip/vendor/html5lib/treewalkers/_base.pyt   <module>   s    	W						