Skip to content
Snippets Groups Projects
Commit 1525ae5f authored by Kendrick, Coleman's avatar Kendrick, Coleman
Browse files

Fix cache setting for diffraction reduction gui

parent e55d7a78
No related branches found
No related tags found
No related merge requests found
......@@ -83,7 +83,7 @@ class AdvancedSetupScript(BaseScriptElement):
def cache_dir(self):
"""Passing all three candidates back as one list"""
# A comma ',' is used here since it is the default delimiter in mantid
return ",".join(self.cache_dir_scan_save, self.cache_dir_scan_1, self.cache_dir_scan_2)
return self.cache_dir_scan_save + "," + self.cache_dir_scan_1 + "," + self.cache_dir_scan_2
def __init__(self, inst_name):
""" Initialization
......@@ -179,7 +179,7 @@ class AdvancedSetupScript(BaseScriptElement):
pardict["SampleNumberDensity"] = self.samplenumberdensity
pardict["ContainerShape"] = self.containershape
#Caching options
pardict['CacheDir'] = ";".join(self.cache_dir)
pardict['CacheDir'] = self.cache_dir
pardict['CleanCache'] = str(int(self.clean_cache))
return pardict
......@@ -195,7 +195,7 @@ class AdvancedSetupScript(BaseScriptElement):
# special map for bool type
value = '1' if value else '0'
else:
value = ";".join(self.cache_dir) if keyname == "CacheDir" else str(value)
value = str(value)
xml += f"<{keyname.lower()}>{value}</{keyname.lower()}>\n"
xml += "</AdvancedSetup>\n"
......@@ -288,8 +288,13 @@ class AdvancedSetupScript(BaseScriptElement):
# Caching options
# split it into the three cache dirs
# NOTE: there should only be three entries, if not, let it fail early
self.cache_dir_scan_save, self.cache_dir_scan_1, self.cache_dir_scan_2 = BaseScriptElement.getStringElement(
instrument_dom, 'cachedir', default=";;").split(";")
try:
self.cache_dir_scan_save, self.cache_dir_scan_1, self.cache_dir_scan_2 = BaseScriptElement.getStringElement(
instrument_dom, 'cachedir', default=",,").split(",")
except ValueError:
self.cache_dir_scan_save = ''
self.cache_dir_scan_1 = ''
self.cache_dir_scan_2 = ''
tempbool = BaseScriptElement.getStringElement(instrument_dom,
"cleancache",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment