24 lines
617 B
Python
24 lines
617 B
Python
|
import os, json
|
||
|
from datetime import datetime
|
||
|
|
||
|
def main():
|
||
|
|
||
|
info = {
|
||
|
"lastupdate": datetime.strftime(datetime.now(), "%d/%m/%Y %X")
|
||
|
}
|
||
|
save(info)
|
||
|
|
||
|
def save(info):
|
||
|
# Récupération du répertoire racine du repo
|
||
|
rootFolder = os.path.join(os.path.dirname(__file__), '..')
|
||
|
# Répertoire pour stocker le fichier de sortie
|
||
|
dataFolder = os.path.join(rootFolder, 'site', 'data')
|
||
|
|
||
|
statsFilePath = os.path.abspath(
|
||
|
os.path.join(dataFolder, 'global.json'))
|
||
|
with open(statsFilePath, "w") as file_write:
|
||
|
json.dump(info, file_write)
|
||
|
|
||
|
|
||
|
if __name__ == "__main__":
|
||
|
main()
|