Add fs implementation and add to trove

This commit is contained in:
Andrew Mulbrook 2026-03-19 22:43:11 -05:00
parent 2cfe32b333
commit f80f4d12a2
5 changed files with 308 additions and 8 deletions

View file

@ -4,6 +4,10 @@ from pathlib import PurePosixPath
NODE_ROOT_ID = 1
class BadNoteType(TypeError):
"""Raised when an invalid note type is encountered."""
@runtime_checkable
class Note(Protocol):
"""
@ -47,6 +51,14 @@ class Tree(Protocol):
"""Create a new Tree with the given name."""
...
def rmdir(self, name: str) -> None:
"""Remove a directory from the tree."""
...
def child(self, name: str) -> Note:
"""Retrieve a child not by name."""
...
def list(self) -> dict[str, int]:
"""Return all entries as {name: object_id}."""
...