venture-studio / pixel_cursor /_internal.py
AlterProgramming's picture
Initial venture-studio deploy: pixel_cursor + studio + app.py
1e3ce4c verified
Raw
History Blame Contribute Delete
604 Bytes
"""Internal mutation token. Only pixel_cursor.* should import this module."""
from __future__ import annotations
class _Token:
__slots__ = ()
def __repr__(self) -> str:
return "<pixel_cursor mutation token>"
_MUTATION_TOKEN = _Token()
def _verify(token: object) -> None:
if token is not _MUTATION_TOKEN:
raise PermissionError(
"Artifact construction requires the pixel_cursor mutation token. "
"All Artifact creation and mutation must go through a PixelCursor "
"(see pixel_cursor.open_cursor and cursor.write_* methods)."
)