%PDF- %PDF-
Mini Shell

Mini Shell

Direktori : /proc/227033/root/opt/alt/python27/lib/python2.7/site-packages/paste/
Upload File :
Create Path :
Current File : //proc/227033/root/opt/alt/python27/lib/python2.7/site-packages/paste/gzipper.pyc

�
a�Nc@s�dZddlZddlmZmZddlmZyddlmZWn!e	k
roddlmZnXde
fd��YZde
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__(((s>/opt/alt/python27/lib/python2.7/site-packages/paste/gzipper.pyRst
middlewarecBseZdd�Zd�ZRS(icCs||_t|�|_dS(N(tapplicationtinttcompress_level(tselfRR
((s>/opt/alt/python27/lib/python2.7/site-packages/paste/gzipper.pyt__init__s	cCsud|jdd�kr(|j||�St||j�}|j||j�}|dk	rk|j|�n|j�S(NtgziptHTTP_ACCEPT_ENCODINGt(tgetRtGzipResponseR
tgzip_start_responsetNonetfinish_responsetwrite(Rtenvirontstart_responsetresponsetapp_iter((s>/opt/alt/python27/lib/python2.7/site-packages/paste/gzipper.pyt__call__s	(RRRR(((s>/opt/alt/python27/lib/python2.7/site-packages/paste/gzipper.pyRsRcBs/eZd�Zdd�Zd�Zd�ZRS(cCs4||_||_t�|_t|_d|_dS(N(RR
RtbuffertFalsetcompressibleRtcontent_length(RRR
((s>/opt/alt/python27/lib/python2.7/site-packages/paste/gzipper.pyR.s
			cCs�||_t|d�}t|d�}t|_|rl|jd�sT|jd�rld|krlt|_n|r~t|_n|jr�|jd�nt|d�||_||_|j	j
S(	Nscontent-typescontent-encodingstext/sapplication/tzipR
scontent-length(scontent-encodingsgzip(theadersRRRt
startswithtTruetappendRtstatusRR(RR$R texc_infotcttce((s>/opt/alt/python27/lib/python2.7/site-packages/paste/gzipper.pyR5s		$	
		cCs3|j}|jd�|j�}|j�|gS(Ni(Rtseektgetvaluetclose(Rtoutts((s>/opt/alt/python27/lib/python2.7/site-packages/paste/gzipper.pyRFs
	

cCs�|jr0tjddd|jd|j�}n	|j}z8x|D]}|j|�qCW|jrp|j�nWdt|d�r�|j�nX|jj�}t	j
|j|�|j|j
|j�dS(Ntmodetwbt
compressleveltfileobjR*(RR
tGzipFileR
RRR*thasattrttellRtupdateR RR$(RRtoutputR,R((s>/opt/alt/python27/lib/python2.7/site-packages/paste/gzipper.pyRMs		
	N(RRRRRRR(((s>/opt/alt/python27/lib/python2.7/site-packages/paste/gzipper.pyR,s		cKs,ddl}|jdtd�d�}|S(Ni����s=This function is deprecated; use make_gzip_middleware insteadicSs
t|�S(N(R(R((s>/opt/alt/python27/lib/python2.7/site-packages/paste/gzipper.pytfilterds(twarningstwarntDeprecationWarning(RtconfR7R6((s>/opt/alt/python27/lib/python2.7/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(tapptglobal_confR
((s>/opt/alt/python27/lib/python2.7/site-packages/paste/gzipper.pytmake_gzip_middlewarehs(t__doc__R
tpaste.responseRRtpaste.httpheadersRt	cStringIORtImportErrortobjectRRRR;R>(((s>/opt/alt/python27/lib/python2.7/site-packages/paste/gzipper.pyt<module>s
3		

Zerion Mini Shell 1.0