mirror of
https://github.com/simple-login/app.git
synced 2025-02-22 23:02:55 +08:00
Imports in order
This commit is contained in:
parent
3ce7317ae9
commit
23796197f7
1 changed files with 7 additions and 5 deletions
|
@ -3,12 +3,12 @@ import os
|
||||||
import sys
|
import sys
|
||||||
import json
|
import json
|
||||||
|
|
||||||
from app import config
|
|
||||||
from app.log import LOG
|
|
||||||
|
|
||||||
rootDir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
rootDir = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||||||
sys.path.append(rootDir)
|
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")
|
LOG.i(f"Reading {config.WORDS_FILE_PATH} file")
|
||||||
words = [
|
words = [
|
||||||
word.strip()
|
word.strip()
|
||||||
|
@ -23,11 +23,13 @@ serialized_words = json.dumps(words)
|
||||||
with open(destFile, "wb") as fd:
|
with open(destFile, "wb") as fd:
|
||||||
fd.write(
|
fd.write(
|
||||||
f"""#
|
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
|
import json
|
||||||
|
|
||||||
safe_words = json.loads('{serialized_words}')
|
safe_words = json.loads(
|
||||||
|
'{serialized_words}'
|
||||||
|
)
|
||||||
""".encode("utf-8")
|
""".encode("utf-8")
|
||||||
)
|
)
|
||||||
|
|
Loading…
Reference in a new issue