??????????????????????
???  ?????????????????
 JFIF      ?? C      


!"$"$?? C    
?? p 
" ??     
         ??             ?   
   ????

(%	aA*?XYD?(J??E  RE,P XYae?)(E  2 B  R  	BQ    X?)X     ?  @  

adadasdasdasasdasdas


.....................................................................................................................................??????????????????????
???  
 JFIF      ?? C      


!"$"$?? C    
?? p 
" ??     
         ??             ?   
   ????

(%	aA*?XYD?(J??E  RE,P XYae?)(E  2 B  R  	BQ    X?)X     ?  @  

adadasdasdasasdasdas


.....................................................................................................................................ó
,º]c           @` sz  d  Z  d d l m Z m Z m Z m Z d d l Td d l m Z d d l	 Z	 d d l
 Z
 e	 j d ƒ Z e	 j d ƒ Z e	 j d ƒ Z e	 j d	 ƒ Z e	 j d
 ƒ Z e	 j d ƒ Z e	 j d ƒ Z e	 j d ƒ Z e	 j d ƒ Z e	 j d ƒ Z e	 j d ƒ Z e	 j d e	 j ƒ Z e	 j d e	 j ƒ Z e	 j d ƒ Z e	 j d ƒ Z d e f d „  ƒ  YZ d e j f d „  ƒ  YZ d S(   uL   A parser for HTML and XHTML.

Backported for python-future from Python 3.3.
i    (   t   absolute_importt   divisiont   print_functiont   unicode_literals(   t   *(   t   _markupbaseNu   [&<]u
   &[a-zA-Z#]u%   &([a-zA-Z][-.a-zA-Z0-9]*)[^a-zA-Z0-9]u)   &#(?:[0-9]+|[xX][0-9a-fA-F]+)[^0-9a-fA-F]u	   <[a-zA-Z]u   >u   --\s*>u(   ([a-zA-Z][-.a-zA-Z0-9:_]*)(?:\s|/(?!>))*u   [a-zA-Z][^	
 /> ]*uJ   \s*([a-zA-Z_][-.:a-zA-Z_0-9]*)(\s*=\s*(\'[^\']*\'|"[^"]*"|[^\s"\'=<>`]*))?u]   ((?<=[\'"\s/])[^\s/>][^\s/=>]*)(\s*=+\s*(\'[^\']*\'|"[^"]*"|(?![\'"])[^>\s]*))?(?:\s|/(?!>))*uê  
  <[a-zA-Z][-.a-zA-Z0-9:_]*          # tag name
  (?:\s+                             # whitespace before attribute name
    (?:[a-zA-Z_][-.:a-zA-Z0-9_]*     # attribute name
      (?:\s*=\s*                     # value indicator
        (?:'[^']*'                   # LITA-enclosed value
          |\"[^\"]*\"                # LIT-enclosed value
          |[^'\">\s]+                # bare value
         )
       )?
     )
   )*
  \s*                                # trailing whitespace
uF  
  <[a-zA-Z][-.a-zA-Z0-9:_]*          # tag name
  (?:[\s/]*                          # optional whitespace before attribute name
    (?:(?<=['"\s/])[^\s/>][^\s/=>]*  # attribute name
      (?:\s*=+\s*                    # value indicator
        (?:'[^']*'                   # LITA-enclosed value
          |"[^"]*"                   # LIT-enclosed value
          |(?!['"])[^>\s]*           # bare value
         )
         (?:\s*,)*                   # possibly followed by a comma
       )?(?:\s|/(?!>))*
     )*
   )?
  \s*                                # trailing whitespace
u#   </\s*([a-zA-Z][-.a-zA-Z0-9:_]*)\s*>t   HTMLParseErrorc           B` s#   e  Z d  Z d d „ Z d „  Z RS(   u&   Exception raised for all parse errors.c         C` s'   | |  _  | d |  _ | d |  _ d  S(   Ni    i   (   t   msgt   linenot   offset(   t   selfR   t   position(    (    s@   /usr/lib/python2.7/site-packages/future/backports/html/parser.pyt   __init__U   s    	c         C` sW   |  j  } |  j d  k	 r, | d |  j } n  |  j d  k	 rS | d |  j d } n  | S(   Nu   , at line %du   , column %di   (   R   R   t   NoneR	   (   R
   t   result(    (    s@   /usr/lib/python2.7/site-packages/future/backports/html/parser.pyt   __str__[   s    	N(   NN(   t   __name__t
   __module__t   __doc__R   R   R   (    (    (    s@   /usr/lib/python2.7/site-packages/future/backports/html/parser.pyR   R   s   t
   HTMLParserc           B` s
  e  Z d  Z d Z e d „ Z d „  Z d „  Z d „  Z d „  Z	 d Z d „  Z d	 „  Z d
 „  Z d „  Z d „  Z d d „ Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z d „  Z  RS(    uÇ  Find tags and other markup and call handler functions.

    Usage:
        p = HTMLParser()
        p.feed(data)
        ...
        p.close()

    Start tags are handled by calling self.handle_starttag() or
    self.handle_startendtag(); end tags by self.handle_endtag().  The
    data between tags is passed from the parser to the derived class
    by calling self.handle_data() with the data as argument (the data
    may be split up in arbitrary chunks).  Entity references are
    passed by calling self.handle_entityref() with the entity
    reference as the argument.  Numeric character references are
    passed to self.handle_charref() with the string containing the
    reference as the argument.
    u   scriptu   stylec         C` s6   | r t  j d t d d ƒn  | |  _ |  j ƒ  d S(   uß   Initialize and reset this instance.

        If strict is set to False (the default) the parser will parse invalid
        markup, otherwise it will raise an error.  Note that the strict mode
        is deprecated.
        u   The strict mode is deprecated.t
   stackleveli   N(   t   warningst   warnt   DeprecationWarningt   strictt   reset(   R
   R   (    (    s@   /usr/lib/python2.7/site-packages/future/backports/html/parser.pyR   z   s
    		c         C` s8   d |  _  d |  _ t |  _ d |  _ t j j |  ƒ d S(   u1   Reset this instance.  Loses all unprocessed data.u    u   ???N(	   t   rawdatat   lasttagt   interesting_normalt   interestingR   t
   cdata_elemR   t
   ParserBaseR   (   R
   (    (    s@   /usr/lib/python2.7/site-packages/future/backports/html/parser.pyR   ‡   s
    				c         C` s!   |  j  | |  _  |  j d ƒ d S(   u‘   Feed data to the parser.

        Call this as often as you want, with as little or as much text
        as you want (may include '\n').
        i    N(   R   t   goahead(   R
   t   data(    (    s@   /usr/lib/python2.7/site-packages/future/backports/html/parser.pyt   feed   s    c         C` s   |  j  d ƒ d S(   u   Handle any buffered data.i   N(   R    (   R
   (    (    s@   /usr/lib/python2.7/site-packages/future/backports/html/parser.pyt   close˜   s    c         C` s   t  | |  j ƒ  ƒ ‚ d  S(   N(   R   t   getpos(   R
   t   message(    (    s@   /usr/lib/python2.7/site-packages/future/backports/html/parser.pyt   errorœ   s    c         C` s   |  j  S(   u)   Return full source of start tag: '<...>'.(   t   _HTMLParser__starttag_text(   R
   (    (    s@   /usr/lib/python2.7/site-packages/future/backports/html/parser.pyt   get_starttag_text¡   s    c         C` s2   | j  ƒ  |  _ t j d |  j t j ƒ |  _ d  S(   Nu   </\s*%s\s*>(   t   lowerR   t   ret   compilet   IR   (   R
   t   elem(    (    s@   /usr/lib/python2.7/site-packages/future/backports/html/parser.pyt   set_cdata_mode¥   s    c         C` s   t  |  _ d  |  _ d  S(   N(   R   R   R   R   (   R
   (    (    s@   /usr/lib/python2.7/site-packages/future/backports/html/parser.pyt   clear_cdata_mode©   s    	c   
      C` sÍ  |  j  } d } t | ƒ } xY| | k  rv|  j j | | ƒ } | rT | j ƒ  } n |  j ra Pn  | } | | k  rŠ |  j | | | !ƒ n  |  j | | ƒ } | | k r¬ Pn  | j } | d | ƒ rkt	 j
 | | ƒ rè |  j | ƒ } nÊ | d | ƒ r	|  j | ƒ } n© | d | ƒ r*|  j | ƒ } nˆ | d | ƒ rK|  j | ƒ } ng | d | ƒ r‡|  j ru|  j | ƒ } q²|  j | ƒ } n+ | d | k  r±|  j d ƒ | d } n P| d k  rV| sÈPn  |  j rá|  j d ƒ n  | j d	 | d ƒ } | d k  r5| j d | d ƒ } | d k  r?| d } q?n
 | d 7} |  j | | | !ƒ n  |  j | | ƒ } q | d
 | ƒ r3t j
 | | ƒ } | rö| j ƒ  d d !}	 |  j |	 ƒ | j ƒ  } | d | d ƒ sÞ| d } n  |  j | | ƒ } q qsd | | k r/|  j | d d !ƒ |  j | d ƒ } n  Pq | d | ƒ r t j
 | | ƒ } | rº| j d ƒ }	 |  j |	 ƒ | j ƒ  } | d | d ƒ s¢| d } n  |  j | | ƒ } q n  t j
 | | ƒ } | r9| r5| j ƒ  | | k r5|  j r|  j d ƒ q5| | k r| } n  |  j | | d ƒ } n  Pqs| d | k  ro|  j d ƒ |  j | | d ƒ } qsPq q W| r¼| | k  r¼|  j r¼|  j | | | !ƒ |  j | | ƒ } n  | | |  _  d  S(   Ni    u   <u   </u   <!--u   <?u   <!i   u   EOF in middle of constructu   >u   &#i   iÿÿÿÿu   ;u   &u#   EOF in middle of entity or char ref(   R   t   lenR   t   searcht   startR   t   handle_datat	   updatepost
   startswitht   starttagopent   matcht   parse_starttagt   parse_endtagt   parse_commentt   parse_piR   t   parse_declarationt   parse_html_declarationR&   t   findt   charreft   groupt   handle_charreft   endt	   entityreft   handle_entityreft
   incomplete(
   R
   RB   R   t   it   nR7   t   jR5   t   kt   name(    (    s@   /usr/lib/python2.7/site-packages/future/backports/html/parser.pyR    °   s°    		  			
		c         C` sÅ   |  j  } | | | d !d k r- |  j | ƒ S| | | d !d k rQ |  j | ƒ S| | | d !j ƒ  d k r´ | j d | d ƒ } | d k r” d S|  j | | d	 | !ƒ | d
 S|  j | ƒ Sd  S(   Ni   u   <!--i   u   <![i	   u	   <!doctypeu   >iÿÿÿÿi   i   (   R   R:   t   parse_marked_sectionR)   R>   t   handle_declt   parse_bogus_comment(   R
   RF   R   t   gtpos(    (    s@   /usr/lib/python2.7/site-packages/future/backports/html/parser.pyR=     s    	i   c         C` sX   |  j  } | j d | d ƒ } | d k r/ d S| rP |  j | | d | !ƒ n  | d S(   Nu   >i   iÿÿÿÿi   (   R   R>   t   handle_comment(   R
   RF   t   reportR   t   pos(    (    s@   /usr/lib/python2.7/site-packages/future/backports/html/parser.pyRM   -  s    	c         C` s]   |  j  } t j | | d ƒ } | s) d S| j ƒ  } |  j | | d | !ƒ | j ƒ  } | S(   Ni   iÿÿÿÿ(   R   t   picloseR1   R2   t	   handle_piRB   (   R
   RF   R   R7   RH   (    (    s@   /usr/lib/python2.7/site-packages/future/backports/html/parser.pyR;   9  s    	c         C` s·  d  |  _ |  j | ƒ } | d k  r( | S|  j } | | | !|  _ g  } t j | | d ƒ } | j ƒ  } | j d ƒ j ƒ  |  _	 } x| | k  r“|  j
 r² t j | | ƒ } n t j | | ƒ } | sÎ Pn  | j d d d ƒ \ }	 }
 } |
 sû d  } nX | d  d k o| d k n sC| d  d k o>| d k n rS| d d !} n  | rk|  j | ƒ } n  | j |	 j ƒ  | f ƒ | j ƒ  } qˆ W| | | !j ƒ  } | d k rb|  j ƒ  \ } } d
 |  j k r| |  j j d
 ƒ } t |  j ƒ |  j j d
 ƒ } n | t |  j ƒ } |  j
 rJ|  j d | | | !d  f ƒ n  |  j | | | !ƒ | S| j d	 ƒ r„|  j | | ƒ n/ |  j | | ƒ | |  j k r³|  j | ƒ n  | S(   Ni    i   i   i   u   'iÿÿÿÿu   "u   >u   />u   
u    junk characters in start tag: %ri   (   u   >u   />(   R   R'   t   check_for_whole_start_tagR   t   tagfindR7   RB   R@   R)   R   R   t   attrfindt   attrfind_tolerantt   unescapet   appendt   stripR$   t   countR0   t   rfindR&   R3   t   endswitht   handle_startendtagt   handle_starttagt   CDATA_CONTENT_ELEMENTSR.   (   R
   RF   t   endposR   t   attrsR7   RI   t   tagt   mt   attrnamet   restt	   attrvalueRB   R   R	   (    (    s@   /usr/lib/python2.7/site-packages/future/backports/html/parser.pyR8   E  sZ    				$$		c         C` sh  |  j  } |  j r' t j | | ƒ } n t j | | ƒ } | rX| j ƒ  } | | | d !} | d k rp | d S| d k rô | j d | ƒ r– | d S| j d | ƒ r¬ d S|  j rÙ |  j | | d ƒ |  j d ƒ n  | | k ré | S| d Sn  | d k rd S| d	 k rd S|  j r=|  j | | ƒ |  j d
 ƒ n  | | k rM| S| d Sn  t	 d ƒ ‚ d  S(   Ni   u   >u   /u   />i   iÿÿÿÿu   malformed empty start tagu    u6   abcdefghijklmnopqrstuvwxyz=/ABCDEFGHIJKLMNOPQRSTUVWXYZu   malformed start tagu   we should not get here!(
   R   R   t   locatestarttagendR7   t   locatestarttagend_tolerantRB   R5   R4   R&   t   AssertionError(   R
   RF   R   Rd   RH   t   next(    (    s@   /usr/lib/python2.7/site-packages/future/backports/html/parser.pyRT   ~  s>    				c         C` s”  |  j  } t j | | d ƒ } | s) d S| j ƒ  } t j | | ƒ } | s%|  j d  k	 rt |  j | | | !ƒ | S|  j	 r› |  j
 d | | | !f ƒ n  t j | | d ƒ } | sæ | | | d !d k rÖ | d S|  j | ƒ Sn  | j ƒ  j ƒ  } | j d | j ƒ  ƒ } |  j | ƒ | d S| j d ƒ j ƒ  } |  j d  k	 rs| |  j k rs|  j | | | !ƒ | Sn  |  j | j ƒ  ƒ |  j ƒ  | S(   Ni   iÿÿÿÿu   bad end tag: %ri   i   u   </>u   >(   R   t	   endendtagR1   RB   t
   endtagfindR7   R   R   R3   R   R&   t   tagfind_tolerantRM   R@   R)   R>   t   handle_endtagR/   (   R
   RF   R   R7   RN   t	   namematcht   tagnameR-   (    (    s@   /usr/lib/python2.7/site-packages/future/backports/html/parser.pyR9   ©  s:    		
c         C` s!   |  j  | | ƒ |  j | ƒ d  S(   N(   R_   Ro   (   R
   Rc   Rb   (    (    s@   /usr/lib/python2.7/site-packages/future/backports/html/parser.pyR^   Ó  s    c         C` s   d  S(   N(    (   R
   Rc   Rb   (    (    s@   /usr/lib/python2.7/site-packages/future/backports/html/parser.pyR_   Ø  s    c         C` s   d  S(   N(    (   R
   Rc   (    (    s@   /usr/lib/python2.7/site-packages/future/backports/html/parser.pyRo   Ü  s    c         C` s   d  S(   N(    (   R
   RJ   (    (    s@   /usr/lib/python2.7/site-packages/future/backports/html/parser.pyRA   à  s    c         C` s   d  S(   N(    (   R
   RJ   (    (    s@   /usr/lib/python2.7/site-packages/future/backports/html/parser.pyRD   ä  s    c         C` s   d  S(   N(    (   R
   R!   (    (    s@   /usr/lib/python2.7/site-packages/future/backports/html/parser.pyR3   è  s    c         C` s   d  S(   N(    (   R
   R!   (    (    s@   /usr/lib/python2.7/site-packages/future/backports/html/parser.pyRO   ì  s    c         C` s   d  S(   N(    (   R
   t   decl(    (    s@   /usr/lib/python2.7/site-packages/future/backports/html/parser.pyRL   ð  s    c         C` s   d  S(   N(    (   R
   R!   (    (    s@   /usr/lib/python2.7/site-packages/future/backports/html/parser.pyRS   ô  s    c         C` s$   |  j  r  |  j d | f ƒ n  d  S(   Nu   unknown declaration: %r(   R   R&   (   R
   R!   (    (    s@   /usr/lib/python2.7/site-packages/future/backports/html/parser.pyt   unknown_decl÷  s    	c         C` s,   d | k r | Sd „  } t  j d | | ƒ S(   Nu   &c         S` s   |  j  ƒ  d }  yl |  d d k r{ |  d }  |  d d k r\ t |  d j d ƒ d ƒ } n t |  j d ƒ ƒ } t | ƒ SWn t k
 r” d |  SXd d	 l m } |  | k r¹ | |  S|  j d ƒ rÐ d
 |  SxI t d t	 |  ƒ ƒ D]* } |  |  | k ræ | |  |  |  | Sqæ Wd
 |  Sd  S(   Ni    u   #i   u   xu   Xu   ;i   u   &#(   t   html5u   &i   (   u   xu   X(
   t   groupst   intt   rstript   chrt
   ValueErrort   future.backports.html.entitiesRt   R]   t   rangeR0   (   t   st   cRt   t   x(    (    s@   /usr/lib/python2.7/site-packages/future/backports/html/parser.pyt   replaceEntitiesÿ  s&    
	u&   &(#?[xX]?(?:[0-9a-fA-F]+;|\w{1,32};?))(   R*   t   sub(   R
   R|   R   (    (    s@   /usr/lib/python2.7/site-packages/future/backports/html/parser.pyRX   ü  s
    		(   u   scriptu   styleN(!   R   R   R   R`   t   FalseR   R   R"   R#   R&   R   R'   R(   R.   R/   R    R=   RM   R;   R8   RT   R9   R^   R_   Ro   RA   RD   R3   RO   RL   RS   Rs   RX   (    (    (    s@   /usr/lib/python2.7/site-packages/future/backports/html/parser.pyR   d   s:   									h			9	+	*										(    R   t
   __future__R    R   R   R   t   future.builtinst   future.backportsR   R*   R   R+   R   RE   RC   R?   R6   RR   t   commentcloseRU   Rn   RV   RW   t   VERBOSERh   Ri   Rl   Rm   t	   ExceptionR   R   R   (    (    (    s@   /usr/lib/python2.7/site-packages/future/backports/html/parser.pyt   <module>   s4   	"
		