Déporte les données officielles dans officiel.py

This commit is contained in:
Cléo Baras 2021-03-30 07:59:21 +02:00
parent 159db50add
commit 02afdb60db
2 changed files with 14 additions and 8 deletions

13
python/officiel.py Normal file
View File

@ -0,0 +1,13 @@
import logging, yaml
__LOGGER = logging.getLogger(__name__)
# Récupère les informations officielles sur les ressources (code/nom)
with open("pn/ressources.yml", 'r', encoding="utf8") as fid:
DATA_RESSOURCES = yaml.load(fid.read(), Loader=yaml.Loader)
# Récupère les données officielles des ACs
with open("pn/acs.yml", 'r', encoding="utf8") as fid:
DATA_ACS = yaml.load(fid.read(), Loader=yaml.Loader)
with open("pn/saes.yml", 'r', encoding="utf8") as fid:
DATA_SAES = yaml.load(fid.read(), Loader=yaml.Loader)

View File

@ -3,18 +3,11 @@ import logging
import re import re
import yaml import yaml
import unicodedata import unicodedata
from officiel import *
from modeles import * from modeles import *
__LOGGER = logging.getLogger(__name__) __LOGGER = logging.getLogger(__name__)
# Récupère les informations officielles sur les ressources (code/nom)
with open("pn/ressources.yml", 'r', encoding="utf8") as fid:
DATA_RESSOURCES = yaml.load(fid.read(), Loader=yaml.Loader)
# Récupère les données officielles des ACs
with open("pn/acs.yml", 'r', encoding="utf8") as fid:
DATA_ACS = yaml.load(fid.read(), Loader=yaml.Loader)
with open("pn/saes.yml", 'r', encoding="utf8") as fid:
DATA_SAES = yaml.load(fid.read(), Loader=yaml.Loader)
class Ressource(): class Ressource():
"""Classe modélisant les ressources""" """Classe modélisant les ressources"""