Skip to content
Snippets Groups Projects
Commit 419b971f authored by mhby1g21's avatar mhby1g21
Browse files

modified config_reader utils to work with GUI.py

parent 3b7b282b
Branches
Tags
1 merge request!74.3.1 - Redesign GUI and remove .bat dependencies and GDP 4.3.3 - Delete Temporary Files On Main Pipeline Run on new GUI.py
...@@ -13,17 +13,28 @@ class ConfigReader: ...@@ -13,17 +13,28 @@ class ConfigReader:
def read_config(self): def read_config(self):
config = {} config = {}
# Use config.ini from scripts directory # First try normal path
config_path = os.path.join(self.PIPELINE_DIR, "config.ini") config_path = os.path.join(self.PIPELINE_DIR, "config.ini")
try: try:
with open(config_path, 'r') as f: with open(config_path, 'r') as f:
for line in f: for line in f:
if '=' in line: if '=' in line:
key, value = line.strip().split('=', 1) key, value = line.strip().split('=', 1)
config[key.strip()] = value.strip() config[key.strip()] = value.strip()
return config
except FileNotFoundError: except FileNotFoundError:
raise Exception(f"config.ini not found in {self.PIPELINE_DIR}") # If not found, try scripts directory
scripts_config = os.path.join(self.ROOT_DIR, "scripts", "config.ini")
try:
with open(scripts_config, 'r') as f:
for line in f:
if '=' in line:
key, value = line.strip().split('=', 1)
config[key.strip()] = value.strip()
return config return config
except FileNotFoundError:
raise Exception(f"config.ini not found in {self.PIPELINE_DIR} or {os.path.dirname(scripts_config)}")
def setup_directories(self): def setup_directories(self):
return { return {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment