Skip to content

Commit 80f6091

Browse files
committed
Add a shiny.bookmark.globals module
1 parent a63f389 commit 80f6091

File tree

2 files changed

+27
-0
lines changed

2 files changed

+27
-0
lines changed

shiny/bookmark/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
from . import _globals as globals
12
from ._bookmark import (
23
Bookmark,
34
BookmarkApp,
@@ -9,6 +10,8 @@
910
from ._restore_state import RestoreContext, RestoreContextState
1011

1112
__all__ = (
13+
# _globals
14+
"globals",
1215
# _bookmark
1316
"ShinySaveState",
1417
"Bookmark",

shiny/bookmark/_globals.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
from __future__ import annotations
2+
3+
from pathlib import Path
4+
from typing import Awaitable, Callable, Literal
5+
6+
from ..types import MISSING, MISSING_TYPE
7+
8+
# TODO: Barret: Q: Can we merge how bookmark dirs are saved / loaded?
9+
BookmarkStateSaveDir = Callable[[str], Awaitable[Path]]
10+
BookmarkStateLoadDir = Callable[[str], Awaitable[Path]]
11+
bookmark_state_save_dir: BookmarkStateSaveDir | MISSING_TYPE = MISSING
12+
bookmark_state_load_dir: BookmarkStateLoadDir | MISSING_TYPE = MISSING
13+
14+
BookmarkStore = Literal["url", "server", "disable"]
15+
bookmark_store: BookmarkStore = "disable"
16+
17+
18+
# def bookmark_store_get() -> BookmarkStore:
19+
# return bookmark_store
20+
21+
22+
# def bookmark_store_set(value: BookmarkStore) -> None:
23+
# global bookmark_store
24+
# bookmark_store = value

0 commit comments

Comments
 (0)