Add initial CLI support
This commit is contained in:
parent
e16d67e2f8
commit
22a9c68611
14 changed files with 168 additions and 26 deletions
|
|
@ -1,21 +1,25 @@
|
|||
from typing import Protocol, runtime_checkable, Optional, Dict, List, Self, NamedTuple, Iterable, MappingView
|
||||
from typing import Protocol, runtime_checkable, Optional, Dict, List, Self, NamedTuple, Iterable, TypedDict
|
||||
from uuid import UUID
|
||||
from pathlib import PurePosixPath
|
||||
|
||||
|
||||
type ObjectId = int
|
||||
type ObjectId = int | str | UUID
|
||||
|
||||
NODE_ROOT_ID: ObjectId = 1
|
||||
class TroveError(Exception):
|
||||
"""Base class for all Trove errors."""
|
||||
|
||||
class BadNoteType(TypeError):
|
||||
"""Raised when an invalid note type is encountered."""
|
||||
|
||||
class TreeExists(TypeError):
|
||||
class TreeExists(RuntimeError):
|
||||
"""Raised when a label already exists."""
|
||||
|
||||
class NoteNotFound(KeyError):
|
||||
"""Raised when a note is not found."""
|
||||
|
||||
class OpenArguments(TypedDict):
|
||||
create: bool
|
||||
|
||||
@runtime_checkable
|
||||
class Note(Protocol):
|
||||
"""
|
||||
|
|
@ -87,7 +91,6 @@ class TreeNote(Note, Tree):
|
|||
"""Tree Note"""
|
||||
|
||||
|
||||
|
||||
@runtime_checkable
|
||||
class Trove(Protocol):
|
||||
"""
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue