eive-obsw/generators/definitions.py
2022-03-04 10:26:29 +01:00

24 lines
531 B
Python

import os
import enum
from pathlib import Path
def determine_obsw_root_path() -> str:
for _ in range(5):
if os.path.exists("CMakeLists.txt"):
return os.path.abspath(os.curdir)
else:
os.chdir("..")
PATH_VAR_ROOT = os.path.dirname(os.path.realpath(__file__))
ROOT_DIR = PATH_VAR_ROOT
OBSW_ROOT_DIR = Path(determine_obsw_root_path())
DATABASE_NAME = "eive_mod.db"
class BspType(enum.Enum):
BSP_Q7S = "bsp_q7s"
BSP_HOSTED = "bsp_hosted"
BSP_LINUX_BOARD = "bsp_linux_board"