diff --git a/python/officiel.py b/python/officiel.py new file mode 100644 index 0000000..dda564e --- /dev/null +++ b/python/officiel.py @@ -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) + diff --git a/python/ressource.py b/python/ressource.py index 8493d6b..fddd4e6 100644 --- a/python/ressource.py +++ b/python/ressource.py @@ -3,18 +3,11 @@ import logging import re import yaml import unicodedata +from officiel import * from modeles import * __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(): """Classe modélisant les ressources"""