Ñò ô†³Kc @sÍdZddkZddklZlZddklZyddklZWn#e j oddklZnXde fd„ƒYZ de fd „ƒYZ d e fd „ƒYZ d „Zd d„ZdS(s- WSGI middleware Gzip-encodes the response. iÿÿÿÿN(t header_valuet remove_header(tCONTENT_LENGTH(tStringIOt GzipOutputcBseZRS((t__name__t __module__(((s1/usr/lib/python2.6/site-packages/paste/gzipper.pyRst middlewarecBseZdd„Zd„ZRS(icCs||_t|ƒ|_dS(N(t applicationtinttcompress_level(tselfRR ((s1/usr/lib/python2.6/site-packages/paste/gzipper.pyt__init__s cCssd|iddƒjo|i||ƒSt||iƒ}|i||iƒ}|o|i|ƒn|iƒS(NtgziptHTTP_ACCEPT_ENCODINGt(tgetRt GzipResponseR tgzip_start_responsetfinish_responsetwrite(R tenvirontstart_responsetresponsetapp_iter((s1/usr/lib/python2.6/site-packages/paste/gzipper.pyt__call__s  (RRR R(((s1/usr/lib/python2.6/site-packages/paste/gzipper.pyRs RcBs/eZd„Zdd„Zd„Zd„ZRS(cCs4||_||_tƒ|_t|_d|_dS(N(RR RtbuffertFalset compressibletNonetcontent_length(R RR ((s1/usr/lib/python2.6/site-packages/paste/gzipper.pyR .s     cCsÉ||_t|dƒ}t|dƒ}t|_|o:|idƒp|idƒod|jo t|_n|o t|_n|io|idƒnt|dƒ||_||_|i i S( Ns content-typescontent-encodingstext/s application/tzipR scontent-length(scontent-encodingsgzip( theadersRRRt startswithtTruetappendRtstatusRR(R R$R texc_infotcttce((s1/usr/lib/python2.6/site-packages/paste/gzipper.pyR5s  '       cCs3|i}|idƒ|iƒ}|iƒ|gS(Ni(Rtseektgetvaluetclose(R toutts((s1/usr/lib/python2.6/site-packages/paste/gzipper.pyRFs     c CsÓ|io(tiddd|id|iƒ}n |i}z:x|D]}|i|ƒqEW|io|iƒnWdt|dƒo|iƒnX|iiƒ}t i |i |ƒ|i |i |i ƒdS(Ntmodetwbt compressleveltfileobjR*(RR tGzipFileR RRR*thasattrttellRtupdateR RR$(R RtoutputR,R((s1/usr/lib/python2.6/site-packages/paste/gzipper.pyRMs   N(RRR RRRR(((s1/usr/lib/python2.6/site-packages/paste/gzipper.pyR,s   cKs,ddk}|idtdƒd„}|S(Niÿÿÿÿs=This function is deprecated; use make_gzip_middleware insteadicSs t|ƒS(N(R(R((s1/usr/lib/python2.6/site-packages/paste/gzipper.pytfilterds(twarningstwarntDeprecationWarning(RtconfR7R6((s1/usr/lib/python2.6/site-packages/paste/gzipper.pytfilter_factory_s    icCst|ƒ}t|d|ƒS(s¯ Wrap the middleware, so that it applies gzipping to a response when it is supported by the browser and the content is of type ``text/*`` or ``application/*`` R (R R(tappt global_confR ((s1/usr/lib/python2.6/site-packages/paste/gzipper.pytmake_gzip_middlewarehs (t__doc__R tpaste.responseRRtpaste.httpheadersRt cStringIORt ImportErrortobjectRRRR;R>(((s1/usr/lib/python2.6/site-packages/paste/gzipper.pyt s 3