From 14df904a400b583dac09b13e57324cb2572e29b5 Mon Sep 17 00:00:00 2001
From: David Trattnig <david.trattnig@o94.at>
Date: Fri, 16 Oct 2020 18:50:32 +0200
Subject: [PATCH] Section for defaults. #43

---
 modules/base/config.py | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/modules/base/config.py b/modules/base/config.py
index aec8eba3..af908206 100644
--- a/modules/base/config.py
+++ b/modules/base/config.py
@@ -45,15 +45,19 @@ class AuraConfig:
         Args:
             ini_path(String):      The path to the configuration file `engine.ini`
         """
+        self.logger = logging.getLogger("AuraEngine")  
         config_file = Path(ini_path)
         if not config_file.is_file():
             ini_path = "%s/configuration/engine.ini" % Path(__file__).parent.parent.parent.absolute()
 
         self.ini_path = ini_path
-        self.set("config_dir", os.path.dirname(ini_path))
-        self.logger = logging.getLogger("AuraEngine")
         self.load_config()
 
+        # Defaults
+        self.set("config_dir", os.path.dirname(ini_path))      
+        self.set("install_dir", os.path.realpath(__file__ + "../../../.."))
+        self.set("use_test_data", False) # TODO Still needed?
+
 
 
     def set(self, key, value):
@@ -133,9 +137,6 @@ class AuraConfig:
                 v = config_parser.get(section, key).replace('"', '').strip()
                 self.set(key, v)
 
-        # Custom overrides and defaults
-        self.set("install_dir", os.path.realpath(__file__ + "../../../.."))
-        self.set("use_test_data", False)
 
 
 
-- 
GitLab