tzh
2024-08-22 c7d0944258c7d0943aa7b2211498fd612971ce27
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
L\¬Qc@sùdZddlZddlZddlZddlZddlZddlZddlZddgZddddd    f\Z    Z
Z Z Z ddf\ZZd
„Zd „Zd d d„Zdejfd„ƒYZd„ZedkrõeƒndS(s‘Functions that read and write gzipped files.
 
The user of the file doesn't have to worry about the compression,
but random access is not allowed.iÿÿÿÿNtGzipFiletopeniiiiicCs|jtjd|ƒƒdS(Ns<L(twritetstructtpack(toutputtvalue((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/gzip.pytwrite32uscCstjd|jdƒƒdS(Ns<Iii(Rtunpacktread(tinput((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/gzip.pytread32strbi    cCst|||ƒS(sŸShorthand for GzipFile(filename, mode, compresslevel).
 
    The filename argument is required; mode defaults to 'rb'
    and compresslevel defaults to 9.
 
    (R(tfilenametmodet compresslevel((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/gzip.pyRscBseZdZdZd Zdddddd„Zed„ƒZd„Z    d„Z
d„Z d    „Z d
„Z d „Zd „Zd d„Zd„Zdd„Zd„Zd„Zed„ƒZd„Zejd„Zd„Zd„Zd„Zd„Zd„Zdd„Zd d„Z RS(!sˆThe GzipFile class simulates most of the methods of a file object with
    the exception of the readinto() and truncate() methods.
 
    i
ii    c
Csß|r|jddƒ}n|r:d|kr:|d7}n|dkrhtj||pXdƒ}|_n|dkr§t|dƒrž|jdkrž|j}q§d}n|dkr×t|dƒrÎ|j}q×d}n|dd    !d
kr,t|_t    |_
d|_ d|_ d|_ ||_d |_nx|dd    !d ksR|dd    !d kr“t|_|j|ƒtj|tjtj tjdƒ|_ntd|d‚||_d|_||_|jtkrÛ|jƒndS(s{Constructor for the GzipFile class.
 
        At least one of fileobj and filename must be given a
        non-trivial value.
 
        The new class instance is based on fileobj, which can be a regular
        file, a StringIO object, or any other object which simulates a file.
        It defaults to None, in which case filename is opened to provide
        a file object.
 
        When fileobj is not None, the filename argument is only used to be
        included in the gzip file header, which may includes the original
        filename of the uncompressed file.  It defaults to the filename of
        fileobj, if discernible; otherwise, it defaults to the empty string,
        and in this case the original filename is not included in the header.
 
        The mode argument can be any of 'r', 'rb', 'a', 'ab', 'w', or 'wb',
        depending on whether the file will be read or written.  The default
        is the mode of fileobj if discernible; otherwise, the default is 'rb'.
        Be aware that only the 'rb', 'ab', and 'wb' values should be used
        for cross-platform portability.
 
        The compresslevel argument is an integer from 0 to 9 controlling the
        level of compression; 1 is fastest and produces the least compression,
        and 9 is slowest and produces the most compression. 0 is no compression
        at all. The default is 9.
 
        The mtime argument is an optional numeric timestamp to be written
        to the stream when compressing.  All gzip compressed streams
        are required to contain a timestamp.  If omitted or None, the
        current time is used.  This module ignores the timestamp when
        decompressing; however, some programs, such as gunzip, make use
        of it.  The format of the timestamp is the same as that of the
        return value of time.time() and of the st_mtime member of the
        object returned by os.stat().
 
        tUttbR tnames<fdopen>RiitridtwtasMode s not supportedN(treplacetNonet __builtin__Rt    myfileobjthasattrRRtREADtTruet _new_membertextrabuft    extrasizet
extrastartt min_readsizetWRITEt _init_writetzlibt compressobjtDEFLATEDt    MAX_WBITSt DEF_MEM_LEVELtcompresstIOErrortfileobjtoffsettmtimet_write_gzip_header(tselfR RRR,R.((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/gzip.pyt__init__-sH*  "                                     &                     cCsSddl}|jdtdƒ|jtkrL|jddkrL|jdS|jS(Niÿÿÿÿsuse the name attributeiiýÿÿÿs.gz(twarningstwarntDeprecationWarningRR#R(R0R2((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/gzip.pyR Šs
 " cCs6t|jƒ}d|dd!dtt|ƒƒdS(Ns<gzip iiÿÿÿÿt t>(treprR,thextid(R0ts((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/gzip.pyt__repr__’scCs|jrtdƒ‚ndS(sLRaises a ValueError if the underlying file object has been closed.
 
        sI/O operation on closed file.N(tclosedt
ValueError(R0((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/gzip.pyt _check_closed–s    cCs>||_tjdƒd@|_d|_g|_d|_dS(NRlÿÿi(RR%tcrc32tcrctsizetwritebuftbufsize(R0R ((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/gzip.pyR$s
            cCs÷|jjdƒ|jjdƒtjj|jƒ}|jdƒrQ|d }nd}|rft}n|jjt|ƒƒ|j    }|dkr t j ƒ}nt |jt |ƒƒ|jjdƒ|jjdƒ|ró|jj|dƒndS(    Ns‹ss.gziýÿÿÿissÿt(R,RtostpathtbasenameRtendswithtFNAMEtchrR.RttimeRtlong(R0tfnametflagsR.((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/gzip.pyR/¤s"          cCs#tjdƒd@|_d|_dS(NRlÿÿi(R%R?R@RA(R0((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/gzip.pyt
_init_read·scCs|jjdƒ}|dkr*td‚nt|jjdƒƒ}|dkrZtd‚nt|jjdƒƒ}t|jƒ|_|jjdƒ|t@rét|jjdƒƒ}|dt|jjdƒƒ}|jj|ƒn|t@r,x6tr(|jjdƒ}| s!|dkröPqöqöWn|t    @rox6trk|jjdƒ}| sd|dkr9Pq9q9Wn|t
@rŒ|jjdƒndS(    Nis‹sNot a gzipped fileiisUnknown compression methodiRD( R,R    R+tordR R.tFEXTRARIRtFCOMMENTtFHCRC(R0tmagictmethodtflagtxlenR:((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/gzip.pyt_read_gzip_header»s2    
 
     
     
cCsõ|jƒ|jtkr:ddl}t|jdƒ‚n|jdkrUtd‚nt    |t
ƒrs|j ƒ}nt |ƒdkrë|j t |ƒ|_ tj||jƒd@|_|jj|jj|ƒƒ|jt |ƒ7_nt |ƒS(Niÿÿÿÿs$write() on read-only GzipFile objects!write() on closed GzipFile objectilÿÿ(R>RR#terrnoR+tEBADFR,RR=t
isinstancet
memoryviewttobytestlenRAR%R?R@RR*R-(R0tdataRY((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/gzip.pyRÜs
  iÿÿÿÿcCsu|jƒ|jtkr:ddl}t|jdƒ‚n|jdkr\|jdkr\dSd}|dkrÂy4x-t    r |j
|ƒt |j |dƒ}qtWWq.t k
r¾|j}q.Xnly=x6||jkrý|j
|ƒt |j |dƒ}qÈWWn,t k
r-||jkr.|j}q.nX|j|j}|j|||!}|j||_|j|7_|S(Niÿÿÿÿs$read() on write-only GzipFile objectiRii(R>RRRYR+RZR R,RRt_readtmintmax_read_chunktEOFErrorR-R!R(R0RARYtreadsizeR-tchunk((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/gzip.pyR    ñs4
          cCs/t|ƒ|j|_|jt|ƒ8_dS(N(R^R R-(R0tbuf((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/gzip.pyt_unreadscCsl|jdkrtd‚n|jr­|jjƒ}|jjddƒ||jjƒkrgtd‚n|jj|ƒ|jƒ|jƒtj    tj
ƒ|_ t |_n|jj |ƒ}|dkrý|j jƒ}|jƒ|j|ƒtd‚n|j j |ƒ}|j|ƒ|j jdkrh|jjt|j jƒ ddƒ|jƒt|_ndS(Ns Reached EOFiiRii(R,RRcRttelltseekRORXR%t decompressobjR(t
decompresstFalseR    tflusht    _read_eoft_add_read_datat unused_dataR^R(R0RAtposRft
uncompress((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/gzip.pyR`s0      
 
 
   $
cCs|tj||jƒd@|_|j|j}|j|||_|jt|ƒ|_|j|_|jt|ƒ|_dS(Nlÿÿ(    R%R?R@R-R!RR R^RA(R0R_R-((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/gzip.pyRoHs  cCsÒ|jjddƒt|jƒ}t|jƒ}||jkrhtdt|ƒt|jƒfƒ‚n||jd@kr‡td‚nd}x"|dkr±|jjdƒ}qW|rÎ|jjddƒndS(NiøÿÿÿisCRC check failed %s != %slÿÿs!Incorrect length of data producedRDiÿÿÿÿ(R,RiR R@R+R8RAR    (R0R?tisizetc((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/gzip.pyRnPs cCs |jdkS(N(R,R(R0((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/gzip.pyR<hscCs²|jdkrdS|jtkrq|jj|jjƒƒt|j|jƒt|j|j    d@ƒd|_n|jt
krŒd|_n|j r®|j j ƒd|_ ndS(Nlÿÿ( R,RRR#RR*RmRR@RARRtclose(R0((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/gzip.pyRuls       cCsI|jƒ|jtkrE|jj|jj|ƒƒ|jjƒndS(N(R>RR#R,RR*Rm(R0t    zlib_mode((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/gzip.pyRm{s
cCs |jjƒS(s¥Invoke the underlying file object's fileno() method.
 
        This will raise AttributeError if the underlying file object
        doesn't support fileno().
        (R,tfileno(R0((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/gzip.pyRw‚scCs_|jtkrtdƒ‚n|jjdƒt|_d|_d|_d|_    d|_
dS(s[Return the uncompressed stream file position indicator to the
        beginning of the filesCan't rewind in write modeiRN( RRR+R,RiRRRR R!R-(R0((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/gzip.pytrewindŠs                cCs |jtkS(N(RR(R0((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/gzip.pytreadable–scCs |jtkS(N(RR#(R0((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/gzip.pytwritable™scCstS(N(R(R0((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/gzip.pytseekableœsicCs*|r1|dkr"|j|}q1tdƒ‚n|jtkr¯||jkr^tdƒ‚n||j}x)t|dƒD]}|jddƒq|W|j|ddƒnt|jtkr#||jkrÚ|jƒn||j}x%t|dƒD]}|j    dƒqøW|j    |dƒn|jS(NisSeek from end not supportedsNegative seek in write modeiRD(
R-R=RR#R+txrangeRRRxR    (R0R-twhencetcountti((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/gzip.pyRiŸs&    cCs¯|dkrŠ|j|j}|jjd|ƒd}|dkru|j||8_|j||7_|j||!Stj}|j}n|}g}xÛ|dkrs|j|ƒ}|jdƒ}||ksí|dkrút    |ƒ|krú|d}n|dks|dkr@|j
||d ƒ|j ||dƒPn|j
|ƒ|t    |ƒ}t ||dƒ}q™W||jkr¢t ||jddƒ|_ndj |ƒS(Nis
iiÿÿÿÿRii(R-R!RtfindR tsystmaxintR"R    R^tappendRgRatjoin(R0RAR-RRdtbufsRt((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/gzip.pytreadline·s4       *  Ni(i (!t__name__t
__module__t__doc__RRRbR1tpropertyR R;R>R$R/RORXRR    RgR`RoRnR<RuR%t Z_SYNC_FLUSHRmRwRxRyRzR{RiR†(((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/gzip.pyR$s8\                        !     !     2                                 c    Cs¬tjd}|o |ddk}|r6|d}n|sHdg}nx]|D]U}|rÞ|dkr‘tddddd    tjƒ}tj}q9|d
d kr¶d Gt|ƒGHqOnt|dƒ}tj|d
 d ƒ}n[|dkrtj}tdddd d    tjƒ}n%tj|dƒ}t|d d ƒ}x0trk|j    dƒ}|s[Pn|j
|ƒq<W|tjk    rˆ|j ƒn|tjk    rO|j ƒqOqOWdS(Niis-dt-R RRR R,iýÿÿÿs.gzsfilename doesn't end in .gz:twbi( RtargvRtstdintstdoutR7RRRR    RRu(targsRktargtftgRe((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/gzip.pyt_testßs<           !     t__main__(R‰RRRKRER%tioRt__all__tFTEXTRSRQRIRRRR#RR RtBufferedIOBaseRR•R‡(((sL/tmp/ndk-User/buildhost/install/prebuilt/darwin-x86_64/lib/python2.7/gzip.pyt<module>s0    $            ÿ¼    &