ComptaInde/comptabilite/facture_config.py

18 lines
485 B
Python

import os
import yaml
def loadFactureConfig(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, "facture_config.yaml"), 'r') as stream:
try:
informations = yaml.safe_load(stream)
except yaml.YAMLError as exc:
print(exc)
return informations