Remove Tree type and adjust API to continue working
This commit is contained in:
parent
6470aee802
commit
b251614667
4 changed files with 38 additions and 126 deletions
|
|
@ -124,34 +124,6 @@ def new_child(note: Note, name: str, mime: str = DEFAULT_MIME, content: bytes |
|
|||
return note.new_child(name=name, mime=mime, content=content, executable=executable, hidden=hidden)
|
||||
|
||||
|
||||
@runtime_checkable
|
||||
class Tree(Protocol):
|
||||
def link(self, name: str, note: Note):
|
||||
"""Link name to a given note."""
|
||||
...
|
||||
|
||||
def unlink(self, name: str):
|
||||
"""Remove name from the tree."""
|
||||
...
|
||||
|
||||
def mkdir(self, name: str) -> Self:
|
||||
"""Create a new Tree with the given name."""
|
||||
...
|
||||
|
||||
def rmdir(self, name: str) -> None:
|
||||
"""Remove a directory from the tree."""
|
||||
...
|
||||
|
||||
def entries(self) -> Iterable[TreeEntry]:
|
||||
"""Return all entries in the directory"""
|
||||
...
|
||||
|
||||
|
||||
@runtime_checkable
|
||||
class TreeNote(Note, Tree, Protocol):
|
||||
"""Tree Note"""
|
||||
|
||||
|
||||
@runtime_checkable
|
||||
class Trove(Protocol):
|
||||
"""
|
||||
|
|
@ -171,6 +143,6 @@ class Trove(Protocol):
|
|||
"""Create a new blob node at the given path with content"""
|
||||
...
|
||||
|
||||
def get_root(self) -> TreeNote:
|
||||
def get_root(self) -> Note:
|
||||
"""Get Tree Node at the given path"""
|
||||
...
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue