config_base.py
1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
# 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")
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"