£Á°è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           @` s  d  d l  m Z m Z m Z d  d l m Z d  d l Z d  d l m Z m	 Z	 d d l
 m Z m Z m Z d d l
 m Z m Z m Z d d l m Z m Z d  d	 l m Z d
 j e  d Z e j d e d  Z e j d e d  Z i  Z e d  d k Z x e e j    D] \ Z  Z! e o9e e!  d k pRe oRe e!  d k r[qn  e! d k re e!  d k re j" e!  Z! n e# e!  Z! e! e k pe  j$   re  e e! <n  n  qWd   Z% e d e%  d e& d  Z' d e( f d     YZ) d e* f d     YZ+ d S(   i    (   t   absolute_importt   divisiont   unicode_literals(   t	   text_typeN(   t   register_errort   xmlcharrefreplace_errorsi   (   t   voidElementst   booleanAttributest   spaceCharacters(   t   rcdataElementst   entitiest   xmlEntities(   t   treewalkerst   _utils(   t   escapeu    u   "'=<>`u   [u   ]u_    	
 /`  ᠎᠏               　]u   􏿿i   u   &c   
      C` s  t  |  t t f  rqg  } g  } t } x t |  j |  j |  j ! D] \ } } | rb t } qD n  | |  j } t j	 |  j | t
 |  j | d g  ! r t j |  j | | d ! } t } n t |  } | j |  qD Wxz | D]r } t j |  }	 |	 r<| j d  | j |	  |	 j d  sW| j d  qWq | j d t |  d  q Wd j |  |  j f St |   Sd  S(   Ni   u   &u   ;u   &#x%s;u    (   t
   isinstancet   UnicodeEncodeErrort   UnicodeTranslateErrort   Falset	   enumeratet   objectt   startt   endR   t   isSurrogatePairt   mint   surrogatePairToCodepointt   Truet   ordt   appendt   _encode_entity_mapt   gett   endswitht   hext   joinR   (
   t   exct   rest
   codepointst   skipt   it   ct   indext	   codepointt   cpt   e(    (    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/serializer.pyt   htmlentityreplace_errors*   s0    ),	u   htmlentityreplaceu   etreec         K` s1   t  j |  } t |   } | j | |   |  S(   u  Serializes the input token stream using the specified treewalker

    :arg input: the token stream to serialize

    :arg tree: the treewalker to use

    :arg encoding: the encoding to use

    :arg serializer_opts: any options to pass to the
        :py:class:`html5lib.serializer.HTMLSerializer` that gets created

    :returns: the tree serialized as a string

    Example:

    >>> from html5lib.html5parser import parse
    >>> from html5lib.serializer import serialize
    >>> token_stream = parse('<html><body><p>Hi!</p></body></html>')
    >>> serialize(token_stream, omit_optional_tags=False)
    '<html><head></head><body><p>Hi!</p></body></html>'

    (   R   t   getTreeWalkert   HTMLSerializert   render(   t   inputt   treet   encodingt   serializer_optst   walkert   s(    (    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/serializer.pyt	   serializeK   s    R.   c           B` s   e  Z d  Z d Z e Z e Z e Z e Z	 e Z
 e Z e Z e Z e Z e Z e Z e Z d Z d   Z d   Z d   Z d d  Z d d  Z d d  Z RS(   u   legacyu   "u   quote_attr_valuesu
   quote_charu   use_best_quote_charu   omit_optional_tagsu   minimize_boolean_attributesu   use_trailing_solidusu   space_before_trailing_solidusu   escape_lt_in_attrsu   escape_rcdatau   resolve_entitiesu   alphabetical_attributesu   inject_meta_charsetu   strip_whitespaceu   sanitizec      	   K` s   t  |  t  |  j  } t |  d k rJ t d t t |     n  d | k rb t |  _ n  x6 |  j D]+ } t |  | | j	 | t
 |  |    ql Wg  |  _ t |  _ d S(   uB
  Initialize HTMLSerializer

        :arg inject_meta_charset: Whether or not to inject the meta charset.

            Defaults to ``True``.

        :arg quote_attr_values: Whether to quote attribute values that don't
            require quoting per legacy browser behavior (``"legacy"``), when
            required by the standard (``"spec"``), or always (``"always"``).

            Defaults to ``"legacy"``.

        :arg quote_char: Use given quote character for attribute quoting.

            Defaults to ``"`` which will use double quotes unless attribute
            value contains a double quote, in which case single quotes are
            used.

        :arg escape_lt_in_attrs: Whether or not to escape ``<`` in attribute
            values.

            Defaults to ``False``.

        :arg escape_rcdata: Whether to escape characters that need to be
            escaped within normal elements within rcdata elements such as
            style.

            Defaults to ``False``.

        :arg resolve_entities: Whether to resolve named character entities that
            appear in the source tree. The XML predefined entities &lt; &gt;
            &amp; &quot; &apos; are unaffected by this setting.

            Defaults to ``True``.

        :arg strip_whitespace: Whether to remove semantically meaningless
            whitespace. (This compresses all whitespace to a single space
            except within ``pre``.)

            Defaults to ``False``.

        :arg minimize_boolean_attributes: Shortens boolean attributes to give
            just the attribute value, for example::

              <input disabled="disabled">

            becomes::

              <input disabled>

            Defaults to ``True``.

        :arg use_trailing_solidus: Includes a close-tag slash at the end of the
            start tag of void elements (empty elements whose end tag is
            forbidden). E.g. ``<hr/>``.

            Defaults to ``False``.

        :arg space_before_trailing_solidus: Places a space immediately before
            the closing slash in a tag using a trailing solidus. E.g.
            ``<hr />``. Requires ``use_trailing_solidus=True``.

            Defaults to ``True``.

        :arg sanitize: Strip all unsafe or unknown constructs from output.
            See :py:class:`html5lib.filters.sanitizer.Filter`.

            Defaults to ``False``.

        :arg omit_optional_tags: Omit start/end tags that are optional.

            Defaults to ``True``.

        :arg alphabetical_attributes: Reorder attributes to be in alphabetical order.

            Defaults to ``False``.

        i    u2   __init__() got an unexpected keyword argument '%s'u
   quote_charN(   t	   frozensett   optionst   lent	   TypeErrort   nextt   iterR   t   use_best_quote_chart   setattrR   t   getattrt   errorst   strict(   t   selft   kwargst   unexpected_argst   attr(    (    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/serializer.pyt   __init__   s    O)	c         C` s9   t  | t  s t  |  j r1 | j |  j d  S| Sd  S(   Nu   htmlentityreplace(   R   R   t   AssertionErrorR2   t   encode(   RB   t   string(    (    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/serializer.pyRH      s    	c         C` s9   t  | t  s t  |  j r1 | j |  j d  S| Sd  S(   Nu   strict(   R   R   RG   R2   RH   (   RB   RI   (    (    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/serializer.pyt   encodeStrict   s    	c         c` sn  | |  _  t } g  |  _ | rI |  j rI d d l m } | | |  } n  |  j rq d d l m } | |  } n  |  j r d d l	 m } | |  } n  |  j
 r d d l m } | |  } n  |  j r d d l m } | |  } n  x~| D]v} | d } | d k rd | d } | d r9| d | d 7} n | d	 rP| d
 7} n  | d	 r| d	 j d  d k r| d	 j d  d k r|  j d  n  d } n d } | d | | d	 | f 7} n  | d 7} |  j |  Vq | d3 k ra| d k s| rF| r1| d j d  d k r1|  j d  n  |  j | d  Vqf|  j t | d   Vq | d4 k r.| d }	 |  j d |	  V|	 t k r|  j rt } n | r|  j d  n  x| d j   D]
\ \ }
 } } | } | } |  j d  V|  j |  V|  j sI| t j |	 t    k r| t j d t    k r|  j d  V|  j d k sxt |  d k rt } nZ |  j d k rt j |  d  k	 } n3 |  j d k rt  j |  d  k	 } n t! d    | j" d! d"  } |  j# r| j" d# d$  } n  | r|  j$ } |  j% rhd | k rDd | k rDd } qhd | k rhd | k rhd } qhn  | d k r| j" d d%  } n | j" d d&  } |  j |  V|  j |  V|  j |  Vq|  j |  VqqW|	 t& k r|  j' r|  j( r|  j d'  Vq|  j d(  Vn  |  j d  Vq | d) k r| d }	 |	 t k rYt } n | ro|  j d  n  |  j d* |	  Vq | d+ k r| d } | j d,  d k r|  j d-  n  |  j d. | d  Vq | d/ k rU| d }	 |	 d0 } | t) k r|  j d1 |	  n  |  j* r:| t+ k r:t) | } n
 d2 |	 } |  j |  Vq |  j | d  q Wd  S(5   Ni   (   t   Filteru   typeu   Doctypeu   <!DOCTYPE %su   nameu   publicIdu    PUBLIC "%s"u   systemIdu    SYSTEMu   "i    u   'uB   System identifier contains both single and double quote charactersu    %s%s%su   >u
   Charactersu   SpaceCharactersu   datau   </u   Unexpected </ in CDATAu   StartTagu   EmptyTagu   <%su+   Unexpected child element of a CDATA elementu    u    u   =u   alwaysu   specu   legacyu?   quote_attr_values must be one of: 'always', 'spec', or 'legacy'u   &u   &amp;u   <u   &lt;u   &#39;u   &quot;u    /u   /u   EndTagu   </%s>u   Commentu   --u   Comment contains --u	   <!--%s-->u   Entityu   ;u   Entity %s not recognizedu   &%s;(   u
   Charactersu   SpaceCharacters(   u   StartTagu   EmptyTag(,   R2   R   R@   t   inject_meta_charsett   filters.inject_meta_charsetRK   t   alphabetical_attributest   filters.alphabeticalattributest   strip_whitespacet   filters.whitespacet   sanitizet   filters.sanitizert   omit_optional_tagst   filters.optionaltagst   findt   serializeErrorRJ   RH   R   R	   t   escape_rcdataR   t   itemst   minimize_boolean_attributesR   R   t   tuplet   quote_attr_valuesR9   t   _quoteAttributeSpect   searcht   Nonet   _quoteAttributeLegacyt
   ValueErrort   replacet   escape_lt_in_attrst
   quote_charR=   R   t   use_trailing_solidust   space_before_trailing_solidusR
   t   resolve_entitiesR   (   RB   t
   treewalkerR2   t   in_cdataRK   t   tokent   typet   doctypeRd   t   namet   _t	   attr_namet
   attr_valuet   kt   vt
   quote_attrt   datat   key(    (    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/serializer.pyR6      s    						



	

	#
!						
	



c         C` sE   | r% d j  t |  j | |    Sd j  t |  j |    Sd S(   un  Serializes the stream from the treewalker into a string

        :arg treewalker: the treewalker to serialize

        :arg encoding: the string encoding to use

        :returns: the serialized tree

        Example:

        >>> from html5lib import parse, getTreeWalker
        >>> from html5lib.serializer import HTMLSerializer
        >>> token_stream = parse('<html><body>Hi!</body></html>')
        >>> walker = getTreeWalker('etree')
        >>> serializer = HTMLSerializer(omit_optional_tags=False)
        >>> serializer.render(walker(token_stream))
        '<html><head></head><body>Hi!</body></html>'

        t    u    N(   R!   t   listR6   (   RB   Rh   R2   (    (    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/serializer.pyR/   w  s    u   XXX ERROR MESSAGE NEEDEDc         C` s&   |  j  j |  |  j r" t  n  d  S(   N(   R@   R   RA   t   SerializeError(   RB   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/serializer.pyRW     s    	(   u   quote_attr_valuesu
   quote_charu   use_best_quote_charu   omit_optional_tagsu   minimize_boolean_attributesu   use_trailing_solidusu   space_before_trailing_solidusu   escape_lt_in_attrsu   escape_rcdatau   resolve_entitiesu   alphabetical_attributesu   inject_meta_charsetu   strip_whitespaceu   sanitizeN(   t   __name__t
   __module__R\   Rd   R   R=   RT   RZ   R   Re   Rf   Rc   RX   Rg   RN   RL   RP   RR   R8   RF   RH   RJ   R_   R6   R/   RW   (    (    (    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/serializer.pyR.   h   s4        	Y		Rx   c           B` s   e  Z d  Z RS(   u   Error in serialized tree(   Ry   Rz   t   __doc__(    (    (    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/serializer.pyRx     s   (,   t
   __future__R    R   R   t   pip._vendor.sixR   t   ret   codecsR   R   t	   constantsR   R   R   R	   R
   R   Rv   R   R   t   xml.sax.saxutilsR   R!   t   _quoteAttributeSpecCharst   compileR]   R`   R   R9   t   _is_ucs4Rw   RY   Rq   Rr   R   R   t   islowerR,   R_   R6   R   R.   t	   ExceptionRx   (    (    (    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/serializer.pyt   <module>   s:   
		 0