FanFicFare adapters fetch metadata and chapters, and its epub writer builds each book from the store. Environment variables configure the app, and a default personal.ini is copied to the config folder on first start.
28 lines
693 B
Python
28 lines
693 B
Python
"""Point every directory at a temporary folder before the app modules load."""
|
|
|
|
import os
|
|
import tempfile
|
|
from pathlib import Path
|
|
|
|
_tmp = Path(tempfile.mkdtemp(prefix="bindery-tests-"))
|
|
for name, sub in [("CONFIG_DIR", "config"), ("INGEST_DIR", "ingest"), ("TMP_DIR", "tmp")]:
|
|
os.environ[name] = str(_tmp / sub)
|
|
os.environ["BINDERY_START_THREADS"] = "false"
|
|
os.environ["UPDATE_INTERVAL_HOURS"] = "0"
|
|
for name in (
|
|
"CWA_URL",
|
|
"CWA_USERNAME",
|
|
"CWA_PASSWORD",
|
|
"CWA_DB_PATH",
|
|
"CALIBRE_DB_PATH",
|
|
"AUTH_METHOD",
|
|
"BINDERY_API_KEY",
|
|
"URL_BASE",
|
|
"CWA_ALLOWED_USERS",
|
|
):
|
|
os.environ.pop(name, None)
|
|
|
|
from bindery import config # noqa: E402
|
|
|
|
config.prepare()
|