Source
xxxxxxxxxx
393
393
394
394
Notes:
395
395
- The function assumes the configuration file has lines formatted as 'key==value'.
396
396
- If a value contains '.dev', it is modified to follow the 'CAS-' prefix format.
397
397
398
398
"""
399
399
with open(conf) as f:
400
400
lines = [line.rstrip() for line in f]
401
401
outDict = dict(x.split('==') for x in lines)
402
402
for key in list(outDict.keys()):
403
-
if ".dev" in outDict[key]:
403
+
if (".dev" in outDict[key]) and ("casaconfig" not in key):
404
404
tag = re.findall(r"a([\s\S]*)$",outDict[key])[0]
405
405
outDict[key] = "CAS-" + tag.replace(".dev","-")
406
406
return outDict
407
407
408
408
def run_shell_command(cmd, run_directory):
409
409
"""
410
410
Executes a shell command in the specified directory, using ShellRunner if available, or falling back to subprocess.
411
411
412
412
This function attempts to execute the given shell command using the ShellRunner utility. If ShellRunner encounters
413
413
an error, the function falls back to using the subprocess module to run the command. The command is executed in the