[DEBUG] correct the user configuration path

This commit is contained in:
Edouard DUPIN 2019-07-30 23:34:11 +02:00
parent 4c50fb154d
commit 3e432ffc21
2 changed files with 11 additions and 4 deletions

View File

@ -156,14 +156,12 @@ def parse_generic_arg(argument, active):
return False
# open configuration of island:
config_file_name = "islandConfig.py"
# TODO: Change get_run_path with folder of .island
config_file = os.path.join(tools.get_run_path(), config_file_name)
config_file = env.get_island_path_user_config()
if os.path.isfile(config_file) == True:
sys.path.append(os.path.dirname(config_file))
debug.debug("Find basic configuration file: '" + config_file + "'")
# the file exist, we can open it and get the initial configuration:
configuration_file = __import__(config_file_name[:-3])
configuration_file = __import__(env.get_system_config_name()[:-3])
if "get_exclude_path" in dir(configuration_file):
data = configuration_file.get_exclude_path()

View File

@ -25,6 +25,10 @@ def get_system_base_name():
global system_base_name
return system_base_name
def get_system_config_name():
global system_base_name
return system_base_name + "Config.py"
fetch_manifest = True
@ -96,6 +100,7 @@ elif os.path.exists(os.path.join(island_root_path, "..", "..", "..", "..", "..",
else:
#debug.error("the root path of " + get_system_base_name() + " must not be upper that 6 parent path")
pass
island_path_user_config = os.path.join(island_root_path, get_system_config_name())
island_path = os.path.join(island_root_path, "." + get_system_base_name())
island_path_config = os.path.join(island_path, "config.txt")
island_path_manifest = os.path.join(island_path, "manifest")
@ -120,4 +125,8 @@ def get_island_path_manifest():
global island_path_manifest
return island_path_manifest
def get_island_path_user_config():
global island_path_user_config
return island_path_user_config