3 from typing import Callable, IO, Iterable, List, Optional, Text, Tuple, Type, Union
\r
4 from types import TracebackType
\r
9 if sys.version_info >= (3, 6):
\r
10 _Path = Union[os.PathLike[Text], Text]
\r
13 _SZI = Union[Text, ZipInfo]
\r
14 _DT = Tuple[int, int, int, int, int, int]
\r
17 if sys.version_info >= (3,):
\r
18 class BadZipFile(Exception): ...
\r
19 BadZipfile = BadZipFile
\r
21 class BadZipfile(Exception): ...
\r
24 class LargeZipFile(Exception): ...
\r
27 debug = ... # type: int
\r
28 comment = ... # type: bytes
\r
29 filelist = ... # type: List[ZipInfo]
\r
30 def __init__(self, file: Union[_Path, IO[bytes]], mode: Text = ..., compression: int = ...,
\r
31 allowZip64: bool = ...) -> None: ...
\r
32 def __enter__(self) -> ZipFile: ...
\r
33 def __exit__(self, exc_type: Optional[Type[BaseException]],
\r
34 exc_val: Optional[BaseException],
\r
35 exc_tb: Optional[TracebackType]) -> bool: ...
\r
36 def close(self) -> None: ...
\r
37 def getinfo(self, name: Text) -> ZipInfo: ...
\r
38 def infolist(self) -> List[ZipInfo]: ...
\r
39 def namelist(self) -> List[Text]: ...
\r
40 def open(self, name: _SZI, mode: Text = ...,
\r
41 pwd: Optional[bytes] = ...) -> IO[bytes]: ...
\r
42 def extract(self, member: _SZI, path: Optional[_SZI] = ...,
\r
43 pwd: bytes = ...) -> str: ...
\r
44 def extractall(self, path: Optional[_Path] = ...,
\r
45 members: Optional[Iterable[Text]] = ...,
\r
46 pwd: Optional[bytes] = ...) -> None: ...
\r
47 def printdir(self) -> None: ...
\r
48 def setpassword(self, pwd: bytes) -> None: ...
\r
49 def read(self, name: _SZI, pwd: Optional[bytes] = ...) -> bytes: ...
\r
50 def testzip(self) -> Optional[str]: ...
\r
51 def write(self, filename: _Path, arcname: Optional[_Path] = ...,
\r
52 compress_type: Optional[int] = ...) -> None: ...
\r
53 if sys.version_info >= (3,):
\r
54 def writestr(self, zinfo_or_arcname: _SZI, data: Union[bytes, str],
\r
55 compress_type: Optional[int] = ...) -> None: ...
\r
58 zinfo_or_arcname: _SZI, bytes: bytes,
\r
59 compress_type: Optional[int] = ...) -> None: ...
\r
61 class PyZipFile(ZipFile):
\r
62 if sys.version_info >= (3,):
\r
63 def __init__(self, file: Union[str, IO[bytes]], mode: str = ...,
\r
64 compression: int = ..., allowZip64: bool = ...,
\r
65 opimize: int = ...) -> None: ...
\r
66 def writepy(self, pathname: str, basename: str = ...,
\r
67 filterfunc: Optional[Callable[[str], bool]] = ...) -> None: ...
\r
70 pathname: Text, basename: Text = ...) -> None: ...
\r
73 filename = ... # type: Text
\r
74 date_time = ... # type: _DT
\r
75 compress_type = ... # type: int
\r
76 comment = ... # type: bytes
\r
77 extra = ... # type: bytes
\r
78 create_system = ... # type: int
\r
79 create_version = ... # type: int
\r
80 extract_version = ... # type: int
\r
81 reserved = ... # type: int
\r
82 flag_bits = ... # type: int
\r
83 volume = ... # type: int
\r
84 internal_attr = ... # type: int
\r
85 external_attr = ... # type: int
\r
86 header_offset = ... # type: int
\r
87 CRC = ... # type: int
\r
88 compress_size = ... # type: int
\r
89 file_size = ... # type: int
\r
90 if sys.version_info < (3,):
\r
91 def __init__(self, filename: Optional[Text] = ...,
\r
92 date_time: Optional[_DT] = ...) -> None: ...
\r
95 def is_zipfile(filename: Union[Text, IO[bytes]]) -> bool: ...
\r
97 ZIP_STORED = ... # type: int
\r
98 ZIP_DEFLATED = ... # type: int
\r
99 if sys.version_info >= (3, 3):
\r
100 ZIP_BZIP2 = ... # type: int
\r
101 ZIP_LZMA = ... # type: int
\r