From 9ba44c7a809205212dbfbd35c5ef406a18059dd3 Mon Sep 17 00:00:00 2001 From: Matthias Kramm Date: Mon, 21 Sep 2015 09:12:30 -0700 Subject: [PATCH] improve zipimport module --- builtins/2.7/zipimport.pyi | 32 ++++++++++++++++++++------------ 1 file changed, 20 insertions(+), 12 deletions(-) diff --git a/builtins/2.7/zipimport.pyi b/builtins/2.7/zipimport.pyi index 6f769e7fb..b794f7d7b 100644 --- a/builtins/2.7/zipimport.pyi +++ b/builtins/2.7/zipimport.pyi @@ -1,16 +1,24 @@ """Stub file for the 'zipimport' module.""" -# This is an autogenerated file. It serves as a starting point -# for a more precise manual annotation of this module. -# Feel free to edit the source below, but remove this header when you do. -from typing import Any, List, Tuple, Dict, Generic +from typing import Dict + +class ZipImportError(ImportError): + pass + +_zip_directory_cache = ... # type: Dict[str, dict] class zipimporter(object): - def find_module(self, a: str, *args, **kwargs) -> None: ... - def get_code(self, a: str) -> Any: ... - def get_data(self, a: str) -> str: - raise IOError() - def get_filename(self, a: str) -> str: ... - def get_source(self, a: str) -> Any: ... - def is_package(self, a: str) -> bool: ... - def load_module(self, a: str) -> Any: ... + archive = ... # type: str + prefix = ... # type: str + _files = ... # type: Dict[str, tuple] + def __init__(self, path: str) -> None: + raise ZipImportError + def find_module(self, fullname: str, path: str = ...) -> Optional[zipimporter]: ... + def get_code(self, fullname: str) -> code: ... + def get_data(self, fullname: str) -> str: + raise IOError + def get_filename(self, fullname: str) -> str: ... + def get_source(self, fullname: str) -> str: ... + def is_package(self, fullname: str) -> bool: ... + def load_module(self, fullname: str) -> module: ... +