mň ˆ%ÜGc@sqdklZdklZdkZdkZdkZdZdZdefd„ƒYZde fd„ƒYZ dS( (s spyceModule(sStringIONs-Compress module provides dynamic compression.i_tcompresscBsDtZd„Zdd„Zddd„Zdd„Zdd„ZRS(NcCs2t|ƒ|_|iidƒit|iƒdS(Ntresponse(tFilterCompresstselft_filtert_apit getModulet addFiltertOUTPUT_POSITION(R((t4/home/holguin2/public_html/spyce/modules/compress.pytstartscCs|p|iiƒndS(N(ttheErrorRRtclose(RR ((R tfinishscCs.|o|iƒn|o|iƒndS(N(tgzipRtspaces(RRR((R tinitsicCs|ii|ƒdS(N(RRt setSpaceModeton(RR((R RscCs|ii|ƒdS(N(RRtsetGZIPtlevel(RR((R Rs(t__name__t __module__R tNoneR RRR(((R Rs    RcBs\tZd„Zd„Zd„Zd„Zd„Zd„Zdd„Zd „Z d „Z RS( NcCs=||_tƒ|_d|_d|_d|_d|_ dS(Ni( tmoduleRt_moduletStringIOt_buft_flushedt_spaceRt_gzipt _gzipfile(RR((R t__init__"s      cCs|i|ƒdS(N(Rtwritets(RR"((R t writeStatic)scKs|it|ƒƒdS(N(RR!tstrR"(RR"tkwargs((R t writeExpr+scCs ||_dS(N(RRR(RR((R R-scCsŰ|io d‚n|iiidƒidƒ}| pti|dƒdjodSn|djod|_ d|_ nZt ƒ|_ |o(tiddd|i d |ƒ|_ ntiddd|i ƒ|_ dS( Nsoutput already flushedtrequestsAccept-EncodingRitmodetwtfileobjt compresslevel(RRRRRt getHeadert encodingststringtfindRRRRRRtGzipFile(RRR-((R R/s  !    (cOs|ii|ƒdS(N(RRR!R"(RR"targsR%((R R!>sicCsßd|_|iiƒ}tƒ|_|ioti|ƒ}n|i o€|i i |ƒ|i i ƒ|o9|i iidƒiddƒ|i iƒd|_ n|iiƒ}|iidƒn|ii |ƒdS(NiRsContent-EncodingRi(RRRtgetvalueR"RRt spyceUtilt spaceCompactRR!tflushtfinalRRRt addHeaderR RRttruncatetnext(RR6R"((R t flushImpl@s       cCstƒ|_dS(N(RRR(R((R t clearImplPscCs|idƒdS(Ni(RR:(R((R R Rs( RRR R#R&RRR!R:R;R (((R R!s        ( t spyceModulet cStringIORRR.R3t__doc__RRtobjectR( RR<R3RRRRR>R.((R t? s