This commit is contained in:
2022-06-11 11:29:15 +01:00
parent fcfde34c72
commit 85ced0cc20
21 changed files with 88 additions and 71 deletions

View File

@ -0,0 +1,11 @@
from .. import Config
from ..data import data_dir
import json
def load(filename:str):
with open(f'./{data_dir}/{filename}') as file:
return json.load(file)
def save(data:dict, filename:str):
with open(f'./{data_dir}/{filename}', 'w') as file:
json.dump(data, file, indent=4)

View File

@ -0,0 +1,11 @@
from .. import Config
from ..data import data
from datetime import datetime
def read(filename:str):
with open(f'./{data}/logs/{filename}') as file:
return file.readlines()
def write(filename:str, message:str):
with open(f'./{data}/logs/{filename}', 'a+') as file:
file.write(f'{datetime.now().strftime("%Y-%m-%d-%X")}: {message}\n')