£Á°èZ¨Ä…–K§‚«“ô4“ÒÙ´dîfUÙÃÅ WKbyÊ¦•êŽ…È®FÒ¿ÊÎóCozá¬S@6{Í:›œêZÌ:Š•_%:¢¾¾~;‘Ã~èŠ©ÊÇí`ÔÑ©úë™µ'5I¿fš×WO%ø9¾«¾DK|€ùÍD”Ýs]nHÕ¶ê×Ó¼ãžªéUWŸÈË%DÒÕ¬ï‘]/Åcx  ‰ï2ß]ä6G[]S£ÔÏ¯rs{úëóµmÒï#UQxo·õÞCe]"±/aÙ&Eã4ú9Jé_ÞåëdãöKë)AÞ                  ¯¹ægƒÛowÐø^d™ý½ßB7áyMä9ÜÖUã
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
<html>

Rec           @` su  d  Z  d d l m Z m Z m Z d d l Z d d l Z d d l Z y d d l m	 Z	 Wn! e
 k
 r} d d l m	 Z	 n Xd d l m Z d d l m Z d d	 l m Z d d
 l m Z d d l m Z d d l j Z d d l m Z m Z e Z e j d  Z e j d  j Z d e f d     YZ d e f d     YZ  d   Z! d   Z" d e j# f d     YZ# d S(   u  Module for supporting the lxml.etree library. The idea here is to use as much
of the native library as possible, without using fragile hacks like custom element
names that break between releases. The downside of this is that we cannot represent
all possible trees; specifically the following are known to cause problems:

Text or comments as siblings of the root element
Docypes with no name

When any of these things occur, we emit a DataLossWarning
i    (   t   absolute_importt   divisiont   unicode_literalsN(   t   MutableMappingi   (   t   basei   (   t   DataLossWarning(   t	   constants(   t   etree(   t	   _ihatexml(   t   PY3t   binary_typeu   {([^}]*)}(.*)u   asdt   DocumentTypec           B` s   e  Z d    Z RS(   c         C` s   | |  _  | |  _ | |  _ d  S(   N(   t   namet   publicIdt   systemId(   t   selfR   R   R   (    (    s   /builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree_lxml.pyt   __init__)   s    		(   t   __name__t
   __module__R   (    (    (    s   /builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree_lxml.pyR   (   s   t   Documentc           B` s/   e  Z d    Z d   Z d   Z e e  Z RS(   c         C` s   d  |  _ g  |  _ d  S(   N(   t   Nonet   _elementTreet   _childNodes(   R   (    (    s   /builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree_lxml.pyR   0   s    	c         C` sC   |  j  j   } x |  j  j   j   D] } q% W| j | j  d  S(   N(   R   t   getroott   itersiblingst   addnextt   _element(   R   t   elementt   last(    (    s   /builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree_lxml.pyt   appendChild4   s    c         C` s   |  j  S(   N(   R   (   R   (    (    s   /builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree_lxml.pyt   _getChildNodes;   s    (   R   R   R   R   R   t   propertyt
   childNodes(    (    (    s   /builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree_lxml.pyR   /   s   			c         ` sJ   g   t  j d t    d     f d    |  d  d j   S(   Nt   preventDoubleDashCommentsi    c         ` sM  t  |  d  st  |  d  r j d  |  j j r |  j j pL |  j j sb d |  j j } n% d |  j j |  j j |  j j f }  j d d | d | f  n  |  j   } x" | j   d  k	 r | j   } q Wx | d  k	 r	 | | d  | j
   } q WqIt |  t  s+t |  t  rqt |  t  sSt j d	 d k sSt   j d
 d | |  f  qI j d  x|  D] }  | | d  qWn|  j t k r j d d | |  j f  t  |  d  rI|  j rI j d
 d | |  j f  qIn=t |  t j  s$t  t j j |  j  } | d  k	 r| j d  } | j d  } t j | }  j d d | |   j |  f  n'  j d d |   j |  j  f  t  |  d  rg  } x |  j j   D] \ }	 }
 t j |	  } | d  k	 rN| j    \ } }	   j |	  }	 t j | } d | |	 f } n   j |	  } | j | |
 f  qWx? t! |  D]. \ }	 }
  j d d | d |	 |
 f  qWn  |  j r j d
 d | d |  j f  n  | d 7} x |  D] }  | |  qWt  |  d  rI|  j rI j d
 d | d |  j f  n  d  S(   Nu   tagu   getrootu	   #documentu   <!DOCTYPE %s>u   <!DOCTYPE %s "%s" "%s">u   |%s%su    i   i    u   |%s"%s"u   #document-fragmentu   |%s<!-- %s -->u   taili   u
   |%s<%s %s>u   |%s<%s>u   attribu   %s %su
   |%s%s="%s"("   t   hasattrt   appendt   docinfot   internalDTDt	   public_idt
   system_urlt	   root_nameR   t   getpreviousR   t   getnextt
   isinstancet   strt   bytest   syst   version_infot   AssertionErrort   tagt   comment_typet   textt   tailR   t   _Elementt   etree_builderst
   tag_regexpt   matcht   groupR   t   prefixest   fromXmlNamet   attribt   itemst   groupst   sorted(   R   t   indentt   dtd_strt   next_elementt   nsmatcht   nsR1   t   prefixt
   attributesR   t   valuet   attr_stringt   child(   t   infosetFiltert   rvt   serializeElement(    s   /builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree_lxml.pyRL   E   st    		"($)	%
u   
(   R   t   InfosetFiltert   Truet   join(   R   (    (   RJ   RK   RL   s   /builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree_lxml.pyt   testSerializerA   s
    Fc         ` s/   g       f d     |   d j     S(   u4   Serialize an element and its child nodes to a stringc         ` s  t  |  d  si |  j j rV |  j j r6 |  j j } n d |  j j }   j |  n   |  j    n |  j t k r   j d |  j	 f  n |  j
 s   j d |  j f  nU d j g  |  j
 j   D] \ } } d | | f ^ q  }   j d |  j | f  |  j	 r&  j |  j	  n  x |  D] }  |  q-W  j d |  j f  t  |  d	  r|  j r  j |  j  n  d  S(
   Nu   tagu   <!DOCTYPE %s>u	   <!--%s-->u   <%s>u    u   %s="%s"u   <%s %s>u   </%s>u   tail(   R"   R$   R%   t   doctypeR(   R#   R   R1   R2   R3   R<   RO   R=   R4   (   R   RA   R   RG   t   attrRI   (   RK   RL   (    s   /builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree_lxml.pyRL      s*    		2	u    (   RO   (   R   (    (   RK   RL   s   /builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree_lxml.pyt   tostring   s     
t   TreeBuilderc           B` s   e  Z e Z e Z d	 Z d	 Z e Z	 e
 Z e d   Z d   Z d   Z d   Z d   Z d   Z d	 d  Z d	 d  Z d   Z RS(
   c         ` s   t  j t d |  t j d t   |  _ | |  _ d t f  f d     Y  d  j	 f     f d     Y} d  j
 f   f d     Y} | |  _ | |  _ t j j |  |  d  S(	   Nt   fullTreeR!   t
   Attributesc           ` sV   e  Z d    Z   f d   Z d   Z d   Z d   Z d   Z d   Z d   Z	 RS(   c         S` s   | |  _  d  S(   N(   R   (   R   R   (    (    s   /builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree_lxml.pyR      s    c         ` sF   t  | t  r3 d | d   j | d  f } n   j |  } | S(   Nu   {%s}%si   i   (   R+   t   tuplet   coerceAttribute(   R   t   keyR   (   RJ   (    s   /builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree_lxml.pyt
   _coerceKey   s    $c         S` sH   |  j  j  j |  j |  } t rD t | t  rD | j d  } n  | S(   Nu   ascii(   R   R<   RZ   R	   R+   R
   t   decode(   R   RY   RG   (    (    s   /builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree_lxml.pyt   __getitem__   s    c         S` s    | |  j  j  j |  j |  <d  S(   N(   R   R<   RZ   (   R   RY   RG   (    (    s   /builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree_lxml.pyt   __setitem__   s    c         S` s   |  j  j  j |  j |  =d  S(   N(   R   R<   RZ   (   R   RY   (    (    s   /builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree_lxml.pyt   __delitem__   s    c         S` s   t  |  j j j  S(   N(   t   iterR   R<   (   R   (    (    s   /builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree_lxml.pyt   __iter__   s    c         S` s   t  |  j j j  S(   N(   t   lenR   R<   (   R   (    (    s   /builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree_lxml.pyt   __len__   s    c         S` s   |  j  j  j j   S(   N(   R   R<   t   clear(   R   (    (    s   /builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree_lxml.pyRc      s    (
   R   R   R   RZ   R\   R]   R^   R`   Rb   Rc   (    (   RJ   (    s   /builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree_lxml.pyRV      s   						t   Elementc           ` s   e  Z     f d    Z  f d   Z  f d   Z e e e  Z d   Z d   Z e e e  Z	 d   f d  Z d   Z RS(   c         ` s;    j  |  }  j j |  | d |   |   |  _ d  S(   Nt	   namespace(   t   coerceElementRd   R   t   _attributes(   R   R   Re   (   RV   t   builderRJ   (    s   /builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree_lxml.pyR      s    c         ` s4     j  |  |  _ |  j |  j |  j  |  j _ d  S(   N(   Rf   t   _namet   _getETreeTagt
   _namespaceR   R1   (   R   R   (   RJ   (    s   /builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree_lxml.pyt   _setName   s    c         ` s     j  |  j  S(   N(   R;   Ri   (   R   (   RJ   (    s   /builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree_lxml.pyt   _getName   s    c         S` s   |  j  S(   N(   Rg   (   R   (    (    s   /builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree_lxml.pyt   _getAttributes   s    c         S` s$   |  j  } | j   | j |  d  S(   N(   RF   Rc   t   update(   R   RG   RF   (    (    s   /builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree_lxml.pyt   _setAttributes   s    	
c         ` s)    j  |  }   j j |  | |  d  S(   N(   t   coerceCharactersRd   t
   insertText(   R   t   datat   insertBefore(   Rh   RJ   (    s   /builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree_lxml.pyRr      s    c         S` sG   t  |   |  j |  j  } |  j j rC | j j j |  j j  n  | S(   N(   t   typeR   Re   R   R<   Ro   (   R   R   (    (    s   /builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree_lxml.pyt	   cloneNode  s    N(   R   R   R   Rl   Rm   R   R   Rn   Rp   RF   R   Rr   Rv   (    (   RV   Rh   RJ   (    s   /builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree_lxml.pyRd      s   		t   Commentc           ` sA   e  Z    f d    Z  f d   Z d   Z e e e  Z RS(   c         ` s&    j  |  }   j j |  |  d  S(   N(   t   coerceCommentRw   R   (   R   Rs   (   Rh   RJ   (    s   /builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree_lxml.pyR     s    c         ` s     j  |  } | |  j _ d  S(   N(   Rx   R   R3   (   R   Rs   (   RJ   (    s   /builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree_lxml.pyt   _setData  s    c         S` s
   |  j  j S(   N(   R   R3   (   R   (    (    s   /builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree_lxml.pyt   _getData  s    (   R   R   R   Ry   Rz   R   Rs   (    (   Rh   RJ   (    s   /builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree_lxml.pyRw   
  s   	(   R6   t   getETreeModuleR   R   RM   RN   RJ   t   namespaceHTMLElementsR   Rd   Rw   t   elementClasst   commentClassR   RT   R   (   R   R|   RU   Rd   Rw   (    (   RV   Rh   RJ   s   /builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree_lxml.pyR      s    	 %$"		c         C` s2   t  j j |   |  j |  _ g  |  _ d  |  _ d  S(   N(   R   RT   t   resett   insertCommentInitialt   insertCommentt   initial_commentsR   RQ   (   R   (    (    s   /builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree_lxml.pyR     s    	c         C` s
   t  |  S(   N(   RP   (   R   R   (    (    s   /builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree_lxml.pyRP   #  s    c         C` s$   t  r |  j j S|  j j j   Sd  S(   N(   RU   t   documentR   R   (   R   (    (    s   /builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree_lxml.pyt   getDocument&  s    
c         C` se   g  } |  j  d j } | j r2 | j | j  n  | j t |   | j ra | j | j  n  | S(   Ni    (   t   openElementsR   R3   R#   t   extendt   listR4   (   R   t   fragmentR   (    (    s   /builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree_lxml.pyt   getFragment,  s    		c         C` s   | d } | d } | d } | s@ t  j d t  d  |  _ nO |  j j |  } | | k rq t  j d t  n  |  j | | |  } | |  _ d  S(   Nu   nameu   publicIdu   systemIdu#   lxml cannot represent empty doctypeu%   lxml cannot represent non-xml doctype(   t   warningst   warnR   R   RQ   RJ   Rf   t   doctypeClass(   R   t   tokenR   R   R   t   coercedNameRQ   (    (    s   /builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree_lxml.pyt   insertDoctype6  s    


c         C` sM   | d  k s! | |  j k s! t  |  j j d  k s9 t  |  j j |  d  S(   N(   R   R   R0   R   R   R#   (   R   Rs   t   parent(    (    s   /builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree_lxml.pyR   F  s    !c         C` s^   | |  j  k rA |  j  j j   d j t k rA t j d t  n  t t	 |   j
 | |  d  S(   Niu@   lxml cannot represent adjacent comments beyond the root elements(   R   R   R   R1   R2   R   R   R   t   superRT   R   (   R   Rs   R   (    (    s   /builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree_lxml.pyt   insertCommentMainK  s    c         C` sl  d } |  j  r`|  j  j s! t  | d |  j  j 7} |  j  j d  k	 sY |  j  j d  k	 r*| d |  j j |  j  j pw d  7} |  j  j r|  j  j } | j d  d k r | j d  d k r t	 j
 d t  | j d d  } n  | j d  d k r| d	 | 7} q'| d
 | 7} q*| d 7} n  | d 7} |  j  j | d k r`t	 j
 d t  q`n  | d 7} t j |  } x4 |  j D]) } |  j | d  } | j | j  qW|  j   |  _ | j   |  j _ | d } | j d |  j  } | d  k r| }	 n d | | f }	 |	 | _ |  j | |  }
 | |
 _ |  j j j |
  |  j j |
  |  j |  _ d  S(   Nu    u   <!DOCTYPE %su    PUBLIC "%s" u   'i    u   "u6   DOCTYPE system cannot contain single and double quotesu   U00027u   "%s"u   '%s'u   ''u   >u   nameuG   lxml cannot represent doctype with a different name to the root elementu$   <THIS_SHOULD_NEVER_APPEAR_PUBLICLY/>u   datau	   namespaceu   {%s}%s(    RQ   R   R0   R   R   R   RJ   t   coercePubidt   findR   R   R   t   replaceR   t
   fromstringR   R~   t   addpreviousR   t   documentClassR   t   getroottreeR   t   gett   defaultNamespaceR1   R}   R   R#   R   R   R   (   R   R   t   docStrt   sysidt   roott   comment_tokent   commentR   Re   t	   etree_tagt   root_element(    (    s   /builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree_lxml.pyt
   insertRootQ  sL    	 *


			N(   R   R   R   R   R   R   R   R}   R~   t   fragmentClassR   t   implementationt   FalseR   R   RP   R   R   R   R   R   R   (    (    (    s   /builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree_lxml.pyRT      s   \				
	($   t   __doc__t
   __future__R    R   R   R   t   reR.   t   collections.abcR   t   ImportErrort   collectionst    R   R   R   R   R6   R   t
   lxml.etreet   pip._vendor.sixR	   R
   RN   RU   t   compileR7   Rw   R1   R2   t   objectR   R   RP   RS   RT   (    (    (    s   /builddir/build/BUILDROOT/alt-python27-pip-20.2.4-5.el8.x86_64/opt/alt/python27/lib/python2.7/site-packages/pip/_vendor/html5lib/treebuilders/etree_lxml.pyt   <module>
   s.   	O	)