Fixed project structure

This commit is contained in:
klemek
2020-04-11 13:23:24 +02:00
parent 3fae24ba1e
commit ceee3e9a21
9 changed files with 19 additions and 10 deletions
+3 -2
View File
@@ -1,10 +1,11 @@
import json
import logging
import os.path as path
from .types import Pos, Text, Meme
from . import utils
DATA_FILE = "../memes.json"
DATA_FILE = utils.relative_path(__file__, "..", "memes.json")
DATA = {}
ALIASES = {}
@@ -117,7 +118,7 @@ def load_text(j, raw_text):
"""
if not (isinstance(raw_text, dict)):
raise TypeError(f"root is not a dict")
text = Text(f"text {j+1}")
text = Text(f"text {j + 1}")
if "font" in raw_text:
if not (isinstance(raw_text["font"], str)):
raise TypeError(f"'font' is not a str")