mirror of
https://github.com/BOSWatch/BW3-Core.git
synced 2025-12-06 07:12:04 +01:00
Merge pull request #3 from BOSWatch/add_sys_var
System adaption for linux/windows
This commit is contained in:
commit
d060b02d45
|
|
@ -17,13 +17,23 @@
|
||||||
import logging
|
import logging
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
import platform
|
||||||
|
|
||||||
logging.debug("- %s loaded", __name__)
|
logging.debug("- %s loaded", __name__)
|
||||||
|
|
||||||
# todo searching for root part is not a nice solution atm
|
# note searching for root part is not a nice solution atm
|
||||||
ROOT_PATH = os.path.dirname(sys.modules['boswatch'].__file__).replace("\\", "/") + "/../"
|
ROOT_PATH = os.path.dirname(sys.modules['boswatch'].__file__).replace("\\", "/") + "/../"
|
||||||
|
|
||||||
|
# implements a system adaption for the paths
|
||||||
|
if platform.system() == "Linux":
|
||||||
|
LOG_PATH = "/var/log/boswatch/"
|
||||||
|
CONFIG_PATH = "/etc/opt/boswatch/"
|
||||||
|
else:
|
||||||
|
# FIXME LOG_PATH not used actually
|
||||||
|
# path is fixed in logger config.ini
|
||||||
LOG_PATH = ROOT_PATH + "log/"
|
LOG_PATH = ROOT_PATH + "log/"
|
||||||
CONFIG_PATH = ROOT_PATH + "config/"
|
CONFIG_PATH = ROOT_PATH + "config/"
|
||||||
|
|
||||||
PLUGIN_PATH = ROOT_PATH + "plugins/"
|
PLUGIN_PATH = ROOT_PATH + "plugins/"
|
||||||
CSV_PATH = ROOT_PATH + "csv/"
|
CSV_PATH = ROOT_PATH + "csv/"
|
||||||
BIN_PATH = ROOT_PATH + "_bin/"
|
BIN_PATH = ROOT_PATH + "_bin/"
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue