primer commit
This commit is contained in:
commit
cf8d9fbbb2
9 files changed
+764
No files matched your search
@@ -0,0 +1,35 @@
|
||||
import json
|
||||
from pathlib import Path
|
||||
from config_model import Config, HanaConfig, FilesConfig, OutlookConfig, MailConfig
|
||||
|
||||
########################################################
|
||||
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', {}))
|
||||
files = FilesConfig(**data.get('files', {}))
|
||||
outlook = OutlookConfig(
|
||||
client_id=data['outlook']['client_id'],
|
||||
client_secret=data['outlook']['client_secret'],
|
||||
tenant_id=data['outlook']['tenant_id'],
|
||||
download_folder=data['outlook']['download_folder'],
|
||||
verify_ssl=data['outlook'].get('verify_ssl', True),
|
||||
ca_bundle=data['outlook'].get('ca_bundle')
|
||||
)
|
||||
|
||||
mail = MailConfig(
|
||||
sender=data['mail']['sender'],
|
||||
to=data['mail']['to']
|
||||
)
|
||||
|
||||
CONFIG = Config(
|
||||
hana=hana,
|
||||
files=files,
|
||||
outlook=outlook,
|
||||
mail=mail
|
||||
)
|
||||
|
||||
########################################################
|
||||
Reference in new issue
Block a user