config_base.py 1.19 KB
# Inspired from https://whalesalad.com/blog/doing-python-configuration-right

import os

from logpyros import LogPyros



APP_NAME = "PYROS"

# Conveniences to always have a quick reference to the
# top-level application directory.
ROOT_DIR = os.path.join(
    os.path.dirname(os.path.realpath(__file__)),
    os.pardir, # '..'
)
ROOT_DIR = os.path.normpath(ROOT_DIR)
#ROOT_DIR = os.path.realpath(ROOT_DIR)

# root directories
#CONFIG_DIR = os.path.join(ROOT_DIR, "config")
CONFIG_DIR = os.path.join(ROOT_DIR, "old_config")
DOC_DIR = os.path.join(ROOT_DIR, "doc")
INSTALL_DIR = os.path.join(ROOT_DIR, "install")
LOG_DIR = os.path.join(ROOT_DIR, "config", "logs")
SOURCE_DIR = os.path.join(ROOT_DIR, "src")

# source sub-directories
CELME_DIR = os.path.join(SOURCE_DIR, "core", "celme")
#PYROS_DJANGO_BASE_DIR = Path("src/core/pyros_django") # pathlib
PYROS_DJANGO_DIR = os.path.join(SOURCE_DIR, "core", "pyros_django")
DEVICES_DIR = os.path.join(SOURCE_DIR, "device_controller")

DEFAULT_CONFIG_FILE_NAME = "config_unit_simulunit1.xml"
#CONFIG_DIR_NAME = "config"

# Default LOG level is INFO
PYROS_DEFAULT_GLOBAL_LOG_LEVEL = LogPyros.LOG_LEVEL_INFO # INFO

SYSTEM_REBOOT_COMMAND = "sudo systemctl restart foo.service"