???<!-- GIF89;a -->
123123123123
.....................................................................................................................................???<!-- GIF89;a -->
123123123123
.....................................................................................................................................σ
abc           @` 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 r<e e!  d k se r[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 s―e  j$   rΏe  e e! <qΏqqWd   Z% e d e%  d d 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(    (    sC   /usr/lib/python2.7/site-packages/pip/_vendor/html5lib/serializer.pyt   htmlentityreplace_errors*   s0    ),	u   htmlentityreplaceu   etreec         K` s1   t  j |  } t |   } | j | |   |  S(   N(   R   t   getTreeWalkert   HTMLSerializert   render(   t   inputt   treet   encodingt   serializer_optst   walkert   s(    (    sC   /usr/lib/python2.7/site-packages/pip/_vendor/html5lib/serializer.pyt	   serializeJ   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(   u6	  Initialize HTMLSerializer.

        Keyword options (default given first unless specified) include:

        inject_meta_charset=True|False
          Whether it insert a meta element to define the character set of the
          document.
        quote_attr_values="legacy"|"spec"|"always"
          Whether to quote attribute values that don't require quoting
          per legacy browser behaviour, when required by the standard, or always.
        quote_char=u'"'|u"'"
          Use given quote character for attribute quoting. Default is to
          use double quote unless attribute value contains a double quote,
          in which case single quotes are used instead.
        escape_lt_in_attrs=False|True
          Whether to escape < in attribute values.
        escape_rcdata=False|True
          Whether to escape characters that need to be escaped within normal
          elements within rcdata elements such as style.
        resolve_entities=True|False
          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.
        strip_whitespace=False|True
          Whether to remove semantically meaningless whitespace. (This
          compresses all whitespace to a single space except within pre.)
        minimize_boolean_attributes=True|False
          Shortens boolean attributes to give just the attribute value,
          for example <input disabled="disabled"> becomes <input disabled>.
        use_trailing_solidus=False|True
          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/>.
        space_before_trailing_solidus=True|False
          Places a space immediately before the closing slash in a tag
          using a trailing solidus. E.g. <hr />. Requires use_trailing_solidus.
        sanitize=False|True
          Strip all unsafe or unknown constructs from output.
          See `html5lib user documentation`_
        omit_optional_tags=True|False
          Omit start/end tags that are optional.
        alphabetical_attributes=False|True
          Reorder attributes to be in alphabetical order.

        .. _html5lib user documentation: http://code.google.com/p/html5lib/wiki/UserDocumentation
        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(    (    sC   /usr/lib/python2.7/site-packages/pip/_vendor/html5lib/serializer.pyt   __init__p   s    .)	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(    (    sC   /usr/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   (    (    sC   /usr/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   'uA   System identifer 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(    (    sC   /usr/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(   Nt    u    (   R!   t   listR6   (   RB   Rh   R2   (    (    sC   /usr/lib/python2.7/site-packages/pip/_vendor/html5lib/serializer.pyR/   ?  s    u   XXX ERROR MESSAGE NEEDEDc         C` s&   |  j  j |  |  j r" t  n  d  S(   N(   R@   R   RA   t   SerializeError(   RB   Rt   (    (    sC   /usr/lib/python2.7/site-packages/pip/_vendor/html5lib/serializer.pyRW   E  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   (    (    (    sC   /usr/lib/python2.7/site-packages/pip/_vendor/html5lib/serializer.pyR.   Q   s4        	8		Rx   c           B` s   e  Z d  Z RS(   u   Error in serialized tree(   Ry   Rz   t   __doc__(    (    (    sC   /usr/lib/python2.7/site-packages/pip/_vendor/html5lib/serializer.pyRx   L  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   (    (    (    sC   /usr/lib/python2.7/site-packages/pip/_vendor/html5lib/serializer.pyt   <module>   s8   
		ϋ