add zipfile for py2 (#345)

This commit is contained in:
Valérian Rousset
2016-07-15 14:55:20 +02:00
committed by Matthias Kramm
parent 932737d322
commit 8ef221c162
3 changed files with 97 additions and 29 deletions

View File

@@ -1,29 +0,0 @@
# TODO these are incomplete
from typing import List, Tuple, BinaryIO, Union
ZIP_STORED = 0
ZIP_DEFLATED = 0
def is_zipfile(filename: Union[str, BinaryIO]) -> bool: ...
class ZipInfo:
filename = ... # type: str
date_time = ... # type: Tuple[int, int, int, int, int, int]
compressed_size = 0
file_size = 0
class ZipFile:
def __init__(self, file: Union[str, BinaryIO], mode: str = ...,
compression: int = ...,
allowZip64: bool = ...) -> None: ...
def close(self) -> None: ...
def getinfo(name: str) -> ZipInfo: ...
def infolist(self) -> List[ZipInfo]: ...
def namelist(self) -> List[str]: ...
def read(self, name: Union[str, ZipInfo], pwd: str = ...) -> bytes: ...
def write(self, filename: str, arcname: str = ...,
compress_type: int = ...) -> None: ...
def __enter__(self) -> 'ZipFile': ...
def __exit__(self, type, value, traceback) -> bool: ...