fsfw-example-hosted/generators/definitions.py

21 lines
540 B
Python
Raw Normal View History

2022-05-20 09:12:36 +02:00
import os
2021-06-21 10:36:53 +02:00
import enum
2022-05-20 09:12:36 +02:00
from pathlib import Path
2021-06-21 10:36:53 +02:00
2022-05-20 09:12:36 +02:00
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("..")
2021-06-21 10:36:53 +02:00
2022-05-20 09:12:36 +02:00
PATH_VAR_ROOT = os.path.dirname(os.path.realpath(__file__))
ROOT_DIR = PATH_VAR_ROOT
OBSW_ROOT_DIR = Path(determine_obsw_root_path())
COMMON_SUBMODULE_NAME = "example_common"
EXAMPLE_COMMON_DIR = f"{OBSW_ROOT_DIR}/{COMMON_SUBMODULE_NAME}"
DATABASE_NAME = "eive_mod.db"
BSP_HOSTED = "bsp_hosted"