ÿØÿàJFIFÿþ ÿÛC       ÿÛC ÿÀÿÄÿÄ"#QrÿÄÿÄ&1!A"2qQaáÿÚ ?Øy,æ/3JæÝ¹È߲؋5êXw²±ÉyˆR”¾I0ó2—PI¾IÌÚiMö¯–þrìN&"KgX:Šíµ•nTJnLK„…@!‰-ý ùúmë;ºgµŒ&ó±hw’¯Õ@”Ü— 9ñ-ë.²1<yà‚¹ïQÐU„ہ?.’¦èûbß±©Ö«Âw*VŒ) `$‰bØÔŸ’ëXÖ-ËTÜíGÚ3ð«g Ÿ§¯—Jx„–’U/ÂÅv_s(Hÿ@TñJÑãõçn­‚!ÈgfbÓc­:él[ðQe 9ÀPLbÃãCµm[5¿ç'ªjglå‡Ûí_§Úõl-;"PkÞÞÁQâ¼_Ñ^¢SŸx?"¸¦ùY騐ÒOÈ q’`~~ÚtËU¹CڒêV  I1Áß_ÿÙ A[c@`szdZddlmZmZmZmZddlTddlmZddl Z ddl Z e j dZ e j dZ e j dZe j d Ze j d Ze j d Ze j d Ze j d Ze j dZe j dZe j dZe j de jZe j de jZe j d Ze j dZdefdYZdejfdYZdS(uLA parser for HTML and XHTML. Backported for python-future from Python 3.3. i(tabsolute_importtdivisiontprint_functiontunicode_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#tHTMLParseErrorcB`s#eZdZddZdZRS(u&Exception raised for all parse errors.cC`s3|s t||_|d|_|d|_dS(Nii(tAssertionErrortmsgtlinenotoffset(tselfRtposition((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/html/parser.pyt__init__Us   cC`sW|j}|jdk r,|d|j}n|jdk rS|d|jd}n|S(Nu , at line %du , column %di(RR tNoneR (R tresult((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/html/parser.pyt__str__[s  N(NN(t__name__t __module__t__doc__RR R(((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/html/parser.pyRRs t HTMLParsercB`s eZdZdZedZdZdZdZdZ dZ dZ d Z d Zd Zd Zd dZdZdZdZdZdZdZdZdZdZdZdZdZdZdZdZ RS( uFind 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. uscriptustylecC`s6|rtjdtddn||_|jdS(uInitialize 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. uThe strict mode is deprecated.t stackleveliN(twarningstwarntDeprecationWarningtstricttreset(R R((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/html/parser.pyR zs   cC`s8d|_d|_t|_d|_tjj|dS(u1Reset this instance. Loses all unprocessed data.uu???N( trawdatatlasttagtinteresting_normalt interestingRt cdata_elemRt ParserBaseR(R ((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/html/parser.pyRs     cC`s!|j||_|jddS(uFeed data to the parser. Call this as often as you want, with as little or as much text as you want (may include '\n'). iN(Rtgoahead(R tdata((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/html/parser.pytfeedscC`s|jddS(uHandle any buffered data.iN(R!(R ((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/html/parser.pytclosescC`st||jdS(N(Rtgetpos(R tmessage((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/html/parser.pyterrorscC`s|jS(u)Return full source of start tag: '<...>'.(t_HTMLParser__starttag_text(R ((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/html/parser.pytget_starttag_textscC`s2|j|_tjd|jtj|_dS(Nu (tlowerRtretcompiletIR(R telem((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/html/parser.pytset_cdata_modescC`st|_d|_dS(N(RRRR(R ((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/html/parser.pytclear_cdata_modes c C`s|j}d}t|}xk||kr|jj||}|rT|j}n|jraPn|}||kr|j|||!n|j||}||krPn|j}|d|rkt j ||r|j |}n|d|r |j |}n|d|r*|j |}n|d|rK|j|}ng|d|r|jru|j|}q|j|}n+|d|kr|jd|d}nP|dkrV|sPn|jr|jdn|jd |d}|dkr5|jd|d}|dkr?|d}q?n |d7}|j|||!n|j||}q|d |r3tj ||}|r|jd d !} |j| |j}|d |ds|d}n|j||}qqd ||kr/|j|dd !|j|d }nPq|d|rstj ||}|r|jd} |j| |j}|d |ds|d}n|j||}qntj ||}|r9|r5|j||kr5|jr|jdq5||kr|}n|j||d}nPq|d|kro|jd|j||d}qPqdstdqW|r||kr|j r|j|||!|j||}n|||_dS(Niuu&#iiu;u&u#EOF in middle of entity or char refuinteresting.search() lied(RtlenRtsearchtstartRt handle_datat updatepost startswitht starttagopentmatchtparse_starttagt parse_endtagt parse_commenttparse_piRtparse_declarationtparse_html_declarationR'tfindtcharreftgroupthandle_charreftendt entityrefthandle_entityreft incompleteR( R RCRtitnR8tjR6tktname((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/html/parser.pyR!s                        cC`s|j}|||d!dks,td|||d!dkrP|j|S|||d!dkrt|j|S|||d!jd kr|jd |d}|d krd S|j||d|!|d S|j|SdS( Niuii(RRR;tparse_marked_sectionR*R?t handle_decltparse_bogus_comment(R RGRtgtpos((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/html/parser.pyR>s #   icC`s{|j}|||d!dks,td|jd|d}|dkrRdS|rs|j||d|!n|dS( Niuii(uu/>u u junk characters in start tag: %ri(u>u/>(RR(tcheck_for_whole_start_tagRttagfindR8RRCRAR*RRtattrfindtattrfind_toleranttunescapetappendtstripR%tcountR1trfindR'R4tendswiththandle_startendtagthandle_starttagtCDATA_CONTENT_ELEMENTSR/(R RGtendposRtattrsR8RJttagtmtattrnametrestt attrvalueRCR R ((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/html/parser.pyR9Es\      $$    cC`sh|j}|jr'tj||}ntj||}|rX|j}|||d!}|dkrp|dS|dkr|jd|r|dS|jd|rdS|jr|j||d|jdn||kr|S|dSn|dkrdS|d krdS|jr=|j|||jd n||krM|S|dSnt d dS( Niu>u/u/>iiumalformed empty start taguu6abcdefghijklmnopqrstuvwxyz=/ABCDEFGHIJKLMNOPQRSTUVWXYZumalformed start taguwe should not get here!( RRtlocatestarttagendR8tlocatestarttagend_tolerantRCR6R5R'R(R RGRReRItnext((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/html/parser.pyRU~s>             cC`s|j}|||d!dks,tdtj||d}|sLdS|j}tj||}|sH|jdk r|j |||!|S|j r|j d|||!fnt j||d}|s |||d!dkr|dS|j |Sn|jj}|jd |j}|j||dS|jdj}|jdk r||jkr|j |||!|Sn|j|j|j|S( Niuu>(RRt endendtagR2RCt endtagfindR8RRR4RR'ttagfind_tolerantRNRAR*R?t handle_endtagR0(R RGRR8ROt namematchttagnameR.((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/html/parser.pyR:s< #    cC`s!|j|||j|dS(N(R`Ro(R RdRc((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/html/parser.pyR_scC`sdS(N((R RdRc((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/html/parser.pyR`scC`sdS(N((R Rd((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/html/parser.pyRoscC`sdS(N((R RK((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/html/parser.pyRBscC`sdS(N((R RK((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/html/parser.pyREscC`sdS(N((R R"((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/html/parser.pyR4scC`sdS(N((R R"((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/html/parser.pyRPscC`sdS(N((R tdecl((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/html/parser.pyRMscC`sdS(N((R R"((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/html/parser.pyRTscC`s$|jr |jd|fndS(Nuunknown declaration: %r(RR'(R R"((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/html/parser.pyt unknown_decls cC`s,d|kr|Sd}tjd||S(Nu&cS`s |jd}yl|ddkr{|d}|dd kr\t|djdd}nt|jd}t|SWntk rd|SXdd lm}||kr||S|jdrd |SxItd t |D]*}|| |kr||| ||SqWd |SdS( Niu#iuxuXu;iu&#(thtml5u&i(uxuX( tgroupstinttrstriptchrt ValueErrortfuture.backports.html.entitiesRtR^trangeR1(tstcRttx((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/html/parser.pytreplaceEntitiess&    u&&(#?[xX]?(?:[0-9a-fA-F]+;|\w{1,32};?))(R+tsub(R R|R((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/html/parser.pyRYs    (uscriptustyleN(!RRRRatFalseR RR#R$R'RR(R)R/R0R!R>RNR<R9RUR:R_R`RoRBRER4RPRMRTRsRY(((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/html/parser.pyRds:       h  9 + *          ( Rt __future__RRRRtfuture.builtinstfuture.backportsRR+RR,RRFRDR@R7RSt commentcloseRVRnRWRXtVERBOSERiRjRlRmt ExceptionRR R(((sM/opt/alt/python27/lib/python2.7/site-packages/future/backports/html/parser.pyts4 "