start work on welcome wizard
This commit is contained in:
@@ -42,9 +42,9 @@ class Database:
|
||||
|
||||
def __post_init__(self):
|
||||
if isinstance(self.path, str):
|
||||
self.path = Path(self.path)
|
||||
self.path = Path(self.path).expanduser()
|
||||
if isinstance(self.temp, str):
|
||||
self.temp = Path(self.temp)
|
||||
self.temp = Path(self.temp).expanduser()
|
||||
|
||||
@dataclass
|
||||
class Mail:
|
||||
@@ -137,7 +137,7 @@ class Config:
|
||||
"""
|
||||
|
||||
_config: Optional[DictConfig] = None
|
||||
|
||||
config_exists: bool = True
|
||||
def __init__(self, config_path: str):
|
||||
"""
|
||||
Loads the configuration file and stores it for future access.
|
||||
@@ -157,9 +157,14 @@ class Config:
|
||||
base_config = base_file.read()
|
||||
with open(config_path, "w") as config_file:
|
||||
config_file.write(base_config)
|
||||
self.config_exists = False
|
||||
self._config = OmegaConf.load(config_path)
|
||||
self.config_path = config_path
|
||||
|
||||
@property
|
||||
def exists(self) -> bool:
|
||||
return self.config_exists
|
||||
|
||||
def save(self):
|
||||
"""
|
||||
Saves the current configuration to the file.
|
||||
@@ -169,6 +174,12 @@ class Config:
|
||||
"""
|
||||
OmegaConf.save(self._config, self.config_path)
|
||||
|
||||
def reload(self):
|
||||
"""
|
||||
Reloads the configuration from the file.
|
||||
"""
|
||||
self._config = OmegaConf.load(self.config_path)
|
||||
|
||||
@property
|
||||
def zotero(self):
|
||||
return Zotero(**self._config.zotero)
|
||||
|
||||
Reference in New Issue
Block a user