1
1
# Copyright (c) Jupyter Development Team.
2
2
# Distributed under the terms of the Modified BSD License.
3
3
4
+ from __future__ import annotations
5
+
6
+ from logging import Logger
4
7
from traitlets import Int , Unicode
5
8
from traitlets .config import LoggingConfigurable
9
+
6
10
from ypy_websocket .stores import SQLiteYStore as _SQLiteYStore
7
- from ypy_websocket .stores import TempFileYStore as _TempFileYStore
11
+ from ypy_websocket .stores import FileYStore
8
12
9
13
10
- class TempFileYStore (_TempFileYStore ):
11
- prefix_dir = "jupyter_ystore_"
14
+ class TempFileYStore (FileYStore ):
15
+ def __init__ (self , log : Logger | None = None ):
16
+ super ().__init__ (path = ".jupyter_store" , log = log )
12
17
13
18
14
19
class SQLiteYStoreMetaclass (type (LoggingConfigurable ), type (_SQLiteYStore )): # type: ignore
@@ -17,7 +22,7 @@ class SQLiteYStoreMetaclass(type(LoggingConfigurable), type(_SQLiteYStore)): #
17
22
18
23
class SQLiteYStore (LoggingConfigurable , _SQLiteYStore , metaclass = SQLiteYStoreMetaclass ):
19
24
db_path = Unicode (
20
- "./jupyter_ystore .db" ,
25
+ ".jupyter_store .db" ,
21
26
config = True ,
22
27
help = """The path to the YStore database. Defaults to '.jupyter_ystore.db' in the current
23
28
directory.""" ,
@@ -30,3 +35,6 @@ class SQLiteYStore(LoggingConfigurable, _SQLiteYStore, metaclass=SQLiteYStoreMet
30
35
help = """The document time-to-live in seconds. Defaults to None (document history is never
31
36
cleared).""" ,
32
37
)
38
+
39
+ def __init__ (self , log : Logger | None = None ):
40
+ super ().__init__ (path = self .db_path , log = log )
0 commit comments