36 lines
658 B
Python
36 lines
658 B
Python
"""Compatibility layer exposing the Flask app instance."""
|
|
from __future__ import annotations
|
|
|
|
from pathlib import Path
|
|
|
|
from .database import (
|
|
DB_PATH as _DB_PATH,
|
|
DEFAULT_DB_PATH,
|
|
db_cursor,
|
|
init_db as _init_db,
|
|
is_postgres_enabled,
|
|
set_db_path,
|
|
set_postgres_override,
|
|
)
|
|
from .factory import create_app
|
|
|
|
app = create_app()
|
|
DB_PATH: Path = _DB_PATH
|
|
|
|
|
|
def init_db() -> None:
|
|
"""Initialise the database using the current DB_PATH."""
|
|
set_db_path(DB_PATH)
|
|
_init_db()
|
|
|
|
|
|
__all__ = [
|
|
"app",
|
|
"DB_PATH",
|
|
"DEFAULT_DB_PATH",
|
|
"db_cursor",
|
|
"init_db",
|
|
"is_postgres_enabled",
|
|
"set_postgres_override",
|
|
]
|