2019-09-01 11:12:30 +00:00
|
|
|
import json, os
|
|
|
|
|
|
|
|
def save(info, filename):
|
|
|
|
# Récupération du répertoire racine du repo
|
2019-09-01 11:17:43 +00:00
|
|
|
rootFolder = os.path.join(os.path.dirname(__file__), '..', '..')
|
2019-09-01 11:12:30 +00:00
|
|
|
# Répertoire pour stocker le fichier de sortie
|
|
|
|
dataFolder = os.path.join(rootFolder, 'site', 'data')
|
|
|
|
|
|
|
|
statsFilePath = os.path.abspath(
|
|
|
|
os.path.join(dataFolder, '{}.json'.format(filename)))
|
|
|
|
with open(statsFilePath, "w") as file_write:
|
|
|
|
json.dump(info, file_write)
|