mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-07 20:54:28 +08:00
34 lines
1.0 KiB
Python
34 lines
1.0 KiB
Python
# TODO these are incomplete
|
|
|
|
from typing import Any, List, overload, Callable
|
|
|
|
class TarError(Exception): ...
|
|
|
|
class TarInfo:
|
|
name = ... # type: str
|
|
size = 0
|
|
uid = 0
|
|
gid = 0
|
|
|
|
class TarFile:
|
|
def getmember(self, name: str) -> TarInfo: ...
|
|
def getmembers(self) -> List[TarInfo]: ...
|
|
def getnames(self) -> List[str]: ...
|
|
def extractall(self, path: str = ...,
|
|
members: List[TarInfo] = ...) -> None: ...
|
|
|
|
@overload
|
|
def extract(self, member: str, path: str = ...,
|
|
set_attrs: bool = ...) -> None: ...
|
|
@overload
|
|
def extract(self, member: TarInfo, path: str = ...,
|
|
set_attrs: bool = ...) -> None: ...
|
|
|
|
def add(self, name: str, arcname: str = ..., recursive: bool = ...,
|
|
exclude: Callable[[str], bool] = ..., *,
|
|
filter: 'Callable[[TarFile], TarFile]' = ...) -> None: ...
|
|
def close(self) -> None: ...
|
|
|
|
def open(name: str = ..., mode: str = ..., fileobj: Any = ..., bufsize: int = ...,
|
|
**kwargs) -> TarFile: ...
|