|
@ -2,13 +2,15 @@ from typing import Any |
|
|
import json |
|
|
import json |
|
|
import os.path |
|
|
import os.path |
|
|
|
|
|
|
|
|
|
|
|
from hrochobot.utils.json_templates import TEMPLATES |
|
|
|
|
|
|
|
|
EXAMPLE_DATA = "data.example" |
|
|
EXAMPLE_DATA = "data.example" |
|
|
DATA_FOLDER = "TODO" |
|
|
DATA_FOLDER = "TODO" |
|
|
|
|
|
|
|
|
def load_json(filename: str): |
|
|
def load_json(filename: str): |
|
|
filename += ".json" |
|
|
filename += ".json" |
|
|
if not os.path.exists(filename): |
|
|
if not os.path.exists(filename): |
|
|
filename = os.path.join(EXAMPLE_DATA, os.path.basename(filename)) |
|
|
return json.loads(TEMPLATES[os.path.basename(filename)]) |
|
|
|
|
|
|
|
|
with open(filename) as f: |
|
|
with open(filename) as f: |
|
|
content = json.load(f) |
|
|
content = json.load(f) |
|
|