-
-
Notifications
You must be signed in to change notification settings - Fork 72
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Hiroshi Miura <[email protected]>
- Loading branch information
Showing
17 changed files
with
839 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
from py7zr.exceptions import Bad7zFile as Bad7zFile, DecompressionError as DecompressionError, PasswordRequired as PasswordRequired, UnsupportedCompressionMethodError as UnsupportedCompressionMethodError | ||
from py7zr.properties import CHECK_CRC32 as CHECK_CRC32, CHECK_CRC64 as CHECK_CRC64, CHECK_NONE as CHECK_NONE, CHECK_SHA256 as CHECK_SHA256, FILTER_ARM as FILTER_ARM, FILTER_ARMTHUMB as FILTER_ARMTHUMB, FILTER_BROTLI as FILTER_BROTLI, FILTER_BZIP2 as FILTER_BZIP2, FILTER_COPY as FILTER_COPY, FILTER_CRYPTO_AES256_SHA256 as FILTER_CRYPTO_AES256_SHA256, FILTER_DEFLATE as FILTER_DEFLATE, FILTER_DELTA as FILTER_DELTA, FILTER_IA64 as FILTER_IA64, FILTER_LZMA as FILTER_LZMA, FILTER_LZMA2 as FILTER_LZMA2, FILTER_POWERPC as FILTER_POWERPC, FILTER_PPMD as FILTER_PPMD, FILTER_SPARC as FILTER_SPARC, FILTER_X86 as FILTER_X86, FILTER_ZSTD as FILTER_ZSTD, PRESET_DEFAULT as PRESET_DEFAULT, PRESET_EXTREME as PRESET_EXTREME | ||
from py7zr.py7zr import ArchiveInfo as ArchiveInfo, FileInfo as FileInfo, SevenZipFile as SevenZipFile, is_7zfile as is_7zfile, pack_7zarchive as pack_7zarchive, unpack_7zarchive as unpack_7zarchive | ||
|
||
# Names in __all__ with no definition: | ||
# __version__ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
from . import cli as cli | ||
|
||
def main(): ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,142 @@ | ||
from io import BytesIO | ||
from py7zr.compressor import SevenZipCompressor as SevenZipCompressor, SevenZipDecompressor as SevenZipDecompressor | ||
from py7zr.exceptions import Bad7zFile as Bad7zFile | ||
from py7zr.helpers import ArchiveTimestamp as ArchiveTimestamp, calculate_crc32 as calculate_crc32 | ||
from py7zr.properties import DEFAULT_FILTERS as DEFAULT_FILTERS, MAGIC_7Z as MAGIC_7Z, PROPERTY as PROPERTY | ||
from typing import Any, BinaryIO, List, Tuple | ||
|
||
MAX_LENGTH: int | ||
P7ZIP_MAJOR_VERSION: bytes | ||
P7ZIP_MINOR_VERSION: bytes | ||
|
||
def read_crcs(file: BinaryIO, count: int) -> List[int]: ... | ||
def write_crcs(file: BinaryIO, crcs: Any) -> Any: ... | ||
def read_byte(file: BinaryIO) -> int: ... | ||
def write_bytes(file: BinaryIO, data: bytes) -> Any: ... | ||
def write_byte(file: BinaryIO, data: Any) -> Any: ... | ||
def read_real_uint64(file: BinaryIO) -> Tuple[int, bytes]: ... | ||
def read_uint32(file: BinaryIO) -> Tuple[int, bytes]: ... | ||
def write_uint32(file: BinaryIO, value: Any) -> Any: ... | ||
def read_uint64(file: BinaryIO) -> int: ... | ||
def write_real_uint64(file: BinaryIO, value: int) -> Any: ... | ||
def write_uint64(file: BinaryIO, value: int) -> Any: ... | ||
def read_boolean(file: BinaryIO, count: int, checkall: bool=...) -> List[bool]: ... | ||
def write_boolean(file: BinaryIO, booleans: List[bool], all_defined: bool=...) -> Any: ... | ||
def read_utf16(file: BinaryIO) -> str: ... | ||
def write_utf16(file: BinaryIO, val: str) -> Any: ... | ||
def bits_to_bytes(bit_length: int) -> int: ... | ||
|
||
class PackInfo: | ||
packpos: int = ... | ||
numstreams: int = ... | ||
packsizes: Any = ... | ||
digestdefined: Any = ... | ||
crcs: Any = ... | ||
enable_digests: bool = ... | ||
def __init__(self) -> None: ... | ||
@classmethod | ||
def retrieve(cls, file: BinaryIO) -> Any: ... | ||
def write(self, file: BinaryIO) -> Any: ... | ||
|
||
class Bond: | ||
incoder: Any = ... | ||
outcoder: Any = ... | ||
def __init__(self, incoder: Any, outcoder: Any) -> None: ... | ||
|
||
class Folder: | ||
unpacksizes: Any = ... | ||
coders: Any = ... | ||
bindpairs: Any = ... | ||
packed_indices: Any = ... | ||
solid: bool = ... | ||
digestdefined: bool = ... | ||
crc: Any = ... | ||
decompressor: Any = ... | ||
compressor: Any = ... | ||
files: Any = ... | ||
password: Any = ... | ||
def __init__(self) -> None: ... | ||
@classmethod | ||
def retrieve(cls, file: BinaryIO) -> Any: ... | ||
def prepare_coderinfo(self, filters: Any) -> None: ... | ||
def write(self, file: BinaryIO) -> Any: ... | ||
def is_simple(self, coder: Any): ... | ||
def get_decompressor(self, packsize: int, reset: bool=...) -> SevenZipDecompressor: ... | ||
def get_compressor(self) -> SevenZipCompressor: ... | ||
def get_unpack_size(self) -> int: ... | ||
|
||
class UnpackInfo: | ||
@classmethod | ||
def retrieve(cls, file: BinaryIO) -> Any: ... | ||
numfolders: Any = ... | ||
folders: Any = ... | ||
datastreamidx: Any = ... | ||
def __init__(self) -> None: ... | ||
def write(self, file: BinaryIO) -> Any: ... | ||
|
||
class SubstreamsInfo: | ||
digests: Any = ... | ||
digestsdefined: Any = ... | ||
unpacksizes: Any = ... | ||
num_unpackstreams_folders: Any = ... | ||
def __init__(self) -> None: ... | ||
@classmethod | ||
def retrieve(cls, file: BinaryIO, numfolders: int, folders: List[Folder]) -> Any: ... | ||
def write(self, file: BinaryIO) -> Any: ... | ||
|
||
class StreamsInfo: | ||
packinfo: Any = ... | ||
unpackinfo: Any = ... | ||
substreamsinfo: Any = ... | ||
def __init__(self) -> None: ... | ||
@classmethod | ||
def retrieve(cls, file: BinaryIO) -> Any: ... | ||
def read(self, file: BinaryIO) -> None: ... | ||
def write(self, file: BinaryIO) -> Any: ... | ||
|
||
class HeaderStreamsInfo(StreamsInfo): | ||
packinfo: Any = ... | ||
unpackinfo: Any = ... | ||
def __init__(self) -> None: ... | ||
def write(self, file: BinaryIO) -> Any: ... | ||
|
||
class FilesInfo: | ||
files: Any = ... | ||
emptyfiles: Any = ... | ||
antifiles: Any = ... | ||
def __init__(self) -> None: ... | ||
@classmethod | ||
def retrieve(cls, file: BinaryIO) -> Any: ... | ||
def write(self, file: BinaryIO) -> Any: ... | ||
|
||
class WriteWithCrc: | ||
digest: int = ... | ||
def __init__(self, fp: BinaryIO) -> None: ... | ||
def write(self, data: Any): ... | ||
def tell(self): ... | ||
|
||
class Header: | ||
__slot__: Any = ... | ||
solid: bool = ... | ||
main_streams: Any = ... | ||
files_info: Any = ... | ||
size: int = ... | ||
password: Any = ... | ||
def __init__(self) -> None: ... | ||
@classmethod | ||
def retrieve(cls, fp: BinaryIO, buffer: BytesIO, start_pos: int, password: Any=...) -> Any: ... | ||
def write(self, file: BinaryIO, afterheader: int, encoded: Any=..., encrypted: Any=...) -> Any: ... | ||
@staticmethod | ||
def build_header(folders: Any): ... | ||
|
||
class SignatureHeader: | ||
version: Any = ... | ||
startheadercrc: int = ... | ||
nextheaderofs: int = ... | ||
nextheadersize: int = ... | ||
nextheadercrc: int = ... | ||
def __init__(self) -> None: ... | ||
@classmethod | ||
def retrieve(cls, file: BinaryIO) -> Any: ... | ||
def calccrc(self, length: int, header_crc: int) -> Any: ... | ||
def write(self, file: BinaryIO) -> Any: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
from typing import Any, Union | ||
|
||
class BCJFilter: | ||
is_encoder: Any = ... | ||
prev_mask: int = ... | ||
prev_pos: int = ... | ||
current_position: int = ... | ||
stream_size: Any = ... | ||
buffer: Any = ... | ||
def __init__(self, func: Any, readahead: int, is_encoder: bool, stream_size: int=...) -> None: ... | ||
def sparc_code(self): ... | ||
def ppc_code(self): ... | ||
def armt_code(self) -> int: ... | ||
def arm_code(self) -> int: ... | ||
def x86_code(self) -> int: ... | ||
def decode(self, data: Union[bytes, bytearray, memoryview], max_length: int=...) -> bytes: ... | ||
def encode(self, data: Union[bytes, bytearray, memoryview]) -> bytes: ... | ||
def flush(self): ... | ||
|
||
class BCJDecoder(BCJFilter): | ||
def __init__(self, size: int) -> None: ... | ||
|
||
class BCJEncoder(BCJFilter): | ||
def __init__(self) -> None: ... | ||
|
||
class SparcDecoder(BCJFilter): | ||
def __init__(self, size: int) -> None: ... | ||
|
||
class SparcEncoder(BCJFilter): | ||
def __init__(self) -> None: ... | ||
|
||
class PpcDecoder(BCJFilter): | ||
def __init__(self, size: int) -> None: ... | ||
|
||
class PpcEncoder(BCJFilter): | ||
def __init__(self) -> None: ... | ||
|
||
class ArmtDecoder(BCJFilter): | ||
def __init__(self, size: int) -> None: ... | ||
|
||
class ArmtEncoder(BCJFilter): | ||
def __init__(self) -> None: ... | ||
|
||
class ArmDecoder(BCJFilter): | ||
def __init__(self, size: int) -> None: ... | ||
|
||
class ArmEncoder(BCJFilter): | ||
def __init__(self) -> None: ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import abc | ||
from abc import ABC, abstractmethod | ||
from typing import Any | ||
|
||
class Callback(ABC, metaclass=abc.ABCMeta): | ||
@abstractmethod | ||
def report_start_preparation(self) -> Any: ... | ||
@abstractmethod | ||
def report_start(self, processing_file_path: Any, processing_bytes: Any) -> Any: ... | ||
@abstractmethod | ||
def report_end(self, processing_file_path: Any, wrote_bytes: Any) -> Any: ... | ||
@abstractmethod | ||
def report_warning(self, message: Any) -> Any: ... | ||
@abstractmethod | ||
def report_postprocess(self) -> Any: ... | ||
|
||
class ExtractCallback(Callback, metaclass=abc.ABCMeta): ... | ||
class ArchiveCallback(Callback, metaclass=abc.ABCMeta): ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
import argparse | ||
from py7zr.callbacks import ExtractCallback as ExtractCallback | ||
from py7zr.compressor import SupportedMethods as SupportedMethods | ||
from py7zr.helpers import Local as Local | ||
from py7zr.properties import COMMAND_HELP_STRING as COMMAND_HELP_STRING | ||
from typing import Any, Optional | ||
|
||
class CliExtractCallback(ExtractCallback): | ||
ofd: Any = ... | ||
archive_total: Any = ... | ||
total_bytes: int = ... | ||
pwidth: int = ... | ||
def __init__(self, total_bytes: Any, ofd: Any = ...) -> None: ... | ||
def report_start_preparation(self) -> None: ... | ||
def report_start(self, processing_file_path: Any, processing_bytes: Any) -> None: ... | ||
def report_end(self, processing_file_path: Any, wrote_bytes: Any) -> None: ... | ||
def report_postprocess(self) -> None: ... | ||
def report_warning(self, message: Any) -> None: ... | ||
|
||
class Cli: | ||
dunits: Any = ... | ||
parser: Any = ... | ||
unit_pattern: Any = ... | ||
def __init__(self) -> None: ... | ||
def run(self, arg: Optional[Any]=...) -> int: ... | ||
def show_version(self) -> None: ... | ||
def show_help(self, args: Any): ... | ||
def run_info(self, args: Any) -> None: ... | ||
def run_list(self, args: Any): ... | ||
@staticmethod | ||
def print_archiveinfo(archive: Any, file: Any) -> None: ... | ||
def run_test(self, args: Any): ... | ||
def run_extract(self, args: argparse.Namespace) -> int: ... | ||
def run_create(self, args: Any): ... | ||
def run_append(self, args: Any): ... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.