cargando primer proyecto a gitea
This commit is contained in:
commit
533105e7c3
16 files changed
+1327
No files matched your search
@@ -0,0 +1,24 @@
|
||||
import json
|
||||
from pathlib import Path
|
||||
from config_model import Config, HanaConfig, OutlookConfig, MailConfig, SmbConfig
|
||||
|
||||
########################################################
|
||||
CONFIG_PATH = Path(__file__).resolve().parent / "config.json"
|
||||
|
||||
with open(CONFIG_PATH, 'r', encoding='utf-8') as f:
|
||||
data = json.load(f)
|
||||
|
||||
# Instantiate dataclasses
|
||||
hana = HanaConfig(**data.get('hana', {}))
|
||||
outlook = OutlookConfig(**data.get('outlook', {}))
|
||||
smb = SmbConfig(**data.get('smb', {}))
|
||||
mails = [MailConfig(**c) for c in data.get('mails', [])]
|
||||
|
||||
CONFIG = Config(
|
||||
hana=hana,
|
||||
outlook=outlook,
|
||||
smb=smb,
|
||||
mails=mails
|
||||
)
|
||||
|
||||
########################################################
|
||||
Reference in new issue
Block a user