28 lines
789 B
Python
28 lines
789 B
Python
import os
|
|
from collections import deque
|
|
from enum import StrEnum
|
|
from pathlib import Path
|
|
|
|
from dotenv import load_dotenv
|
|
|
|
# Tool/ is one level below RPA_dashboard/
|
|
REPORTS_DIR = Path(__file__).resolve().parent.parent
|
|
|
|
load_dotenv(REPORTS_DIR / '.env')
|
|
|
|
TMPL_DIR = REPORTS_DIR / "templates"
|
|
CSS_PATH = REPORTS_DIR / "static" / "css" / "style.css"
|
|
PAGES_CSS_DIR = REPORTS_DIR / "static" / "css"
|
|
JS_DIR = REPORTS_DIR / "static" / "js"
|
|
|
|
class DbType(StrEnum):
|
|
REG_LOMB = 'reg_Lomb'
|
|
INTRAZ = 'Intraz'
|
|
UNKNOWN = 'unknown'
|
|
|
|
_db_dir_env = os.environ.get('RPA_DB_DIR', '')
|
|
DB_DEFAULT_DIR = Path(_db_dir_env) if _db_dir_env else REPORTS_DIR.parent / "data_rpa" / "db"
|
|
|
|
_access_log: deque = deque(maxlen=200)
|
|
_state: dict = {'db_path': '', 'db_type': DbType.UNKNOWN}
|