ComptaClub/src/comptaClub/site_config.py

20 lines
480 B
Python

# coding=utf-8
import os
import yaml
def load(request):
"""
Charge le contenu du fichier SITE_CONFIG.YAML qui contient les données relatives à l'ASBL
"""
current_path = os.path.dirname(os.path.realpath(__file__))
informations = None
with open(os.path.join(current_path, "site_config.yaml"), "r") as stream:
try:
informations = yaml.load(stream)
except yaml.YAMLError as exc:
print(exc)
return informations