Changeset 62243ae in sasview for src/sas/sasgui/perspectives/fitting
Legend:
- Unmodified
- Added
- Removed
-
src/sas/sasgui/perspectives/fitting/gpu_options.py
r6af411b r62243ae 13 13 import logging 14 14 from sas.sasgui.guiframe.documentation_window import DocumentationWindow 15 import imp 15 16 16 17 class GpuOptions(wx.Dialog): … … 25 26 def __init__(self, *args, **kwds): 26 27 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 28 # from sas.sasgui.guiframe.customdir import SetupCustom 29 # from sas.sasgui.guiframe.gui_manager import get_app_dir, _find_local_config 30 # 31 # PATH_APP = get_app_dir() 32 # c_conf_dir = SetupCustom().setup_dir(PATH_APP) 33 # self.custom_config = _find_local_config('custom_config', c_conf_dir) 34 # if self.custom_config is None: 35 # self.custom_config = _find_local_config('custom_config', os.getcwd()) 36 # if self.custom_config is None: 37 # msgConfig = "Custom_config file was not imported" 38 # logging.info(msgConfig) 39 # else: 40 # logging.info("using custom_config in %s" % os.getcwd()) 41 # else: 42 # logging.info("using custom_config from %s" % c_conf_dir) 43 44 # SAS_OPENCL_CUSTOM = None 45 # if self.custom_config.SAS_OPENCL: 46 # SAS_OPENCL_CUSTOM = self.custom_config.SAS_OPENCL 41 47 42 48 kwds["style"] = wx.DEFAULT_DIALOG_STYLE … … 52 58 self.buttons = [] 53 59 #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_CUSTOM56 # or as a custom variable in the config file60 self.sas_opencl = os.environ.get("SAS_OPENCL","") 61 #self.sas_opencl = os.environ["SAS_OPENCL"] \ 62 # if "SAS_OPENCL" in os.environ else SAS_OPENCL_CUSTOM 57 63 58 64 for clopt in clinfo: … … 65 71 else: 66 72 self.option_button[clopt] = "None" 67 if self.sas_opencl.lower() == "none" 73 if self.sas_opencl.lower() == "none": 68 74 button.SetValue(1) 69 75 … … 174 180 if self.sas_opencl: 175 181 os.environ["SAS_OPENCL"] = self.sas_opencl 176 182 else: 177 183 if "SAS_OPENCL" in os.environ: 178 184 del(os.environ["SAS_OPENCL"]) 179 sasmodels.kernelcl.ENV = None 180 #TODO: Write to config.py 181 self.custom_config.SAS_OPENCL = self.sas_opencl 185 186 try: 187 imp.find_module('sasmodels.kernelcl') 188 kernelcl_exist = True 189 except: 190 kernelcl_exist = False 191 if kernelcl_exist: 192 sasmodels.kernelcl.ENV = None 193 #self.custom_config.SAS_OPENCL = self.sas_opencl 182 194 183 195 #Need to reload sasmodels.core module to account SAS_OPENCL = "None"
Note: See TracChangeset
for help on using the changeset viewer.