11# Copyright (c) Jupyter Development Team.
22# Distributed under the terms of the Modified BSD License.
33
4+ from __future__ import annotations
5+
6+ from logging import Logger
47from traitlets import Int , Unicode
58from traitlets .config import LoggingConfigurable
9+
610from ypy_websocket .stores import SQLiteYStore as _SQLiteYStore
7- from ypy_websocket .stores import TempFileYStore as _TempFileYStore
11+ from ypy_websocket .stores import FileYStore
812
913
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 )
1217
1318
1419class SQLiteYStoreMetaclass (type (LoggingConfigurable ), type (_SQLiteYStore )): # type: ignore
@@ -17,7 +22,7 @@ class SQLiteYStoreMetaclass(type(LoggingConfigurable), type(_SQLiteYStore)): #
1722
1823class SQLiteYStore (LoggingConfigurable , _SQLiteYStore , metaclass = SQLiteYStoreMetaclass ):
1924 db_path = Unicode (
20- "./jupyter_ystore .db" ,
25+ ".jupyter_store .db" ,
2126 config = True ,
2227 help = """The path to the YStore database. Defaults to '.jupyter_ystore.db' in the current
2328 directory.""" ,
@@ -30,3 +35,6 @@ class SQLiteYStore(LoggingConfigurable, _SQLiteYStore, metaclass=SQLiteYStoreMet
3035 help = """The document time-to-live in seconds. Defaults to None (document history is never
3136 cleared).""" ,
3237 )
38+
39+ def __init__ (self , log : Logger | None = None ):
40+ super ().__init__ (path = self .db_path , log = log )
0 commit comments