Skip to content

Commit 3669efe

Browse files
committed
305 - refeactoring path
1 parent ab0c10b commit 3669efe

File tree

1 file changed

+10
-4
lines changed

1 file changed

+10
-4
lines changed

exasol/nb_connector/ui/access_store_ui.py

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,25 @@
1010
from exasol.nb_connector.ui.ui_styles import get_config_styles
1111

1212
DEFAULT_FILE_NAME = "ai_lab_secure_configuration_storage.sqlite"
13-
SCS_FILE = Path.home() / ".cache" / "notebook-connector" / "scs_file"
14-
SCS_FILE.parent.mkdir(parents=True, exist_ok=True)
1513

14+
def get_scs_location_file_path() -> Path:
15+
'''
16+
Returns the path to the file where the path of the SCS sqlite database file is stored
17+
'''
18+
return Path.home() / ".cache" / "notebook-connector" / "scs_file"
19+
20+
21+
get_scs_location_file_path().parent.mkdir(parents=True, exist_ok=True)
1622

1723
def get_sb_store_file():
1824
try:
19-
return SCS_FILE.read_text().strip()
25+
return get_scs_location_file_path().read_text().strip()
2026
except FileNotFoundError:
2127
return DEFAULT_FILE_NAME
2228

2329

2430
def set_sb_store_file(value):
25-
SCS_FILE.write_text(value)
31+
get_scs_location_file_path().write_text(value)
2632

2733

2834
def get_access_store_ui(root_dir: str = ".") -> widgets.Widget:

0 commit comments

Comments
 (0)