ó Afc@s€ddlZddlZddlZd \ZZZZZd„Zd„Z d „Z d „Z d „Z e d kr|e ƒndS(iÿÿÿÿNiiiiicCs~|jt|d@ƒƒ|d}|jt|d@ƒƒ|d}|jt|d@ƒƒ|d}|jt|d@ƒƒdS(Niÿi(twritetchr(toutputtvalue((s*/usr/lib64/python2.7/Demo/zlib/minigzip.pytwrite32 s   cCspt|jdƒƒ}|t|jdƒƒd>7}|t|jdƒƒd>7}|t|jdƒƒd>7}|S(Niiii(tordtread(tinputtv((s*/usr/lib64/python2.7/Demo/zlib/minigzip.pytread32s cCs.|jdƒ|jttƒƒtj|ƒ}|d}t||ƒ|jdƒ|jdƒ|j|dƒtjdƒ}tjdtj tj tj dƒ}xQt rø|j d ƒ}|dkrÍPntj||ƒ}|j|j|ƒƒq¨W|j|jƒƒt||ƒt||d ƒdS( Ns‹issÿsti iii(RRtFNAMEtoststatRtzlibtcrc32t compressobjtDEFLATEDt MAX_WBITSt DEF_MEM_LEVELtTrueRtcompresstflush(tfilenameRRtstatvaltmtimetcrcvaltcompobjtdata((s*/usr/lib64/python2.7/Demo/zlib/minigzip.pyRs(        c Cs{|jdƒ}|dkr0dGHtjdƒnt|jdƒƒdkr`dGHtjdƒnt|jdƒƒ}|jdƒ|t@rÎt|jdƒƒ}|d t|jdƒƒ7}|j|ƒn|t@rx,tr|jdƒ}|d krÛPqÛqÛWn|t@r@x,tr<|jdƒ}|d krPqqWn|t@rZ|jdƒnt j t j ƒ}t j d ƒ}d}xgtrë|jd ƒ} | d krªPn|j | ƒ} |j| ƒ|t| ƒ7}t j | |ƒ}q…W|jƒ} |j| ƒ|t| ƒ7}t j | |ƒ}|jd dƒt|ƒ} t|ƒ} | |krcdGHn| |krwdGHndS(Nis‹sNot a gzipped fileiiisUnknown compression methodiisR iiøÿÿÿsCRC check failed.s!Incorrect length of data producedii(RtsystexitRtFEXTRAR RtFCOMMENTtFHCRCRt decompressobjRRt decompressRtlenRtseekR ( RRtmagictflagtxlentst decompobjRtlengthRt decompdataRtisize((s*/usr/lib64/python2.7/Demo/zlib/minigzip.pyR#1s^                   cCsÊttjƒdkr/dGHdGHtjdƒntjd}|jdƒr^t}|d }nt}|d}t|dƒ}t|d ƒ}|r¥t|||ƒn t ||ƒ|j ƒ|j ƒdS( NisUsage: minigzip.py s. The file will be compressed or decompressed.iis.gziýÿÿÿtrbtwb( R$RtargvRtendswithtFalseRtopenRR#tclose(Rt compressingt outputnameRR((s*/usr/lib64/python2.7/Demo/zlib/minigzip.pytmainks"     t__main__(iiiii(RRR tFTEXTR!RR R RR RR#R7t__name__(((s*/usr/lib64/python2.7/Demo/zlib/minigzip.pyts$    :