diff --git a/src/borg/compress.pyi b/src/borg/compress.pyi index 010e5bfc9..64defa372 100644 --- a/src/borg/compress.pyi +++ b/src/borg/compress.pyi @@ -1,4 +1,4 @@ -from typing import Any, Type +from typing import Any, Type, Dict, Tuple API_VERSION: str @@ -12,8 +12,8 @@ class CompressionSpec: class Compressor: def __init__(self, name: Any = ..., **kwargs) -> None: ... - def compress(self, data: bytes) -> bytes: ... - def decompress(self, data: bytes) -> bytes: ... + def compress(self, meta: Dict, data: bytes) -> Tuple[Dict, bytes]: ... + def decompress(self, meta: Dict, data: bytes) -> Tuple[Dict, bytes]: ... @staticmethod def detect(data: bytes) -> Any: ... diff --git a/src/borg/hashindex.pyi b/src/borg/hashindex.pyi index f368f39a5..d5f069224 100644 --- a/src/borg/hashindex.pyi +++ b/src/borg/hashindex.pyi @@ -28,9 +28,8 @@ class IndexBase: class ChunkIndexEntry(NamedTuple): refcount: int size: int - csize: int -CIE = Union[Tuple[int, int, int], Type[ChunkIndexEntry]] +CIE = Union[Tuple[int, int], Type[ChunkIndexEntry]] class ChunkKeyIterator: def __init__(self, keysize: int) -> None: ... @@ -38,7 +37,7 @@ class ChunkKeyIterator: def __next__(self) -> Tuple[bytes, Type[ChunkIndexEntry]]: ... class ChunkIndex(IndexBase): - def add(self, key: bytes, refs: int, size: int, csize: int) -> None: ... + def add(self, key: bytes, refs: int, size: int) -> None: ... def decref(self, key: bytes) -> CIE: ... def incref(self, key: bytes) -> CIE: ... def iteritems(self, marker: bytes = ...) -> Iterator: ... @@ -65,12 +64,14 @@ class NSIndex(IndexBase): def __contains__(self, key: bytes) -> bool: ... def __getitem__(self, key: bytes) -> Any: ... def __setitem__(self, key: bytes, value: Any) -> None: ... + def flags(self, key: bytes, mask: int, value: int = None) -> int: ... class NSIndex1(IndexBase): # legacy def iteritems(self, *args, **kwargs) -> Iterator: ... def __contains__(self, key: bytes) -> bool: ... def __getitem__(self, key: bytes) -> Any: ... def __setitem__(self, key: bytes, value: Any) -> None: ... + def flags(self, key: bytes, mask: int, value: int = None) -> int: ... class FuseVersionsIndex(IndexBase): def __contains__(self, key: bytes) -> bool: ... diff --git a/src/borg/item.pyi b/src/borg/item.pyi index e1683a5e3..2ecd422e9 100644 --- a/src/borg/item.pyi +++ b/src/borg/item.pyi @@ -4,7 +4,7 @@ from .helpers import StableDict API_VERSION: str -def want_bytes(v: Any, *, errors: str) -> bytes: ... +def want_bytes(v: Any, *, errors: str = ...) -> bytes: ... def chunks_contents_equal(chunks1: Iterator, chunks2: Iterator) -> bool: ... class PropDict: @@ -106,7 +106,6 @@ class ArchiveItem(PropDict): class ChunkListEntry(NamedTuple): id: bytes size: int - csize: int class Item(PropDict): @property @@ -178,6 +177,10 @@ class Item(PropDict): @deleted.setter def deleted(self, val: bool) -> None: ... @property + def hlid(self) -> bytes: ... + @hlid.setter + def hlid(self, val: bytes) -> None: ... + @property def hardlink_master(self) -> bool: ... @hardlink_master.setter def hardlink_master(self, val: bool) -> None: ...