Changeset 6af411b in sasview
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/perspectives/fitting/gpu_options.py
rbd55e15 r6af411b 11 11 import warnings 12 12 import wx 13 13 import logging 14 14 from sas.sasgui.guiframe.documentation_window import DocumentationWindow 15 15 … … 25 25 def __init__(self, *args, **kwds): 26 26 27 from sas.sasgui.guiframe.customdir import SetupCustom 28 29 c_conf_dir = SetupCustom().setup_dir(PATH_APP) 30 self.custom_config = _find_local_config('custom_config', c_conf_dir) 31 if self.custom_config is None: 32 self.custom_config = _find_local_config('custom_config', os.getcwd()) 33 if self.custom_config is None: 34 msgConfig = "Custom_config file was not imported" 35 logging.info(msgConfig) 36 else: 37 logging.info("using custom_config in %s" % os.getcwd()) 38 else: 39 logging.info("using custom_config from %s" % c_conf_dir) 40 SAS_OPENCL_CUSTOM = custom_config.SAS_OPENCL 41 27 42 kwds["style"] = wx.DEFAULT_DIALOG_STYLE 28 43 wx.Dialog.__init__(self, *args, **kwds) … … 36 51 self.option_button = {} 37 52 self.buttons = [] 38 #Check if SAS_OPENCL is already set 39 self.sas_opencl = os.environ.get("SAS_OPENCL","") 53 #Check if SAS_OPENCL is already set as enviromental variable 54 self.sas_opencl = os.environ["SAS_OPENCL"] \ 55 if "SAS_OPENCL" in os.environ else SAS_OPENCL_CUSTOM 56 #or as a custom variable in the config file 57 40 58 for clopt in clinfo: 41 59 button = wx.CheckBox(self.panel1, -1, label=clopt[1], name=clopt[1]) … … 156 174 if self.sas_opencl: 157 175 os.environ["SAS_OPENCL"] = self.sas_opencl 158 else:176 else: 159 177 if "SAS_OPENCL" in os.environ: 160 178 del(os.environ["SAS_OPENCL"]) 161 179 sasmodels.kernelcl.ENV = None 180 #TODO: Write to config.py 181 self.custom_config.SAS_OPENCL = self.sas_opencl 182 162 183 #Need to reload sasmodels.core module to account SAS_OPENCL = "None" 163 184 reload(sasmodels.core)
Note: See TracChangeset
for help on using the changeset viewer.