Blame view

config/config_base.py 1.14 KB
1192cc3d   Etienne Pallier   Nouveau système d...
1
2
3
4
# Inspired from https://whalesalad.com/blog/doing-python-configuration-right

import os

5fd14978   Etienne Pallier   Agent lit config ...
5
6
7
8
from logpyros import LogPyros



1192cc3d   Etienne Pallier   Nouveau système d...
9
10
11
12
13
14
15
16
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, # '..'
)
5fd14978   Etienne Pallier   Agent lit config ...
17
18
ROOT_DIR = os.path.normpath(ROOT_DIR)
#ROOT_DIR = os.path.realpath(ROOT_DIR)
1192cc3d   Etienne Pallier   Nouveau système d...
19
20

# root directories
5fd14978   Etienne Pallier   Agent lit config ...
21
CONFIG_DIR = os.path.join(ROOT_DIR, "config")
1192cc3d   Etienne Pallier   Nouveau système d...
22
23
24
25
26
27
28
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")
5fd14978   Etienne Pallier   Agent lit config ...
29
#PYROS_DJANGO_BASE_DIR = Path("src/core/pyros_django") # pathlib
1192cc3d   Etienne Pallier   Nouveau système d...
30
31
32
PYROS_DJANGO_DIR = os.path.join(SOURCE_DIR, "core", "pyros_django")
DEVICES_DIR = os.path.join(SOURCE_DIR, "device_controller")

5fd14978   Etienne Pallier   Agent lit config ...
33
34
35
36
37
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
1192cc3d   Etienne Pallier   Nouveau système d...
38
39

SYSTEM_REBOOT_COMMAND = "sudo systemctl restart foo.service"