zmc
2023-08-08 e792e9a60d958b93aef96050644f369feb25d61b
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
U
T±d» ã@sddlZGdd„dƒZdS)éNc@sPeZdZdZdd„Zdd„Zejfdd„Zdd    „Z    dd d „Z
d d„Z dd„Z dS)Ú ContainerIOzm
    A file object that provides read access to a part of an existing
    file (for example a TAR file).
    cCs(||_d|_||_||_|j |¡dS)z­
        Create file object.
 
        :param file: Existing file.
        :param offset: Start of region, in bytes.
        :param length: Size of region, in bytes.
        rN)ÚfhÚposÚoffsetÚlengthÚseek)ÚselfÚfilerr©r
úFd:\z\workplace\vscode\pyvenv\venv\Lib\site-packages\PIL/ContainerIO.pyÚ__init__s
zContainerIO.__init__cCsdS)NFr
©rr
r
r Úisatty,szContainerIO.isattycCs`|dkr|j||_n|dkr,|j||_n||_tdt|j|jƒƒ|_|j |j|j¡dS)a
        Move file pointer.
 
        :param offset: Offset in bytes.
        :param mode: Starting position. Use 0 for beginning of region, 1
           for current offset, and 2 for end of region.  You cannot move
           the pointer outside the defined region.
        éérN)rrÚmaxÚminrrr)rrÚmoder
r
r r/s    zContainerIO.seekcCs|jS)ze
        Get current file pointer.
 
        :returns: Offset from start of region, in bytes.
        )rr r
r
r ÚtellBszContainerIO.tellrcCsT|rt||j|jƒ}n |j|j}|s<d|jjkr8dSdS|j||_|j |¡S)z¥
        Read data.
 
        :param n: Number of bytes to read. If omitted or zero,
            read until end of region.
        :returns: An 8-bit string.
        ÚbóÚ)rrrrrÚread)rÚnr
r
r rJs  zContainerIO.readcCsPd|jjkrdnd}d|jjkr$dnd}| d¡}|s8qL||}||kr(qLq(|S)zJ
        Read a line of text.
 
        :returns: An 8-bit string.
        rrró
Ú
r)rrr)rÚsZnewline_characterÚcr
r
r Úreadline[s
zContainerIO.readlinecCs"g}| ¡}|sq| |¡q|S)zZ
        Read multiple lines of text.
 
        :returns: A list of 8-bit strings.
        )rÚappend)rÚlinesrr
r
r Ú    readlinesls  zContainerIO.readlinesN)r) Ú__name__Ú
__module__Ú __qualname__Ú__doc__r rÚioÚSEEK_SETrrrrr!r
r
r
r rs
r)r&rr
r
r
r Ú<module>s