Blob is no more. Notes now always have content.
This commit is contained in:
parent
5df3c81417
commit
ffefe4dd21
4 changed files with 28 additions and 48 deletions
|
|
@ -56,14 +56,12 @@ class Note(Protocol):
|
|||
"""Set metadata value for the given key."""
|
||||
...
|
||||
|
||||
@runtime_checkable
|
||||
class Blob(Protocol):
|
||||
def read(self) -> bytes:
|
||||
def read_content(self) -> bytes:
|
||||
"""Read the raw content of the note."""
|
||||
...
|
||||
|
||||
def write(self, data: bytes) -> None:
|
||||
"""Write new content to the note."""
|
||||
def write_content(self, data:bytes) -> None:
|
||||
"""Write the raw content of the note."""
|
||||
...
|
||||
|
||||
|
||||
|
|
@ -101,10 +99,6 @@ class Tree(Protocol):
|
|||
"""Return all entries as {name: object_id}."""
|
||||
...
|
||||
|
||||
@runtime_checkable
|
||||
class BlobNote(Note, Blob, Protocol):
|
||||
"""Blob Note"""
|
||||
|
||||
@runtime_checkable
|
||||
class TreeNote(Note, Tree, Protocol):
|
||||
"""Tree Note"""
|
||||
|
|
@ -121,7 +115,7 @@ class Trove(Protocol):
|
|||
"""Retrieve a note by a object id"""
|
||||
...
|
||||
|
||||
def create_blob(self, data: bytes | None = None) -> BlobNote:
|
||||
def create_blob(self, data: bytes | None = None) -> Note:
|
||||
"""Create a new blob node at the given path with content"""
|
||||
...
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue