Skip to content
Snippets Groups Projects
Commit 7f2c26f5 authored by dmt's avatar dmt
Browse files

Load default settings if the user does not specify a path.

parent abdcd33f
No related branches found
No related tags found
No related merge requests found
"""Entry point.
"""
from cml.usecases.query import PreprocessUsecase
from os.path import join, expanduser
from cml.usecases.query import PreprocessUsecase, KnowledgeSearchUsecase
from cml.ports.source_adapters import PandasAdapter
from cml.shared.settings import Settings
from cml.shared.settings import specific_settings_factory, read_settings
......@@ -22,6 +24,20 @@ __all__ = (
)
def default_path(func):
def wrapper(path: str = None):
if not path:
path = join(expanduser("~"), ".cml", "settings.ini")
try:
func(path)
except FileNotFoundError as e:
# TODO (dmt):Provide proper exception handling!
pass
return wrapper
@default_path
def load_settings(path: str):
read_settings(path)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment