File: archive.pyi

package info (click to toggle)
python-django-stubs 5.2.9-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 4,832 kB
  • sloc: python: 5,185; makefile: 15; sh: 8
file content (44 lines) | stat: -rw-r--r-- 1,487 bytes parent folder | download
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
from collections.abc import Iterable, Sequence
from types import TracebackType
from typing import Any

from typing_extensions import Self

class ArchiveException(Exception): ...
class UnrecognizedArchiveFormat(ArchiveException): ...

def extract(path: str, to_path: str) -> None: ...

class Archive:
    def __init__(self, file: str) -> None: ...
    def __enter__(self) -> Self: ...
    def __exit__(
        self,
        exc_type: type[BaseException] | None,
        exc_value: BaseException | None,
        traceback: TracebackType | None,
    ) -> None: ...
    def extract(self, to_path: str) -> None: ...
    def list(self) -> None: ...
    def close(self) -> None: ...

class BaseArchive:
    def split_leading_dir(self, path: str) -> Sequence[str]: ...
    def has_leading_dir(self, paths: Iterable[str]) -> bool: ...
    def target_filename(self, to_path: str, name: str) -> str: ...
    def extract(self, to_path: str) -> None: ...
    def list(self, *args: Any, **kwargs: Any) -> None: ...

class TarArchive(BaseArchive):
    def __init__(self, file: str) -> None: ...
    def list(self, *args: Any, **kwargs: Any) -> None: ...
    def close(self) -> None: ...
    def extract(self, to_path: str) -> None: ...

class ZipArchive(BaseArchive):
    def __init__(self, file: str) -> None: ...
    def list(self, *args: Any, **kwargs: Any) -> None: ...
    def extract(self, to_path: str) -> None: ...
    def close(self) -> None: ...

extension_map: dict[str, type[BaseArchive]]