Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 0 additions & 41 deletions src/borg/_item.c

This file was deleted.

3 changes: 0 additions & 3 deletions src/borg/item.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -128,9 +128,6 @@ class Item(PropDict):
def _is_type(self, typetest: Callable) -> bool: ...
@classmethod
def create_deleted(self, path) -> Item: ...
@classmethod
def from_optr(self, optr: Any) -> Item: ...
def to_optr(self) -> Any: ...
@property
def atime(self) -> int: ...
@atime.setter
Expand Down
24 changes: 0 additions & 24 deletions src/borg/item.pyx
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,6 @@ from .helpers.msgpack import timestamp_to_int, int_to_timestamp, Timestamp
from .helpers.time import OutputTimestamp, safe_timestamp


cdef extern from "_item.c":
object _object_to_optr(object obj)
object _optr_to_object(object bytes)





Expand Down Expand Up @@ -337,25 +332,6 @@ cdef class Item(PropDict):
setattr(self, attr, size)
return size

def to_optr(self):
"""
Return an "object pointer" (optr), an opaque bag of bytes.
The return value is effectively a reference to this object
that can be passed exactly once to Item.from_optr to get this
object back.

to_optr/from_optr must be used symmetrically,
don't call from_optr multiple times.

This object can't be deallocated after a call to to_optr()
until from_optr() is called.
"""
return _object_to_optr(self)

@classmethod
def from_optr(self, optr):
return _optr_to_object(optr)

@classmethod
def create_deleted(cls, path):
return cls(deleted=True, chunks=[], mode=0, path=path)
Expand Down
5 changes: 0 additions & 5 deletions src/borg/testsuite/item_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,11 +152,6 @@ def test_item_file_size_no_chunks():
assert item.get_size() == 0


def test_item_optr():
item = Item()
assert Item.from_optr(item.to_optr()) is item


@pytest.mark.parametrize(
"chunk_a, chunk_b, chunks_equal",
[
Expand Down
Loading