ÿØÿà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Áß_ÿÙ ]c@sydZddlmZddlZddlmZddlZddlZdgZde fdYZ ddZ dS( s Middleware that tests the validity of all generated HTML using the `WDG HTML Validator `_ i(tStringION(t header_valuetWDGValidateMiddlewarecBsMeZdZejdejZdddZdZ dZ dZ RS(sb Middleware that checks HTML and appends messages about the validity of the HTML. Uses: http://www.htmlhelp.com/tools/validator/ -- interacts with the command line client. Use the configuration ``wdg_path`` to override the path (default: looks for ``validate`` in $PATH). To install, in your web context's __init__.py:: def urlparser_wrap(environ, start_response, app): return wdg_validate.WDGValidateMiddleware(app)( environ, start_response) Or in your configuration:: middleware.append('paste.wdg_validate.WDGValidateMiddleware') stvalidatecCs||_||_dS(N(tapptwdg_path(tselfRt global_confR((sI/opt/alt/python27/lib/python2.7/site-packages/paste/debug/wdg_validate.pyt__init__%s c stgdfd}|j||}z"x|D]}j|qCWWdt|drz|jnXj}\}}t|dpd} | jd r| jd r| jd r|gSg} | jdr| j d n|j |j | |} | r||j || d }|j d tt|d f|j d tt|fn|gS( Ncs*j||f|||jS(N(textendtwrite(tstatustheaderstexc_info(toutputtresponsetstart_response(sI/opt/alt/python27/lib/python2.7/site-packages/paste/debug/wdg_validate.pytwriter_start_response-stcloses content-typets text/htmls text/xhtmlsapplication/xhtmlstext/xhtml+xmls--xmlisContent-Lengthscontent-length(RtNoneRR thasattrRtgetvalueRt startswithtappendtcall_wdg_validateRt add_errortremovetstrtlen( RtenvironRRtapp_itertstpageR R tvtopst html_errors((RRRsI/opt/alt/python27/lib/python2.7/site-packages/paste/debug/wdg_validate.pyt__call__)s8    "c Csytdkrtdntj|g|dtdtdtjdtjdtj}|j|d}|j |S(Ns>This middleware requires the subprocess module from Python 2.4tshellt close_fdststdouttstdintstderri( t subprocessRt ValueErrortPopentFalsetTruetPIPEtSTDOUTt communicatetwait(RRR#R!tprocR(((sI/opt/alt/python27/lib/python2.7/site-packages/paste/debug/wdg_validate.pyRPs      cCs]dtj|}|jj|}|rN||j |||jgS||gSdS(NsR
%s
(tcgitescapet_end_body_regextsearchtstart(Rt html_pageR$tadd_texttmatch((sI/opt/alt/python27/lib/python2.7/site-packages/paste/debug/wdg_validate.pyR_s #N( t__name__t __module__t__doc__tretcompiletIR7RRR%RR(((sI/opt/alt/python27/lib/python2.7/site-packages/paste/debug/wdg_validate.pyRs  ' RcCst||d|S(s Wraps the application in the WDG validator from http://www.htmlhelp.com/tools/validator/ Validation errors are appended to the text of each page. You can configure this by giving the path to the validate executable (by default picked up from $PATH) R(R(RRR((sI/opt/alt/python27/lib/python2.7/site-packages/paste/debug/wdg_validate.pytmake_wdg_validate_middlewareks ( R?t cStringIORR+tpaste.responseRR@R5t__all__tobjectRRC(((sI/opt/alt/python27/lib/python2.7/site-packages/paste/debug/wdg_validate.pyts    \