Imports in order

This commit is contained in:
Adrià Casajús 2025-01-15 18:33:59 +01:00
parent 3ce7317ae9
commit 23796197f7
No known key found for this signature in database
GPG key ID: F0033226A5AFC9B9

View file

@ -3,12 +3,12 @@ import os
import sys
import json
from app import config
from app.log import LOG
rootDir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
sys.path.append(rootDir)
from app import config # noqa: E402
from app.log import LOG # noqa: E402
LOG.i(f"Reading {config.WORDS_FILE_PATH} file")
words = [
word.strip()
@ -23,11 +23,13 @@ serialized_words = json.dumps(words)
with open(destFile, "wb") as fd:
fd.write(
f"""#
#This file is auto-generated. Please run {sys.argv[0]} to re-generate it
# This file is auto-generated. Please run {sys.argv[0]} to re-generate it
#
import json
safe_words = json.loads('{serialized_words}')
safe_words = json.loads(
'{serialized_words}'
)
""".encode("utf-8")
)